Files
SubMiner/backlog/tasks/task-21 - Persist-and-restore-MPV-secondary-subtitle-visibility-across-app-lifecycle.md
2026-02-17 22:54:09 -08:00

2.2 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority, ordinal
id title status assignee created_date updated_date labels dependencies priority ordinal
TASK-21 Persist and restore MPV secondary subtitle visibility across app lifecycle Done
2026-02-13 07:59 2026-02-18 04:11
high 46000

Description

When SubMiner connects to MPV, capture the current MPV secondary-sub-visibility value and force it off. Keep it off during SubMiner runtime regardless of overlay visibility toggles. On app shutdown (and MPV shutdown event when possible), restore MPV secondary-sub-visibility to the captured pre-SubMiner value.

Acceptance Criteria

  • #1 Capture MPV secondary-sub-visibility once per MPV connection before overriding it.
  • #2 Set MPV secondary-sub-visibility to no after capture regardless of bind_visible_overlay_to_mpv_sub_visibility.
  • #3 Do not mutate/restore secondary MPV visibility as a side effect of visible overlay toggles.
  • #4 Restore captured secondary MPV visibility on app shutdown while MPV is connected.
  • #5 Attempt restore on MPV shutdown event before disconnect and clear captured state afterward.

Final Summary

Implemented MPV secondary subtitle visibility lifecycle management:

  • Moved secondary-sub visibility capture/disable to MPV connection initialization (getInitialState requests secondary-sub-visibility, then request handler stores prior value and forces secondary-sub-visibility=no).
  • Removed secondary-sub visibility side effects from visible overlay visibility service so overlay toggles no longer capture/restore secondary MPV state.
  • Added restorePreviousSecondarySubVisibility() to MpvIpcClient, invoked on MPV shutdown event and from app onWillQuitCleanup (best effort while connected).
  • Wired new dependency getter/setter in main runtime bootstrap for tracked previous secondary visibility state.
  • Added unit coverage in mpv-service.test.ts for capture/disable and restore/clear behavior.
  • Verified with pnpm run build and node --test dist/core/services/mpv-service.test.js.