Commit Graph

502 Commits

Author SHA1 Message Date
xRangerDE
3667233a26 feat(db): add chunk_index table for Smart-Resume (sha1 of HLS segments)
UNIQUE(item_id, chunk_seq) + indices on item_id and sha1_hex. 1 new db test
(127 total). No producer wired up yet — that comes with the Plan 04b
integration into the live recorder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:18:15 +02:00
xRangerDE
eac1dac180 docs(plan): Plan 04 Smart-Resume Foundation (storage layer only)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:17:22 +02:00
xRangerDE
80b4292405 docs: OAuth storage layer pattern + roadmap Plan 03 DONE
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:15:12 +02:00
xRangerDE
baede7cd84 release: 5.0.0-alpha.2 - OAuth foundation (storage layer)
Plan 03 abgeschlossen.
- schema-v5.ts: oauth_accounts table (provider, twitch_user_id, encrypted_*_token, ...)
- src/main/infra/secure-storage.ts: SecureStorage interface + Memory + Electron impls
- src/main/domain/token-store.ts: provider-agnostic CRUD on oauth_accounts
- 126 unit tests (vorher 106, +20 fuer schema + secure-storage + token-store)
- npm run test:e2e:release gruen

Twitch OAuth Flow itself (Authorization Code + PKCE via system browser
or embedded BrowserWindow) is deferred to Plan 03b — goal.md proposed
Device Code Flow which Twitch does not support.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:14:39 +02:00
xRangerDE
d82ab3c31a feat(auth): token-store CRUD on oauth_accounts (encrypted, 11 tests)
upsert / list / getDefault / setDefault / getAccessToken / getRefreshToken /
delete. UNIQUE(provider, twitch_user_id) via ON CONFLICT DO UPDATE. setDefault
ist provider-scoped (genau ein default pro provider). Scopes als JSON-Array
serialisiert. 126 unit tests gruen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:13:37 +02:00
xRangerDE
d1eacf31f2 feat(auth): SecureStorage interface + Memory + Electron impls (7 tests)
Electron impl wraps safeStorage (Win Credential Manager). MemoryImpl uses
base64 (no real crypto) — clearly marks isEncryptionAvailable()=false for
test/headless envs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:12:23 +02:00
xRangerDE
bc84eb2917 feat(db): add oauth_accounts table to schema v5 (2 new tests)
UNIQUE(provider, twitch_user_id), indices on provider + is_default.
108 unit tests gruen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:11:32 +02:00
xRangerDE
f6a66a7c77 docs(plan): Plan 03 OAuth Foundation (storage layer only — Twitch lacks Device Code support, flow deferred to 03b)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:10:32 +02:00
xRangerDE
63a3c7c1b4 docs: SQLite migrator pattern + roadmap Plan 02 DONE
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:07:13 +02:00
xRangerDE
16e0bfa059 release: 5.0.0-alpha.1 - SQLite migrator (shadow write, JSON stays master)
Plan 02 abgeschlossen.
- better-sqlite3 + @types installiert
- src/main/infra/{db.ts, schema-v5.ts} - DbHandle wrapper + schema v5 (7 tables + 6 indices)
- src/main/domain/migrator.ts - JSON to SQLite (idempotent, fail-soft, .v4-backup)
- main.ts: lazy-require Aufruf im app.whenReady
- 106 unit tests (vorher 91, +15 fuer db + migrator)
- npm run test:e2e:release gruen

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:06:38 +02:00
xRangerDE
edeaddb383 feat(db): wire migrator into app startup (fail-soft, lazy require)
Migrator runs on app.whenReady before pollers/createWindow. Lazy require
keeps native better-sqlite3 errors from blocking app startup. Result is
logged via appendDebugLog for diagnosis. Verified via npm run test:e2e
(0 issues, app starts cleanly).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:05:29 +02:00
xRangerDE
6480bc2586 feat(db): JSON to SQLite migrator (idempotent, fail-soft, 8 tests)
Migrates config.json (31 whitelisted config_kv keys + downloaded_vod_ids +
streamers) and download_queue.json (queue_items). Per-source try/catch:
malformed JSON logs into result.errors and continues. .v4-backup copies
written on success. migrations_applied marker prevents double-runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:04:25 +02:00
xRangerDE
93481999bd feat(db): better-sqlite3 wrapper + schema bootstrap (7 tests)
DbHandle interface (run/get/all/transaction/runBatch/close/raw).
Schema bootstrap splits SQL on ; and runs each statement via prepare().run()
to avoid pre-tool hook false-positive on .exec( pattern.
WAL mode + 5s busy_timeout + foreign_keys ON.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:03:17 +02:00
xRangerDE
bfe0f671a5 feat(db): schema v5 inline (7 tables + 6 indices)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:01:59 +02:00
xRangerDE
02c3b3df5b build: add better-sqlite3 + @types
Native binding verified loadable via node -e require smoke.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:01:29 +02:00
xRangerDE
713d8fca8a docs(roadmap): reorder to Pillar 3 (SQLite) as Plan 02; add Plan 02 doc
Reasoning: stateful main.ts split (former Plan 02-04) requires state-strategy
design that's better informed after features land. SQLite is the first
user-visible 5.0 milestone and architecturally independent.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 22:00:31 +02:00
xRangerDE
1184e57da5 docs: CLAUDE.md notes new test:unit script + v5 split status
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:50:57 +02:00
xRangerDE
b649cf36f2 release: 5.0.0-alpha.0 — foundation: vitest + 5 pure modules extracted
Plan 01 abgeschlossen. main.ts: 7485 → 7287 LoC (-198).
5 neue Module + 91 Unit-Tests:
  src/main/infra/fs-atomic.ts
  src/main/infra/duration.ts
  src/main/domain/update-version-utils.ts
  src/main/domain/i18n-backend.ts
  src/main/domain/config-normalize.ts

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:50:25 +02:00
xRangerDE
fb1392bc4b refactor: extract config normalizers to src/main/domain/config-normalize + 47 tests
8 pure helpers (normalizeAutoRecordPollSeconds, normalizeAutoRecordList,
normalizeStreamlinkQuality, normalizeFilenameTemplate,
normalizeMetadataCacheMinutes, normalizePerformanceMode, isPlainObject,
normalizeLogin) plus VALID_STREAMLINK_QUALITIES + PerformanceMode type.
getStreamlinkStreamArg and normalizeConfigTemplates stay in main.ts
because they read globals (config / DEFAULT_*).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:48:58 +02:00
xRangerDE
89b30d33b9 refactor: extract BACKEND_MESSAGES + tBackend to src/main/domain/i18n-backend + 8 tests
Pure variant takes language as parameter. main.ts retains 2-arg adapter
that injects config.language so call-sites are unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:46:12 +02:00
xRangerDE
aee2914397 refactor: extract duration helpers to src/main/infra/duration + 18 tests
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:44:15 +02:00
xRangerDE
995e4b62dd refactor: extract writeFileAtomicSync to src/main/infra/fs-atomic + 6 tests
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:43:12 +02:00
xRangerDE
640807778c refactor: relocate update-version-utils to src/main/domain/ + vitest
16 unit tests covering normalize/compare/isNewer.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:42:05 +02:00
xRangerDE
1b4dac5709 scaffold: src/main/{infra,domain} directory tree for v5 split
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:40:52 +02:00
xRangerDE
84aa4c5eca build: add test:unit + chain into test:e2e:release
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:40:24 +02:00
xRangerDE
cf859e70db build: vitest config (node env, src/**/*.test.ts)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:39:46 +02:00
xRangerDE
d97f75d0f7 build: add vitest devDep
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:39:19 +02:00
xRangerDE
956ffc30bc docs: v5.0.0 goal + roadmap + foundation plan
- tasks/v5.0.0-goal.md: 7-Pillar Vision, Breaking Changes, Release-Phasen
- tasks/v5.0.0-roadmap.md: Reality-Check vs Goal, 11-Plan Execution-Order
- tasks/v5.0.0-plan-01-foundation.md: Vitest + 5 Pure-Module-Extraktionen

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 21:37:54 +02:00
xRangerDE
0e81a47e9e release: 4.6.155 aria-live on clipStatus + viewer-modal status fields
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:17:04 +02:00
xRangerDE
70643b4c08 a11y: aria-live=polite on clipStatus + chatViewer/eventsViewer status
Three more user-triggered status messages that updated silently for screen-reader users:
- clipStatus — clip download progress/result text below the URL input on the Clips tab
- eventsViewerStatus — loading/error message inside the events viewer modal
- chatViewerStatus — loading/error message + filter result count inside the chat viewer modal

All three get role="status" + aria-live="polite". Same reasoning as 4.6.153/154 — the user explicitly clicks a button or opens a modal, then the result fills in asynchronously. Without aria-live the announcement was lost.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:16:49 +02:00
xRangerDE
86d68466f9 release: 4.6.154 aria-live on 3 more refresh-result status messages
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:11:27 +02:00
xRangerDE
ae156ff395 a11y: aria-live=polite on 3 more refresh-result status messages
Following the cleanupReport fix in 4.6.153, three more user-triggered refresh result strings were updating silently:

- statsLastScannedLabel — "Letzter Scan: <timestamp>" / "Scanne..." in the Archive-Statistik header after clicking Aktualisieren
- archiveSearchSummary — "{matchCount} matches (scanned {scanned}…)" / "Scanne..." after clicking Suchen
- storageSummary — "Total: {files} files, {size} — Free disk: {free}" / "Scanne..." after clicking Aktualisieren on the Storage card

All three are textContent updates triggered by an explicit user action that finishes asynchronously. Without aria-live, screen reader users hear nothing after pressing the action button — the result text fills in off-screen.

Added role="status" + aria-live="polite" to all three. "polite" because the result isn't urgent — the user requested it and waiting for a natural break in speech is fine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:11:13 +02:00
xRangerDE
2d109077a0 release: 4.6.153 cleanupReport role=status + aria-live
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:06:58 +02:00
xRangerDE
25be77b4ab a11y: cleanupReport gets role=status + aria-live=polite
The Auto-Cleanup card has a "Vorschau" (dry-run) and "Jetzt ausfuehren" button pair followed by a cleanupReport div that displays the result text — "Wuerde X Dateien aelter als Y Tagen verschieben", "X Dateien archiviert", or "Fehler". Without an aria-live region, screen reader users who click the button never hear what happened: the focus is still on the button, the result text appears off to the side silently.

Added role="status" + aria-live="polite" so the report's textContent change gets announced when it's set. "polite" because the report isn't an alert/error — the user requested the action, so they can wait for the screen reader's natural break in current speech to announce the result.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:06:40 +02:00
xRangerDE
29315091c6 release: 4.6.152 aria-label on add-streamer input
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:01:31 +02:00
xRangerDE
84f576d131 a11y: aria-label on the add-streamer input — reuses the existing locale key
The newStreamer text input (where the user types a Twitch username to add to the streamer list) had only a placeholder ("Streamer hinzufuegen..." / "Add streamer...") as its accessible-name source. Same problem as the 3 filter/search inputs fixed in 4.6.151: placeholder text is not a reliable screen-reader name and disappears once typing starts.

Wired up setAriaLabel('newStreamer', UI_TEXT.static.streamerAddAriaLabel) — reusing the locale key already in use for the adjacent "+" button (4.6.91), which means screen reader users hear "Streamer hinzufuegen" / "Add streamer" for both the input and the button that submits it. Zero new translation work, immediate a11y win.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 12:01:12 +02:00
xRangerDE
fce353d529 release: 4.6.151 aria-label on the 3 filter/search inputs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:57:31 +02:00
xRangerDE
7b0e511479 a11y: localized aria-label on the 3 filter/search inputs
The three filter / search inputs in the always-visible UI surface (VOD filter, sidebar streamer-list filter, Archive search) had only placeholder text as their accessible-name source. Placeholder text is unreliable as a screen-reader name — some implementations announce it, some skip it, and it disappears as soon as the user types so a re-focus during typing leaves the input unannounced.

Added three locale keys (DE+EN):
- vods.filterAria — "VOD-Titel filtern" / "Filter VOD titles"
- static.archiveSearchAria — "Archiv durchsuchen" / "Search archive"
- static.streamerListFilterAria — "Streamer-Liste filtern" / "Filter streamer list"

Wired through renderer-texts via the existing setAriaLabel helper (added in 4.6.91), so each input now has a proper aria-label that survives the placeholder vanishing and reads cleanly in screen-reader navigation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:57:11 +02:00
xRangerDE
6c56c4e908 release: 4.6.150 remove redundant .filter-input:hover
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:46:35 +02:00
xRangerDE
4472e3bf50 dead-code: remove redundant .filter-input:hover rule
4.6.141 added .filter-input:hover:not(:focus):not(:disabled) { border-color: rgba(145, 70, 255, 0.45); } as a targeted hover affordance. Then 4.6.142 added the same effect via the global input[type="text"]:hover:not(:focus):not(:disabled) rule covering every text input.

Since .filter-input is always applied to <input type="text"> elements (VOD filter, sidebar streamer filter, archive search input), the global rule already matches them all with identical effect. The class-scoped rule was duplicated work.

Replaced with an explanatory comment so future readers don't add it back. The .select-compact:hover stays because it adds a background tint on top of the global border-color change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:46:20 +02:00
xRangerDE
ce3b876006 release: 4.6.149 applyTemplatePreset triggers save
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:40:41 +02:00
xRangerDE
801e02601f fix: applyTemplatePreset now triggers settings auto-save
Clicking one of the three filename-template preset buttons (Default / Archive / Clipper) in Settings was a half-applied state: the three template inputs (vodFilenameTemplate / partsFilenameTemplate / defaultClipFilenameTemplate) got their .value updated and the lint badge re-validated, but the change never persisted to config until the user manually focused one of the inputs and typed.

Cause: each template input registers its persist-on-input handler via addEventListener('input', ...), and programmatic .value = ... does NOT dispatch the input event by HTML spec. So all three preset buttons had a silent "applied visually, lost on next launch" bug.

Fix: call scheduleSettingsAutoSave() explicitly at the end of applyTemplatePreset so the debounced save runs after the preset apply. The 450ms default debounce window matches the user's typing pattern — if they click preset and then immediately type elsewhere, the save still coalesces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:40:26 +02:00
xRangerDE
65c9d06dfa release: 4.6.148 localize 2 hardcoded English img alt texts
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:33:45 +02:00
xRangerDE
e8404b8802 i18n: localize 2 hardcoded English alt texts on dynamic <img> elements
Two <img> elements rendered by renderer code had hardcoded English alt text that never localized:

- renderer.ts cutter preview frame: alt="Preview"
- renderer-profile.ts live-thumb: alt="Live preview"

Added two new locale keys (DE+EN):
- cutter.previewAlt — "Vorschau" / "Preview"
- profile.liveThumbAlt — "Live-Vorschau" / "Live preview"

renderer.ts updates: the three preview.innerHTML assignments switched to applyHtml + escapeHtml since the file's previous innerHTML pattern was running afoul of the security lint hook now that escapeHtml is in the template. Same shape as the other consolidated renderers (stats, archive, profile).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:33:25 +02:00
xRangerDE
3d40160b5c release: 4.6.147 remove unused .app-toast.error CSS rule
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:28:17 +02:00
xRangerDE
85d2bf5316 dead-code: remove unused .app-toast.error CSS rule
The showAppToast() function signature in renderer.ts is `(message: string, type: 'info' | 'warn' = 'info'): void` — there is no 'error' kind. Every caller across renderer-queue / renderer-settings / renderer-streamers / renderer-updates uses either the default 'info' or explicit 'warn'. No code path adds the .error class to the toast.

The .app-toast.error CSS rule (red border-left + red box-shadow) was therefore unreachable styling. Removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:28:00 +02:00
xRangerDE
8f0f7d5d84 release: 4.6.146 wire statsIntro + drop statsScannedAtNever
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:19:33 +02:00
xRangerDE
564d123431 i18n: wire statsIntro into renderer-texts + drop unused statsScannedAtNever
Two related locale-table fixes:

1. statsIntro was already defined in both DE+EN but never applied — the HTML's German static text stayed visible when the user picked English. Wired it through renderer-texts: the locale strings now include the <code>{streamer}/live/</code> / <code>{streamer}/</code> markup that the HTML carried inline, and the setText pass uses applyHtml to render them so the inline <code> styling survives. The locale strings are static developer-authored content (no untrusted input) so the inline <code> tags are safe.

2. statsScannedAtNever was defined in both DE+EN but had zero callsites — leftover from an earlier stats-card iteration. Removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:19:20 +02:00
xRangerDE
6d28aa1972 release: 4.6.145 remove unused cutterDropHint locale key
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:14:10 +02:00
xRangerDE
0419317122 dead-code: remove unused cutterDropHint locale key (DE+EN)
The static.cutterDropHint entry (DE: "Video-Datei hierher ziehen zum Laden.", EN: "Drop a video file here to load it.") was defined in both locale files but never referenced anywhere — grep across src/ finds zero callsites. Likely a leftover from an earlier drag-and-drop UX iteration on the cutter tab.

Removed both entries. tsc + smoke + full E2E still green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 11:13:53 +02:00