mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-26 04:19:27 -07:00
3.5 KiB
3.5 KiB
id, title, status, assignee, created_date, updated_date, labels, dependencies, priority
| id | title | status | assignee | created_date | updated_date | labels | dependencies | priority | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| TASK-295 | Add primary subtitle visibility keybinding | Done |
|
2026-04-25 23:09 | 2026-04-25 23:45 |
|
medium |
Description
Add a v keybinding that overrides mpv's default v subtitle visibility toggle and instead toggles SubMiner's primary subtitle bar visibility on and off. Secondary subtitle hover behavior is out of scope.
Acceptance Criteria
- #1 Pressing
vtoggles the primary subtitle bar from visible to hidden. - #2 Pressing
vagain restores the primary subtitle bar visibility. - #3 The keybinding does not add or change secondary subtitle hover behavior.
- #4 Relevant automated coverage verifies the toggle behavior.
- #5 Pressing
vin the mpv/plugin keybinding path also toggles the primary subtitle bar visibility instead of mpv native subtitle visibility.
Implementation Plan
- Inspect existing renderer keybinding and subtitle bar visibility code, including current local edits in touched files.
- Add a focused failing test for
vtoggling primary subtitle bar visibility without changing secondary hover behavior. - Implement the minimal renderer/keybinding change.
- Run targeted tests and update acceptance criteria/final notes.
Implementation Notes
Implemented renderer-local KeyV handling before session/mpv binding dispatch so mpv sub-visibility is not touched. Visibility state is stored in renderer state and applied via primary-sub-hidden class on the primary subtitle container.
Scope updated after user clarified the toggle must work when focus is in mpv as well as in the overlay renderer. Added a forced mpv plugin binding for v that runs --toggle-primary-subtitle-bar, then broadcasts a renderer IPC toggle event and reuses the same primary subtitle bar toggle path.
Final Summary
Summary:
- Added a renderer-local
vkey handler that toggles primary subtitle bar visibility by adding/removingprimary-sub-hiddenon the primary subtitle container. - Added renderer state for the toggle so repeated presses restore the bar without issuing mpv
sub-visibilitycommands. - Added a forced mpv plugin
vbinding that invokes--toggle-primary-subtitle-barand broadcasts the same renderer toggle event. - Added CSS for the hidden primary subtitle bar state and regression coverage for both overlay and mpv/plugin entry points.
Tests:
bun test src/renderer/handlers/keyboard.test.ts --test-name-pattern "primary subtitle visibility key"bun test src/cli/args.test.ts --test-name-pattern "session action"bun test src/core/services/cli-command.test.ts --test-name-pattern "visibility and utility"bun test src/cli/args.test.ts src/cli/help.test.ts src/core/services/cli-command.test.ts src/main/runtime/cli-command-context.test.ts src/main/runtime/cli-command-context-deps.test.ts src/main/runtime/cli-command-context-main-deps.test.ts src/main/runtime/cli-command-context-factory.test.ts src/main/runtime/composers/cli-startup-composer.test.ts src/main/runtime/first-run-setup-service.test.tslua scripts/test-plugin-start-gate.lua && lua scripts/test-plugin-lua-compat.luabun run typecheckbun run test:fast