quality pass 2: cached encoders, cancel in gif retry, overlay CSS split

- debug logging in picker changed to tracing::debug
- show_overlay uses visible_window_bounds helper
- encode_gif retry loop checks cancel flag between attempts
- list_encoders cached via OnceLock (ffmpeg -encoders runs once)
- remove unnecessary GifBudgetMode clone (is Copy)
- config test uses unique temp dir per process
- click highlights use 2px border instead of solid fill
- audio capture_loop polls at 5ms instead of 1ms
- overlay window loads minimal overlay.css instead of full app.css
- remove non-spec 960x540 preset
- Settings dirty detection uses field-by-field comparison
- Overlay startDragging catches errors
- pauseRec only emits recording-state on success
- Picker listener cleanup guards against unmount race
- add sync notes for previewDims and sr-only trim inputs
This commit is contained in:
2026-05-30 00:01:56 +03:00
parent d57e554ece
commit 2cd836b09e
10 changed files with 65 additions and 35 deletions
+3 -2
View File
@@ -59,13 +59,13 @@
const PRESETS: [number, number, string][] = [
[1280, 720, "720p"],
[1920, 1080, "1080p"],
[960, 540, "16:9"],
[800, 800, "1:1"],
[540, 960, "9:16"],
]
// Derived
let trimmedDuration = $derived(Math.max(0.1, trimEnd - trimStart))
// NOTE: This logic mirrors gif_params() in encode.rs. Keep in sync.
let previewDims = $derived.by(() => {
if (!clip) return ""
if (format === "gif") {
@@ -196,10 +196,10 @@
await api.pauseCapture()
clearTick()
phase = "paused"
void emit("recording-state", { phase: "paused", fps })
} catch (e) {
errMsg = String(e)
}
void emit("recording-state", { phase: "paused", fps })
}
async function resumeRec() {
@@ -624,6 +624,7 @@
}}
></div>
</div>
<!-- Screen reader alternative: these range inputs mirror the drag handle positions. -->
<input type="range" min="0" max={clip.duration_secs} step="0.05" value={trimStart}
oninput={(e) => { const v = parseFloat((e.currentTarget as HTMLInputElement).value); trimStart = Math.min(v, trimEnd - 0.1) }}
class="sr-only" aria-label="trim start seconds" />