quality pass 3: preview cleanup, gif filter hoist, config logging

- startOver clears previewPath/trimPreviewPath and resets gif settings
- startOver resets format/fps/dither to config defaults
- Main onMount wraps getConfig in try/catch
- unify DownloadProgress/UpdateDownloadProgress into single type
- default_output_path borrows config instead of cloning
- encode_gif_pass filter prefixes computed once outside retry loop
- config backup path included in warning log
- capture ffmpeg stderr logged at debug level instead of error
- is_newer comment notes pre-release version handling
- Picker hover debounced to ~33ms
- Picker emits picker-cancel on unmount
This commit is contained in:
2026-05-30 00:13:58 +03:00
parent 2cd836b09e
commit f3ff35a48b
6 changed files with 29 additions and 16 deletions
+17 -5
View File
@@ -117,11 +117,15 @@
unlistenOverlayClosed = await listen("overlay-closed", () => {
useFrame = false
})
config = await api.getConfig()
format = config.export.default_format
fps = config.capture.default_fps
keepAudio = config.capture.capture_audio
gifDither = config.export.gif_dither
try {
config = await api.getConfig()
format = config.export.default_format
fps = config.capture.default_fps
keepAudio = config.capture.capture_audio
gifDither = config.export.gif_dither
} catch (e) {
console.warn("failed to load config:", e)
}
unlistenHotkey = await api.onHotkey((kind) => {
if (kind === "start" && phase === "idle") void startRec()
@@ -277,8 +281,16 @@
clip = null; exportResult = null; errMsg = null; encodeProgress = null
thumbnails = []; deletedFrames = new Set()
thumbCache = new Map()
previewPath = null; trimPreviewPath = null
if (previewTimer !== null) { clearTimeout(previewTimer); previewTimer = null }
elapsed = 0; phase = "idle"
if (config) {
format = config.export.default_format
fps = config.capture.default_fps
gifDither = config.export.gif_dither
gifBudgetMode = "balanced"
gifColors = 256
}
}
async function cancelExport() {
+6 -1
View File
@@ -22,12 +22,17 @@
void (async () => {
await refresh()
win.onMoved(refresh).then(fn => { if (mounted) unlisten.push(fn) })
listen<Rect>("picker-hover", (e) => { hover = e.payload }).then(fn => { if (mounted) unlisten.push(fn) })
let hoverDebounce = 0
listen<Rect>("picker-hover", (e) => {
clearTimeout(hoverDebounce)
hoverDebounce = window.setTimeout(() => { hover = e.payload }, 30)
}).then(fn => { if (mounted) unlisten.push(fn) })
})()
return () => {
mounted = false
unlisten.forEach(fn => fn())
emit("picker-cancel", {}).catch(() => {})
}
})