Fix L9/L28/M11: shared thumb sizes, live defaults, clipboard IPC

L9: Extract four thumbnail box dimensions into src/renderer/src/thumbSizes.ts
    (THUMB_LG 120x68, THUMB_MD 108x64, THUMB_SM 72x44, THUMB_XS 60x34).
    DownloadBar, QueueItem, HistoryView, and LibraryView all import and use
    them instead of hard-coded strings -- one place to change the 16:9 sizing.

L28: DownloadBar now reflects Settings changes to defaultKind/defaultQuality
     in real time, but only while the URL field is empty (idle state). A URL
     typed or probed in progress is never discarded by a settings change.

M11: Clipboard reads now consistently use window.api.readClipboard (IPC) in
     the paste button, matching the clipboard-watcher hook. navigator.clipboard
     is no longer used for reads anywhere in the renderer.

typecheck + 242 tests + eslint green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 14:20:21 -04:00
parent 3df32d0505
commit 6a8452d6c3
6 changed files with 34 additions and 27 deletions
+3 -3
View File
@@ -248,7 +248,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
[`datetime.ts`](src/renderer/src/datetime.ts) and imported by their views; unit-tested in `test/datetime.test.ts`.*
- [ ] **M10 — `.url` shortcut parsing duplicated**`parseUrlFile` (DownloadBar) vs
`readUrlShortcut` (main/deeplink). Different `URL=` extractors for the same file format.
- [ ] **M11 — Inconsistent clipboard access.** Reads use `navigator.clipboard.readText` (paste
- [x] **M11 — Inconsistent clipboard access.** Reads use `navigator.clipboard.readText` (paste
button) *and* `window.api.readClipboard` (suggestion watcher); writes use
`navigator.clipboard.writeText` (copy report). Pick one strategy.
- [x] **M12 — Shared `errorText` style.** `tokens.colorPaletteRedForeground1` is applied inline
@@ -392,7 +392,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
ambiguous.
- [x] **L8 — Index/compound list keys.** TerminalView keys log lines by array index; Settings
Diagnostics keys by `id + occurredAt` while every other list keys by `id` alone.
- [ ] **L9 — Thumbnail box sizes not shared.** Four hand-tuned 16:9 boxes (120×68, 108×64, 72×44,
- [x] **L9 — Thumbnail box sizes not shared.** Four hand-tuned 16:9 boxes (120×68, 108×64, 72×44,
60×34) with no shared aspect/size constant.
- [ ] **L10 — Scattered magic numbers.** Timeouts/caps spread across modules (probe 60s, indexer
180s, probeMeta 30s, update-idle 60s; MAX_ENTRIES 500/200, MAX_TEMPLATES 100, MAX_ITEMS 20000).
@@ -434,7 +434,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
- [x] **L27 — DownloadBar Enter probes, not downloads.** Enter in the URL field triggers
`fetchFormats`; there's no keyboard path to actually start the download (LibraryView's Enter
runs its primary action). Inconsistent.
- [ ] **L28 — Default kind/quality applied once.** DownloadBar seeds from settings via a one-shot
- [x] **L28 — Default kind/quality applied once.** DownloadBar seeds from settings via a one-shot
ref; changing the default in Settings while on the Downloads tab isn't reflected until reload.
- [ ] **L29 — UI constant in the store.** `QUALITY_OPTIONS` lives in `store/downloads.ts` yet is a
presentational constant imported by views — couples UI to the store module.