diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md index a3ee979..f8b3d62 100644 --- a/CODE-AUDIT.md +++ b/CODE-AUDIT.md @@ -20,6 +20,19 @@ L11 (Queue header counts the live queue), L50 (no "saved" for 0 cookies), L156 + reconciliation (M25 M26 L80 L81), and new unit tests (L35 isValidMediaItem, L36 compareVersions). All verified: typecheck + 234 tests + eslint + prettier green. +**Session 2026-06-30 pass 2 (quality/format/UX polish):** H5 (history re-download now stores +formatId/formatHasAudio + strips compound quality labels; thumbnail also passed — L72), H6 +(TerminalView log capped at 2000 lines), M21 (skip --audio-quality for lossless flac/wav), +L166 (fmtEta hour rollover fixed in download.ts, store/downloads.ts, queueStats.ts — "2:00:00" +not "120:00"), L165 (formatSpeed precision aligned with fmtBytes), L55 (QueueItem suppresses +sizeLabel when already in probed-format quality label), L47 (probeMeta null sends empty meta +event to clear "Resolving…"), L68 (notifiedBackground resets on window show), L76 (dup warning +falls back to URL when title is placeholder), L91 (SettingsView unsafe tuple cast fixed), L98 +(embed-chapters hint added), L108 (window title set), L37 (formatters extracted to lib/formatters.ts; +fmtBytes/fmtEta/parseProgress unit-tested including NA paths), L38 (webm thumbnail exclusion +test), L39 (CROP_SQUARE_PPA structural test), L40 (looksLikeUrl/looksLikeSingleVideo extracted +to lib/urlHelpers.ts; test imports pure module directly). All verified: typecheck + 242 tests + eslint + prettier green. + **Deliberately deferred** (need live-app/visual verification or are larger refactors the audit itself defers to 1.x): the wire-or-cut features (M5/M6/UX1), the god-file/store refactors (C1, C2, H1), the SIMP* helpers + shared-UI-token work, the CC* consolidations, @@ -183,11 +196,11 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n with H2's shared formatter. - [ ] **H4 — Carry raw numbers across the progress boundary.** `DownloadProgress` ships formatted `speed`/`eta` strings; `queueStats.ts` re-parses them back to numbers. -- [ ] **H5 — History re-download silently changes quality.** `HistoryView.redownload` passes the +- [x] **H5 — History re-download silently changes quality.** `HistoryView.redownload` passes the stored `quality` (for format-picker downloads this is a *label* like "720p · mp4 · 184 MB") back as `quality` with no `formatId`; `buildArgs.videoFormat()` has no matching case and falls back to `bv*+ba/b` (Best). The queued item shows "720p…" while actually fetching Best. -- [ ] **H6 — TerminalView log grows unbounded.** `setLines((ls) => [...ls, …])` with no cap; a +- [x] **H6 — TerminalView log grows unbounded.** `setLines((ls) => [...ls, …])` with no cap; a verbose run (`-F`, `--verbose`) streams thousands of lines into React state. Every other log/list in the app is capped — cap this too (and/or virtualize). - [x] **H7 — `cookies.txt` written in plaintext with no restrictive perms.** [cookies.ts](src/main/cookies.ts) @@ -269,7 +282,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n - [ ] **M20 — ProgressBar / native `