Add MPV overlay queue controls

This commit is contained in:
2026-02-18 01:55:01 -08:00
parent 3803d4d47b
commit fd49e73762
21 changed files with 391 additions and 78 deletions

View File

@@ -5,7 +5,7 @@ status: Done
assignee:
- codex
created_date: '2026-02-11 15:45'
updated_date: '2026-02-11 16:36'
updated_date: '2026-02-18 09:29'
labels:
- bug
- macos
@@ -15,22 +15,19 @@ references:
- src/window-trackers/macos-tracker.ts
- scripts/get-mpv-window-macos.swift
priority: high
ordinal: 58000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Overlay windows on macOS are not properly aligned to the mpv window after switching from AppleScript window discovery to native Swift/CoreGraphics bounds retrieval.
Implement a robust native bounds strategy that prefers Accessibility window geometry (matching app-window coordinates used previously) and falls back to filtered CoreGraphics windows when Accessibility data is unavailable.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Overlay bounds track the active mpv window with correct position and size on macOS.
- [x] #2 Helper avoids selecting off-screen/non-primary mpv-related windows.
- [x] #3 Build succeeds with the updated macOS helper.
@@ -39,7 +36,6 @@ Implement a robust native bounds strategy that prefers Accessibility window geom
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Follow-up in progress after packaged app runtime showed fullscreen fallback behavior:
- Added packaged-app helper path resolution in tracker (`process.resourcesPath/scripts/get-mpv-window-macos`).

View File

@@ -1,61 +0,0 @@
---
id: TASK-13
title: Fix second-instance --start when texthooker-only instance is running
status: Done
assignee: []
created_date: '2026-02-11 23:47'
updated_date: '2026-02-18 04:11'
labels:
- bugfix
- cli
- overlay
dependencies: []
priority: high
ordinal: 51000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
When SubMiner is already running in texthooker-only mode, a subsequent `--start` command from a second instance is currently ignored. This can leave users without an initialized overlay runtime even though startup commands were issued. Adjust CLI command handling so `--start` on second-instance initializes overlay runtime when it is not yet initialized, while preserving current ignore behavior when overlay runtime is already active.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Second-instance `--start` initializes overlay runtime when current instance has deferred/not-initialized overlay runtime.
- [x] #2 Second-instance `--start` remains ignored (existing behavior) when overlay runtime is already initialized.
- [x] #3 CLI command service tests cover both behaviors and pass.
<!-- AC:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
Patched CLI second-instance `--start` handling in `src/core/services/cli-command-service.ts` to initialize overlay runtime when deferred.
Added regression test for deferred-runtime start path and updated initialized-runtime second-instance tests in `src/core/services/cli-command-service.test.ts`.
<!-- SECTION:NOTES:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Fixed overlay startup regression path where a second-instance `--start` could be ignored even when the primary instance was running in texthooker-only/deferred overlay mode.
Changes:
- Updated `handleCliCommandService` logic so `ignoreStart` applies only when source is second-instance, `--start` is present, and overlay runtime is already initialized.
- Added explicit overlay-runtime initialization path for second-instance `--start` when runtime is not initialized.
- Kept existing behavior for already-initialized runtime (still logs and ignores redundant `--start`).
- Added and updated tests in `cli-command-service.test.ts` to validate both deferred and initialized second-instance startup behaviors.
Validation:
- `pnpm run build` succeeded.
- `node dist/core/services/cli-command-service.test.js` passed (11/11).
<!-- SECTION:FINAL_SUMMARY:END -->

View File

@@ -1,21 +1,22 @@
---
id: TASK-39
title: Add hot-reload for non-destructive config changes
status: To Do
status: Done
assignee: []
created_date: '2026-02-14 02:04'
updated_date: '2026-02-18 09:29'
labels:
- config
- developer-experience
- quality-of-life
dependencies: []
priority: low
ordinal: 59000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Watch the config file for changes and apply non-destructive updates (colors, font sizes, subtitle modes, overlay opacity, keybindings) without requiring an app restart.
## Motivation
@@ -49,13 +50,11 @@ Currently all config is loaded at startup. Users tweaking visual settings (font
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Config file changes are detected automatically via file watcher.
- [ ] #2 Hot-reloadable fields are applied immediately without restart.
- [ ] #3 Restart-required fields trigger a user-visible notification.
- [ ] #4 File change events are debounced to handle editor save patterns.
- [ ] #5 Invalid config changes are rejected with an error notification, keeping the previous valid config.
- [ ] #6 Renderer receives updated styles/settings via IPC without full page reload.
- [x] #1 Config file changes are detected automatically via file watcher.
- [x] #2 Hot-reloadable fields are applied immediately without restart.
- [x] #3 Restart-required fields trigger a user-visible notification.
- [x] #4 File change events are debounced to handle editor save patterns.
- [x] #5 Invalid config changes are rejected with an error notification, keeping the previous valid config.
- [x] #6 Renderer receives updated styles/settings via IPC without full page reload.
<!-- AC:END -->

View File

@@ -0,0 +1,34 @@
---
id: TASK-65
title: Add overlay drag-drop playlist loading and clipboard append shortcut
status: Done
assignee: []
created_date: '2026-02-18 13:10'
updated_date: '2026-02-18 13:10'
labels: []
dependencies: []
---
## Description
Implement direct playlist control from the overlay:
- Drag/drop video files onto overlay:
- default drop: replace current playback with dropped set (first `replace`, remainder `append`)
- `Shift` + drop: append all dropped files
- `Ctrl/Cmd+A`: read clipboard text, if it resolves to a supported local video file path, append it to mpv playlist.
## Implementation Steps
- [x] Add TDD coverage for drop path parsing, command mode generation, and clipboard path parsing (`src/core/services/overlay-drop.test.ts`).
- [x] Implement drop/clipboard parser + mpv command-builder utility (`src/core/services/overlay-drop.ts`).
- [x] Wire renderer drag/drop handling and mpv command dispatch (`src/renderer/renderer.ts`).
- [x] Add IPC API for clipboard append flow (`src/types.ts`, `src/preload.ts`, `src/core/services/ipc.ts`, `src/main/dependencies.ts`).
- [x] Implement main-process clipboard validation + append behavior (`src/main.ts`).
- [x] Add fixed keyboard shortcut hook (`Ctrl/Cmd+A`) in renderer keyboard handler (`src/renderer/handlers/keyboard.ts`, `src/renderer/renderer.ts`).
- [x] Update docs for new interaction model (`docs/usage.md`, `docs/configuration.md`).
## Verification
- `bun run build`
- `node --test dist/core/services/overlay-drop.test.js dist/core/services/ipc.test.js`