diff --git a/src-tauri/src/capture.rs b/src-tauri/src/capture.rs index 512f14c..7d47fd1 100644 --- a/src-tauri/src/capture.rs +++ b/src-tauri/src/capture.rs @@ -719,9 +719,7 @@ fn detect_pipe_framerate(monitor: Monitor) -> u32 { monitor_refresh_rate(monitor) } -/// Find the monitor containing the given screen point using the Win32 API. -/// Falls back to the primary monitor if no monitor is found. -/// Resolve the monitor containing the given screen point, falling back to the +/// Find the monitor containing the given screen point, falling back to the /// primary monitor on failure. fn monitor_at_point(x: i32, y: i32) -> Result { use windows::Win32::Foundation::POINT; diff --git a/src-tauri/src/encode.rs b/src-tauri/src/encode.rs index 8176221..c4ac9ee 100644 --- a/src-tauri/src/encode.rs +++ b/src-tauri/src/encode.rs @@ -635,8 +635,7 @@ fn gif_shrink_factor(mode: GifBudgetMode, ratio: f64) -> f64 { GifBudgetMode::Balanced => { // Split the required reduction between resolution and fps so we // reduce both proportionally rather than halving resolution alone. - let half = 0.5_f64; - (ratio * (1.0 - half) + ratio.sqrt() * half).clamp(0.1, 1.0) + (ratio * 0.5 + ratio.sqrt() * 0.5).clamp(0.1, 1.0) } } } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 3b858a1..6aaa79e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -875,14 +875,14 @@ fn stop_capture(state: State<'_, AppState>) -> Result { for ap in &ss.audio_segments { 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) .or_else(|_| std::fs::copy(&video_concat, &final_path).map(|_| ())) .map_err(|e| format!("finalizing: {e:#}"))?; 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 { diff --git a/src/lib/ExportSidebar.svelte b/src/lib/ExportSidebar.svelte index b993561..df444a6 100644 --- a/src/lib/ExportSidebar.svelte +++ b/src/lib/ExportSidebar.svelte @@ -76,6 +76,7 @@ min={minTargetMB(clip.duration_secs)} max={maxTargetMB(clip.duration_secs)} step="0.1" + aria-label="target size" bind:value={targetMB} onchange={onPreview} /> diff --git a/src/lib/GifControls.svelte b/src/lib/GifControls.svelte index acd2c86..902cc4f 100644 --- a/src/lib/GifControls.svelte +++ b/src/lib/GifControls.svelte @@ -41,6 +41,7 @@ min={2} max={256} step={1} + aria-label="colors" bind:value={colors} onchange={onChange} /> diff --git a/src/lib/Main.svelte b/src/lib/Main.svelte index ab5c114..25b2e0a 100644 --- a/src/lib/Main.svelte +++ b/src/lib/Main.svelte @@ -58,7 +58,6 @@ let audioWarning: string | null = $state(null) let retryingAudio: boolean = $state(false) let useFrame: boolean = $state(false) - let previewTimer: number | null = null let thumbCache: Map = $state(new Map()) let showDiscardConfirm: boolean = $state(false) let aspectLock: number | null = $state(null) @@ -350,7 +349,6 @@ thumbnails = []; deletedFrames = new Set() thumbCache = new Map() previewPath = null; resetTrimPreview() - if (previewTimer !== null) { clearTimeout(previewTimer); previewTimer = null } elapsed = 0; phase = "idle" if (config) { format = config.export.default_format diff --git a/src/lib/Overlay.svelte b/src/lib/Overlay.svelte index 9af2036..388e7e0 100644 --- a/src/lib/Overlay.svelte +++ b/src/lib/Overlay.svelte @@ -60,7 +60,7 @@ } else { stopTimer() } - if (e.payload.phase === "idle") { elapsed = 0; phase = "idle" } + if (e.payload.phase === "idle") elapsed = 0 phase = e.payload.phase } ).then(fn => cleanup.push(fn)) diff --git a/src/lib/Preview.svelte b/src/lib/Preview.svelte index 0da762d..1b367f2 100644 --- a/src/lib/Preview.svelte +++ b/src/lib/Preview.svelte @@ -40,7 +40,6 @@ place-items: center; aspect-ratio: 16 / 9; } - .preview-box.empty { aspect-ratio: 16 / 9; } .preview-img { width: 100%; height: 100%; diff --git a/src/lib/Settings.svelte b/src/lib/Settings.svelte index cb0e51c..53be9b9 100644 --- a/src/lib/Settings.svelte +++ b/src/lib/Settings.svelte @@ -127,6 +127,7 @@ {/each} diff --git a/src/lib/TrimPanel.svelte b/src/lib/TrimPanel.svelte index 0ad141b..0a30b8d 100644 --- a/src/lib/TrimPanel.svelte +++ b/src/lib/TrimPanel.svelte @@ -6,12 +6,10 @@ clip, trimStart = $bindable(), trimEnd = $bindable(), - onAfterChange = () => {}, }: { clip: { temp_path: string; duration_secs: number; width: number; height: number } trimStart: number trimEnd: number - onAfterChange?: () => void } = $props() let trackEl: HTMLDivElement | null = $state(null) @@ -60,7 +58,6 @@ el.releasePointerCapture(e.pointerId) trimPreviewState.dragging = null trimPreviewState.path = null - onAfterChange() } function onTrackClick(e: PointerEvent) { @@ -73,7 +70,6 @@ } else { trimEnd = Math.max(secs, trimStart + 0.1) } - onAfterChange() } let trimmedDuration = $derived(Math.max(0.1, trimEnd - trimStart)) diff --git a/verify.ps1 b/verify.ps1 index 5887dae..d7ecbe4 100644 --- a/verify.ps1 +++ b/verify.ps1 @@ -62,6 +62,9 @@ if (-not (Test-Path (Join-Path $root 'node_modules'))) { Push-Location $root try { $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 } } # -D warnings matters: clippy exits 0 when it only has warnings, so without # this the gate passes on a warning-laden build.