drop the dead code and close the gaps in the verification gate
This commit is contained in:
@@ -719,9 +719,7 @@ fn detect_pipe_framerate(monitor: Monitor) -> u32 {
|
|||||||
monitor_refresh_rate(monitor)
|
monitor_refresh_rate(monitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find the monitor containing the given screen point using the Win32 API.
|
/// Find the monitor containing the given screen point, falling back to the
|
||||||
/// Falls back to the primary monitor if no monitor is found.
|
|
||||||
/// Resolve the monitor containing the given screen point, falling back to the
|
|
||||||
/// primary monitor on failure.
|
/// primary monitor on failure.
|
||||||
fn monitor_at_point(x: i32, y: i32) -> Result<Monitor> {
|
fn monitor_at_point(x: i32, y: i32) -> Result<Monitor> {
|
||||||
use windows::Win32::Foundation::POINT;
|
use windows::Win32::Foundation::POINT;
|
||||||
|
|||||||
@@ -635,8 +635,7 @@ fn gif_shrink_factor(mode: GifBudgetMode, ratio: f64) -> f64 {
|
|||||||
GifBudgetMode::Balanced => {
|
GifBudgetMode::Balanced => {
|
||||||
// Split the required reduction between resolution and fps so we
|
// Split the required reduction between resolution and fps so we
|
||||||
// reduce both proportionally rather than halving resolution alone.
|
// reduce both proportionally rather than halving resolution alone.
|
||||||
let half = 0.5_f64;
|
(ratio * 0.5 + ratio.sqrt() * 0.5).clamp(0.1, 1.0)
|
||||||
(ratio * (1.0 - half) + ratio.sqrt() * half).clamp(0.1, 1.0)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -875,14 +875,14 @@ fn stop_capture(state: State<'_, AppState>) -> Result<RecordedClip, String> {
|
|||||||
for ap in &ss.audio_segments {
|
for ap in &ss.audio_segments {
|
||||||
drop(std::fs::remove_file(ap));
|
drop(std::fs::remove_file(ap));
|
||||||
}
|
}
|
||||||
} else if video_concat != final_path {
|
} else {
|
||||||
|
// No audio to mux. `video_concat` is either the one segment or the
|
||||||
|
// concat output, and `final_path` is always recording.mp4, so it always
|
||||||
|
// needs moving into place.
|
||||||
std::fs::rename(&video_concat, &final_path)
|
std::fs::rename(&video_concat, &final_path)
|
||||||
.or_else(|_| std::fs::copy(&video_concat, &final_path).map(|_| ()))
|
.or_else(|_| std::fs::copy(&video_concat, &final_path).map(|_| ()))
|
||||||
.map_err(|e| format!("finalizing: {e:#}"))?;
|
.map_err(|e| format!("finalizing: {e:#}"))?;
|
||||||
drop(std::fs::remove_file(&video_concat));
|
drop(std::fs::remove_file(&video_concat));
|
||||||
} else {
|
|
||||||
// No audio and a single segment: the concat output already sits at
|
|
||||||
// final_path, so there is nothing left to move.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let clip = RecordedClip {
|
let clip = RecordedClip {
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
min={minTargetMB(clip.duration_secs)}
|
min={minTargetMB(clip.duration_secs)}
|
||||||
max={maxTargetMB(clip.duration_secs)}
|
max={maxTargetMB(clip.duration_secs)}
|
||||||
step="0.1"
|
step="0.1"
|
||||||
|
aria-label="target size"
|
||||||
bind:value={targetMB}
|
bind:value={targetMB}
|
||||||
onchange={onPreview}
|
onchange={onPreview}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
min={2}
|
min={2}
|
||||||
max={256}
|
max={256}
|
||||||
step={1}
|
step={1}
|
||||||
|
aria-label="colors"
|
||||||
bind:value={colors}
|
bind:value={colors}
|
||||||
onchange={onChange}
|
onchange={onChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -58,7 +58,6 @@
|
|||||||
let audioWarning: string | null = $state(null)
|
let audioWarning: string | null = $state(null)
|
||||||
let retryingAudio: boolean = $state(false)
|
let retryingAudio: boolean = $state(false)
|
||||||
let useFrame: boolean = $state(false)
|
let useFrame: boolean = $state(false)
|
||||||
let previewTimer: number | null = null
|
|
||||||
let thumbCache: Map<string, string[]> = $state(new Map())
|
let thumbCache: Map<string, string[]> = $state(new Map())
|
||||||
let showDiscardConfirm: boolean = $state(false)
|
let showDiscardConfirm: boolean = $state(false)
|
||||||
let aspectLock: number | null = $state(null)
|
let aspectLock: number | null = $state(null)
|
||||||
@@ -350,7 +349,6 @@
|
|||||||
thumbnails = []; deletedFrames = new Set()
|
thumbnails = []; deletedFrames = new Set()
|
||||||
thumbCache = new Map()
|
thumbCache = new Map()
|
||||||
previewPath = null; resetTrimPreview()
|
previewPath = null; resetTrimPreview()
|
||||||
if (previewTimer !== null) { clearTimeout(previewTimer); previewTimer = null }
|
|
||||||
elapsed = 0; phase = "idle"
|
elapsed = 0; phase = "idle"
|
||||||
if (config) {
|
if (config) {
|
||||||
format = config.export.default_format
|
format = config.export.default_format
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
} else {
|
} else {
|
||||||
stopTimer()
|
stopTimer()
|
||||||
}
|
}
|
||||||
if (e.payload.phase === "idle") { elapsed = 0; phase = "idle" }
|
if (e.payload.phase === "idle") elapsed = 0
|
||||||
phase = e.payload.phase
|
phase = e.payload.phase
|
||||||
}
|
}
|
||||||
).then(fn => cleanup.push(fn))
|
).then(fn => cleanup.push(fn))
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
place-items: center;
|
place-items: center;
|
||||||
aspect-ratio: 16 / 9;
|
aspect-ratio: 16 / 9;
|
||||||
}
|
}
|
||||||
.preview-box.empty { aspect-ratio: 16 / 9; }
|
|
||||||
.preview-img {
|
.preview-img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -127,6 +127,7 @@
|
|||||||
<button
|
<button
|
||||||
class="tab"
|
class="tab"
|
||||||
class:active={activeTab === t.id}
|
class:active={activeTab === t.id}
|
||||||
|
aria-current={activeTab === t.id ? "true" : undefined}
|
||||||
onclick={() => activeTab = t.id}
|
onclick={() => activeTab = t.id}
|
||||||
>{t.label}</button>
|
>{t.label}</button>
|
||||||
{/each}
|
{/each}
|
||||||
|
|||||||
@@ -6,12 +6,10 @@
|
|||||||
clip,
|
clip,
|
||||||
trimStart = $bindable(),
|
trimStart = $bindable(),
|
||||||
trimEnd = $bindable(),
|
trimEnd = $bindable(),
|
||||||
onAfterChange = () => {},
|
|
||||||
}: {
|
}: {
|
||||||
clip: { temp_path: string; duration_secs: number; width: number; height: number }
|
clip: { temp_path: string; duration_secs: number; width: number; height: number }
|
||||||
trimStart: number
|
trimStart: number
|
||||||
trimEnd: number
|
trimEnd: number
|
||||||
onAfterChange?: () => void
|
|
||||||
} = $props()
|
} = $props()
|
||||||
|
|
||||||
let trackEl: HTMLDivElement | null = $state(null)
|
let trackEl: HTMLDivElement | null = $state(null)
|
||||||
@@ -60,7 +58,6 @@
|
|||||||
el.releasePointerCapture(e.pointerId)
|
el.releasePointerCapture(e.pointerId)
|
||||||
trimPreviewState.dragging = null
|
trimPreviewState.dragging = null
|
||||||
trimPreviewState.path = null
|
trimPreviewState.path = null
|
||||||
onAfterChange()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTrackClick(e: PointerEvent) {
|
function onTrackClick(e: PointerEvent) {
|
||||||
@@ -73,7 +70,6 @@
|
|||||||
} else {
|
} else {
|
||||||
trimEnd = Math.max(secs, trimStart + 0.1)
|
trimEnd = Math.max(secs, trimStart + 0.1)
|
||||||
}
|
}
|
||||||
onAfterChange()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let trimmedDuration = $derived(Math.max(0.1, trimEnd - trimStart))
|
let trimmedDuration = $derived(Math.max(0.1, trimEnd - trimStart))
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ if (-not (Test-Path (Join-Path $root 'node_modules'))) {
|
|||||||
Push-Location $root
|
Push-Location $root
|
||||||
try {
|
try {
|
||||||
$null = Invoke-Step 'svelte-check (frontend types)' { npm run check }
|
$null = Invoke-Step 'svelte-check (frontend types)' { npm run check }
|
||||||
|
# Type checking does not exercise Rollup, so a broken entry or import still
|
||||||
|
# needs the real build to be caught.
|
||||||
|
$null = Invoke-Step 'vite build' { npm run build }
|
||||||
if ($failures.Count -eq 0) { $null = Invoke-Step 'cargo check' { cargo check --manifest-path src-tauri/Cargo.toml } }
|
if ($failures.Count -eq 0) { $null = Invoke-Step 'cargo check' { cargo check --manifest-path src-tauri/Cargo.toml } }
|
||||||
# -D warnings matters: clippy exits 0 when it only has warnings, so without
|
# -D warnings matters: clippy exits 0 when it only has warnings, so without
|
||||||
# this the gate passes on a warning-laden build.
|
# this the gate passes on a warning-laden build.
|
||||||
|
|||||||
Reference in New Issue
Block a user