quality pass: safe timestamps, cancel support, dedup, frontend polish

- replace unsafe GetLocalTime with safe SystemTime epoch
- lock() logs warning on mutex poison recovery
- extract try_start_audio/start_click_recorder helpers to dedup capture code
- cancel_export now actually kills ffmpeg via polling loop + cancel flag
- extract visible_window_bounds helper for DWM rect lookups
- clear_temp_segments cleans thumbs dir and preview files
- gif_params takes focused GifBudgetInput instead of full TranscodeRequest
- consistent error messages with full context chain
- reduce overlay clickthrough poll from 30ms to 80ms
- throttle trim preview to 10Hz
- bound thumbnail cache at 5 entries
- timer ticks until stopCapture resolves
- crop fields validate against clip dimensions
- settings shows unsaved indicator dot
- edit grid uses minmax for fluid responsive layout
- animations respect prefers-reduced-motion
- pauseRec only clears timer after successful pause
- refreshPreview logs errors instead of swallowing
- remove dead _deps string from preview effect
This commit is contained in:
2026-05-29 23:38:18 +03:00
parent e9005415c4
commit d57e554ece
5 changed files with 236 additions and 179 deletions
+15 -1
View File
@@ -11,6 +11,9 @@
let hotkeyWarnings: string[] = $state([])
let showAdvanced: boolean = $state(false)
let activeTab: string = $state("capture")
let initialCfg: string = $state("")
let dirty = $derived(cfg ? JSON.stringify(cfg) !== initialCfg : false)
const TABS = [
{ id: "capture", label: "Capture" },
@@ -20,7 +23,7 @@
{ id: "system", label: "System" },
]
onMount(async () => { cfg = await api.getConfig() })
onMount(async () => { cfg = await api.getConfig(); initialCfg = JSON.stringify(cfg) })
async function save() {
if (!cfg) return
@@ -44,6 +47,7 @@
if (failed.length > 0) {
hotkeyWarnings = [`${failed.join(", ")} - hotkey may be in use by another app`]
} else {
initialCfg = JSON.stringify(cfg)
onClose()
}
} finally { saving = false }
@@ -231,6 +235,7 @@
<button class="btn-primary" onclick={save} disabled={saving}>
{saving ? "Saving" : "Save changes"}
</button>
{#if dirty}<span class="unsaved-dot" title="unsaved changes"></span>{/if}
<button class="btn-ghost" onclick={onClose}>Cancel</button>
</div>
{/if}
@@ -481,4 +486,13 @@
}
.btn-warn:hover:not(:disabled) { background: var(--stop-hover); }
.btn-warn:disabled { opacity: 0.4; cursor: not-allowed; }
.unsaved-dot {
width: 6px; height: 6px;
border-radius: 50%;
background: var(--warn);
display: inline-block;
margin-left: 8px;
vertical-align: middle;
}
</style>