From e6b4f343e028828bd02012c436beb4527faa31e8 Mon Sep 17 00:00:00 2001 From: debont80 Date: Wed, 1 Jul 2026 12:06:06 -0400 Subject: [PATCH] =?UTF-8?q?feat(config+ux):=20batch=20#5=20=E2=80=94=20sou?= =?UTF-8?q?rce=20maps,=20integration=20script,=20copy,=20redownload=20opti?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean config/copy items (Phase 7): - L170: build.sourcemap 'hidden' on main/preload/renderer — emit .map for offline crash symbolication (of the CC8 logger's raw stacks) without exposing them. - L34: add `test:integration` npm script (AEROFETCH_REAL_DOWNLOAD=1) for the opt-in real-download suite; stays out of `npm test` (needs network + live yt-dlp). - L87: HistoryEntry carries the original `options`; redownload replays them so a re-download reproduces the same post-processing instead of the current defaults. - L96: folder "Browse" buttons -> "Browse…" (they open the OS picker). - L97: PO-token placeholder "(none)" -> "Optional -- paste a token" (consistent). - Ticked already-resolved: L99 (M28 aria-label), L113 (UX2 tooltip=aria-label), L95 (usage follows verb/modifier rule), L172 (skipLibCheck accepted). typecheck + 268 tests + eslint + prettier green (touched files LF/clean). Co-Authored-By: Claude Opus 4.8 --- CODE-AUDIT.md | 54 +++++++++++++------ electron.vite.config.ts | 10 +++- package.json | 3 +- src/renderer/src/components/HistoryView.tsx | 3 ++ .../src/components/settings/DownloadsCard.tsx | 4 +- .../src/components/settings/NetworkCard.tsx | 2 +- src/renderer/src/store/downloads.ts | 3 ++ src/shared/ipc.ts | 4 ++ 8 files changed, 61 insertions(+), 22 deletions(-) diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md index c48662b..553d866 100644 --- a/CODE-AUDIT.md +++ b/CODE-AUDIT.md @@ -577,9 +577,12 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n *Round 3 (2026-06-29) — tests, build metadata, error copy, edge cases:* -- [ ] **L34 — Integration test off by default.** `real-download.integration.test.ts` is +- [x] **L34 — Integration test off by default.** `real-download.integration.test.ts` is `describe.skipIf(!RUN)`; `npm test` never exercises a real download, so there's no automated - regression for the actual yt-dlp argv path (only the pure builder). + regression for the actual yt-dlp argv path (only the pure builder). *Fixed: a `test:integration` npm + script sets `AEROFETCH_REAL_DOWNLOAD=1` and runs the suite, making the opt-in real-download regression + explicit + discoverable. It stays out of the default `npm test` on purpose — it needs network + a live + yt-dlp, so it can't run in an unattended/CI pass.* - [x] **L35 — `isValidMediaItem` has no test** — the one persisted-JSON validator of six with no spec. - [x] **L36 — `compareVersions` differing-length components untested** (e.g. `1.2` vs `1.2.0`). - [x] **L37 — `download.ts` formatters untested** (`parseProgress`/`fmtBytes`/`fmtEta`, incl. the `NA` paths). @@ -684,8 +687,12 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n (not gitignored). - [x] **L86 — History select-all + filter change deletes hidden rows.** `selected` persists across a filter change, so "Delete selected" can remove entries no longer visible (surprising). -- [ ] **L87 — History re-download ignores original options.** `redownload` re-queues url/kind/quality - only; the post-processing `DownloadOptions` used originally are lost (current defaults apply). +- [x] **L87 — History re-download ignores original options.** `redownload` re-queues url/kind/quality + only; the post-processing `DownloadOptions` used originally are lost (current defaults apply). *Fixed: + `HistoryEntry` now carries the original `options` (recorded on completion in `recordCompletion`), and + `redownload` replays them via `AddOptions.options` — so a re-download reproduces the same subtitles / + SponsorBlock / container / codec instead of the current global defaults. Entries recorded before this + (no stored options) fall back to the defaults as before.* - [x] **L88 — `applyEvent('progress')` can promote a `queued` item to `downloading`** outside `pump()` — a latent concurrency edge if a progress event ever arrives before/without the launch transition. - [x] **L89 — Inconsistent release artifacts.** Only `0.4.1` carries `.sha256` files (hand-made) and @@ -712,14 +719,22 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n items-ref memo `queueSummaryOf` in [queueStats.ts](src/renderer/src/store/queueStats.ts) — the store hands out a new items array per change, so both App's taskbar subscription and DownloadsView's render summarize it once per change (the second caller hits the cache) instead of twice (also closes PERF4).* -- [ ] **L95 — "Sign in" hyphenation varies** in the Cookies card ("Sign in…", "Site to sign in to", "Sign-in window", "Signing in…"). -- [ ] **L96 — Ellipsis-on-dialog-buttons inconsistent.** "Export backup…/Import backup…/Sign in…" use +- [x] **L95 — "Sign in" hyphenation varies** in the Cookies card ("Sign in…", "Site to sign in to", "Sign-in window", "Signing in…"). + *Reviewed: the usages already follow standard English — the verb is two words ("Sign in…", "Signing in…", + "sign in to") and only the modifier is hyphenated ("Sign-in window"). Consistent by that rule; no change needed.* +- [x] **L96 — Ellipsis-on-dialog-buttons inconsistent.** "Export backup…/Import backup…/Sign in…" use `…` (opens a dialog), but "Browse" / "Check for updates" / "Update now" don't. Adopt the `…` = opens-a-dialog convention. -- [ ] **L97 — Advanced-field placeholders inconsistent.** Adjacent fields use an example (`web_safari`), - a literal `(none)`, and `Optional — Gitea access token`. Pick one placeholder style. + *Fixed: the folder "Browse" buttons (they open the OS picker) are now "Browse…". "Check for updates" / + "Update now" open no dialog (inline result / background download), so they correctly keep no ellipsis.* +- [x] **L97 — Advanced-field placeholders inconsistent.** Adjacent fields use an example (`web_safari`), + a literal `(none)`, and `Optional — Gitea access token`. Pick one placeholder style. *Fixed: standardized + on "an example value where the field has a representative one (`web_safari`, `2M`, `socks5://…`), + `Optional -- ` for opaque optional fields" — the PO-token's uninformative `(none)` is now + `Optional -- paste a token`, matching the update-token field.* - [x] **L98 — "Embed chapters" has no hint** while every sibling toggle in DownloadOptionsForm does. -- [ ] **L99 — URL input has an `id` but no label.** `input={{ id: 'aerofetch-url' }}` with no - `