feat: Phase N power-user surface (terminal, palette, per-item, sort, url-templates)

- Built-in yt-dlp terminal: src/main/terminal.ts streams raw yt-dlp runs
  (binary fixed, gated on customCommandEnabled), new TerminalView + sidebar tab
- Command palette (Ctrl/Cmd+K), portal-free CommandPalette.tsx wired in App
- Per-playlist-item editing: per-row video/audio toggle + All video/All audio
  batch; addPlaylist enqueues via addMany with per-item kind
- Weighted format sorting: DownloadOptions.formatSort -> raw -S (overrides codec)
- URL-regex template auto-matching: CommandTemplate.urlPattern + selectExtraArgs
  matchesUrl, threaded through resolveExtraArgs; field in TemplateManager

typecheck + test (192) + electron-vite build all clean. Roadmap: Phase N COMPLETE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-26 11:10:22 -04:00
parent 9ac11ceb6c
commit da37690b42
18 changed files with 820 additions and 58 deletions
+23 -21
View File
@@ -342,29 +342,31 @@ Today `src/renderer/src/store/downloads.ts` has cancel + retry only.
for *sources*). **Limitation: the queue isn't persisted, so a schedule only fires while
AeroFetch is running** — noted in the UI hint and the code.*
## Phase N — Power-user surface
## Phase N — Power-user surface ✅ COMPLETE
YTDLnis leans hard into this; AeroFetch has the building blocks (command preview, templates,
per-item `options`) but not the surfaces.
YTDLnis leans hard into this; AeroFetch had the building blocks (command preview, templates,
per-item `options`) but not the surfaces. typecheck + test + `npm run build` clean.
- [ ] **Built-in terminal mode.** An interactive raw-yt-dlp console with live stdout/stderr —
YTDLnis's "terminal." AeroFetch already has command *preview* (`previewCommand` +
`formatCommandLine` in `src/main/download.ts`) and a streaming spawn path; a terminal is
"spawn arbitrary argv → stream to a log pane → input box." New view + one IPC channel.
- [ ] **Per-playlist-item editing.** Edit each playlist entry separately — different
format/type per item, multiple audio formats, batch-update type in one click (YTDLnis).
Extend the playlist selection panel in `src/renderer/src/components/DownloadBar.tsx`; the
queue already carries per-item `DownloadItem.options`, so the model supports it.
- [ ] **Weighted format sorting ("format aspect importance").** Rank codec / container /
quality and auto-pick by weighted priority. Extends today's single codec preference
(`-S res,fps,vcodec:…`) into a fuller `-S` builder.
- [ ] **URL-regex template auto-matching.** A `CommandTemplate` gains an optional URL pattern;
`buildCommand` auto-applies the matching template (e.g. always use template X for
`soundcloud.com`). Small extension to the existing `defaultTemplateId` logic in
`src/main/templates.ts`.
- [ ] **Command palette + keyboard shortcuts.** A Ctrl+K palette and a few global shortcuts
(paste-and-download, focus URL, switch tabs). Today keyboard handling is just Enter in a
couple of inputs.
- [x] **Built-in terminal mode.** *Done: `src/main/terminal.ts` runs the bundled yt-dlp with
raw user args (binary fixed; gated on `customCommandEnabled`, enforced in main), streaming
stdout/stderr line-by-line over a new `terminal:output` channel (`terminal:run`/`cancel`
IPC + preload). New `TerminalView.tsx` (args box, Run/Stop/Clear, live log, Ctrl+Enter)
and a Terminal sidebar tab.*
- [x] **Per-playlist-item editing.** *Done: the playlist panel in `DownloadBar.tsx` gained a
per-row video/audio toggle + **All video** / **All audio** batch buttons; `addPlaylist`
enqueues via `addMany` with each entry's own kind (quality falls back to that kind's
default). Per-item exact-format selection (needs probing each entry) left as a further
extension.*
- [x] **Weighted format sorting ("format aspect importance").** *Done: a `formatSort` field on
`DownloadOptions` (raw yt-dlp `-S` string); when set it emits `-S <value>`, overriding the
codec tiebreaker (`buildArgs.ts`); an "advanced" input in `DownloadOptionsForm`. Unit-tested.*
- [x] **URL-regex template auto-matching.** *Done: `CommandTemplate.urlPattern` (regex);
`selectExtraArgs` auto-applies a matching template ahead of the global default
(`matchesUrl`, bad patterns never match), URL threaded via `resolveExtraArgs`. urlPattern
field in `TemplateManager` + persisted in `templates.ts`. Unit-tested.*
- [x] **Command palette + keyboard shortcuts.** *Done: a portal-free `CommandPalette.tsx`
(filter, ↑/↓, Enter, Esc) opened with Ctrl/Cmd+K from `App.tsx`; actions = navigate tabs,
new download (focuses the `aerofetch-url` input), toggle theme.*
## Phase O — Windows-native integration & discoverability