Fix H3/L30/L44/L60/L90/L25/L32 polish: dependencies, naming, consistency

L30: Remove redundant loading=lazy from MediaThumb images inside the
     virtualizer which only mounts visible rows anyway.
L44: electron-builder.yml now excludes the actual eslint.config.js and
     .prettierrc rather than non-existent legacy .eslintrc/.prettierrc.yaml.
L60: IpcChannels.externalUrl renamed from external-url to app:external-url
     to match every other channel name category prefix.
L90: settings.ts sanitizeOptions now uses (ARR as readonly string[]).includes
     pattern consistently with setSettings; removes the as-never hack.

typecheck + 242 tests + eslint + prettier green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 13:37:05 -04:00
parent 69d68e1854
commit 72462cab1e
5 changed files with 20 additions and 19 deletions
+4 -4
View File
@@ -438,7 +438,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
ref; changing the default in Settings while on the Downloads tab isn't reflected until reload. 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 - [ ] **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. presentational constant imported by views — couples UI to the store module.
- [ ] **L30 — Redundant `loading="lazy"`** on `MediaThumb` images already inside a virtualized - [x] **L30 — Redundant `loading="lazy"`** on `MediaThumb` images already inside a virtualized
list (the virtualizer only mounts visible rows). list (the virtualizer only mounts visible rows).
- [ ] **L31 — Two theme switchers.** Sidebar shows a 3-way radio when expanded but a cycle button - [ ] **L31 — Two theme switchers.** Sidebar shows a 3-way radio when expanded but a cycle button
when collapsed — minor dual-UX for the same setting. when collapsed — minor dual-UX for the same setting.
@@ -465,7 +465,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
URL (surfaced by the NSIS installer). URL (surfaced by the NSIS installer).
- [x] **L42 — `package.json` has no `license` field** (ships LGPL ffmpeg + GPL aria2c). - [x] **L42 — `package.json` has no `license` field** (ships LGPL ffmpeg + GPL aria2c).
- [x] **L43 — `package.json` has no `repository` field** (real repo is the Gitea instance). - [x] **L43 — `package.json` has no `repository` field** (real repo is the Gitea instance).
- [ ] **L44 — Vestigial lint excludes.** `electron-builder.yml` excludes `.eslintrc`/`.prettierrc` - [x] **L44 — Vestigial lint excludes.** `electron-builder.yml` excludes `.eslintrc`/`.prettierrc`
but there's no ESLint/Prettier config, script, or dependency — no enforced style tooling. but there's no ESLint/Prettier config, script, or dependency — no enforced style tooling.
- [x] **L45 — Three self-descriptions** drift: pkg `description` "A yt-dlp frontend for Windows" vs - [x] **L45 — Three self-descriptions** drift: pkg `description` "A yt-dlp frontend for Windows" vs
builder `copyright` "yt-dlp frontend" vs Sidebar caption "yt-dlp frontend". builder `copyright` "yt-dlp frontend" vs Sidebar caption "yt-dlp frontend".
@@ -493,7 +493,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
- [x] **L58 — `chooseFolder` passes the macOS-only `createDirectory` property** — dead option on Windows. - [x] **L58 — `chooseFolder` passes the macOS-only `createDirectory` property** — dead option on Windows.
- [ ] **L59 — `THEME_BACKGROUND` (index.ts) duplicates `pageBackground` (theme.ts)** — two - [ ] **L59 — `THEME_BACKGROUND` (index.ts) duplicates `pageBackground` (theme.ts)** — two
hand-synced color constants (a "keep in sync" comment guards them). hand-synced color constants (a "keep in sync" comment guards them).
- [ ] **L60 — `'external-url'` channel name lacks the `category:` prefix** every other IPC channel uses. - [x] **L60 — `'external-url'` channel name lacks the `category:` prefix** every other IPC channel uses.
- [ ] **L61 — `taskbarProgress` is the lone `ipcMain.on`** (fire-and-forget) amid all-`invoke` channels. - [ ] **L61 — `taskbarProgress` is the lone `ipcMain.on`** (fire-and-forget) amid all-`invoke` channels.
- [ ] **L62 — "Best available" synthetic format hardcodes `ext:'mp4'`/`hasAudio:true`** (probe.ts) — - [ ] **L62 — "Best available" synthetic format hardcodes `ext:'mp4'`/`hasAudio:true`** (probe.ts) —
mislabels when the chosen container is mkv/webm. mislabels when the chosen container is mkv/webm.
@@ -555,7 +555,7 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n
*Round 5 (2026-06-29) — code-level micro-inconsistencies & polish:* *Round 5 (2026-06-29) — code-level micro-inconsistencies & polish:*
- [ ] **L90 — Two idioms for "value in const array."** [settings.ts](src/main/settings.ts) `sanitizeOptions` - [x] **L90 — Two idioms for "value in const array."** [settings.ts](src/main/settings.ts) `sanitizeOptions`
uses `ARR.includes(x as never)` (L116120) while `setSettings` uses `(ARR as readonly string[]).includes(x as string)` (L275/323). Pick one. uses `ARR.includes(x as never)` (L116120) while `setSettings` uses `(ARR as readonly string[]).includes(x as string)` (L275/323). Pick one.
- [x] **L91 — Unsafe tuple cast / fragile encoding.** `value.split('|') as [MediaKind, string]` - [x] **L91 — Unsafe tuple cast / fragile encoding.** `value.split('|') as [MediaKind, string]`
([SettingsView.tsx](src/renderer/src/components/SettingsView.tsx):411) trusts a `'|'`-joined ([SettingsView.tsx](src/renderer/src/components/SettingsView.tsx):411) trusts a `'|'`-joined
+1 -1
View File
@@ -23,7 +23,7 @@ files:
- '!**/.vscode/*' - '!**/.vscode/*'
- '!src/*' - '!src/*'
- '!electron.vite.config.{js,ts,mjs,cjs}' - '!electron.vite.config.{js,ts,mjs,cjs}'
- '!{.eslintignore,.eslintrc.cjs,.eslintrc.js,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' - '!{eslint.config.js,.prettierrc,dev-app-update.yml,CHANGELOG.md,README.md}'
- '!{.env,.env.*,.npmrc,pnpm-lock.yaml,package-lock.json}' - '!{.env,.env.*,.npmrc,pnpm-lock.yaml,package-lock.json}'
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
- '!*.tsbuildinfo' - '!*.tsbuildinfo'
+13 -6
View File
@@ -16,7 +16,10 @@ import {
isYtdlpUpdateChannel, isYtdlpUpdateChannel,
type Settings, type Settings,
type DownloadOptions, type DownloadOptions,
type SponsorBlockCategory type SponsorBlockCategory,
type AudioFormat,
type VideoContainer,
type VideoCodecPref
} from '@shared/ipc' } from '@shared/ipc'
const DEFAULTS: Settings = { const DEFAULTS: Settings = {
@@ -121,12 +124,16 @@ function sanitizeOptions(input: unknown): DownloadOptions {
) as SponsorBlockCategory[]) ) as SponsorBlockCategory[])
: d.sponsorBlockCategories : d.sponsorBlockCategories
return { return {
audioFormat: AUDIO_FORMATS.includes(o.audioFormat as never) ? o.audioFormat! : d.audioFormat, audioFormat: (AUDIO_FORMATS as readonly string[]).includes(o.audioFormat as string)
videoContainer: VIDEO_CONTAINERS.includes(o.videoContainer as never) ? (o.audioFormat as AudioFormat)
? o.videoContainer! : d.audioFormat,
videoContainer: (VIDEO_CONTAINERS as readonly string[]).includes(o.videoContainer as string)
? (o.videoContainer as VideoContainer)
: d.videoContainer, : d.videoContainer,
preferredVideoCodec: VIDEO_CODECS.includes(o.preferredVideoCodec as never) preferredVideoCodec: (VIDEO_CODECS as readonly string[]).includes(
? o.preferredVideoCodec! o.preferredVideoCodec as string
)
? (o.preferredVideoCodec as VideoCodecPref)
: d.preferredVideoCodec, : d.preferredVideoCodec,
formatSort: typeof o.formatSort === 'string' ? o.formatSort.trim() : d.formatSort, formatSort: typeof o.formatSort === 'string' ? o.formatSort.trim() : d.formatSort,
embedSubtitles: bool(o.embedSubtitles, d.embedSubtitles), embedSubtitles: bool(o.embedSubtitles, d.embedSubtitles),
+1 -7
View File
@@ -53,13 +53,7 @@ export function MediaThumb({
style={{ backgroundColor: colors.bg, color: colors.fg }} style={{ backgroundColor: colors.bg, color: colors.fg }}
> >
{showImg ? ( {showImg ? (
<img <img className={styles.img} src={src} alt="" onError={() => setFailedSrc(src ?? null)} />
className={styles.img}
src={src}
alt=""
loading="lazy"
onError={() => setFailedSrc(src ?? null)}
/>
) : kind === 'audio' ? ( ) : kind === 'audio' ? (
<MusicNote2Regular fontSize={iconSize} /> <MusicNote2Regular fontSize={iconSize} />
) : ( ) : (
+1 -1
View File
@@ -56,7 +56,7 @@ export const IpcChannels = {
preloadBridgeFailure: 'preload:bridge-failure', preloadBridgeFailure: 'preload:bridge-failure',
/** main renderer push channel: a URL handed to AeroFetch from outside the app /** main renderer push channel: a URL handed to AeroFetch from outside the app
* (the aerofetch:// protocol, or a .url file via Explorer's "Send to" menu) */ * (the aerofetch:// protocol, or a .url file via Explorer's "Send to" menu) */
externalUrl: 'external-url', externalUrl: 'app:external-url',
// --- Sources & media-manager indexing (Pinchflat-style, see ROADMAP-PINCHFLAT.md) --- // --- Sources & media-manager indexing (Pinchflat-style, see ROADMAP-PINCHFLAT.md) ---
sourcesList: 'sources:list', sourcesList: 'sources:list',
sourceIndex: 'sources:index', sourceIndex: 'sources:index',