Skip to content

fix: start playback from selected page and install key monitor in pin…#44

Merged
f merged 1 commit intof:masterfrom
lagilist:fix/start-from-selected-page
May 8, 2026
Merged

fix: start playback from selected page and install key monitor in pin…#44
f merged 1 commit intof:masterfrom
lagilist:fix/start-from-selected-page

Conversation

@lagilist
Copy link
Copy Markdown
Contributor

@lagilist lagilist commented May 6, 2026

…ned mode

Two bugs fixed:

  1. Clicking a page in the sidebar then pressing Play always started from page 1 instead of the selected page. Root cause: the sidebarSelection setter wrapped the currentPageIndex update in DispatchQueue.main.async, deferring it asynchronously. Since SwiftUI binding setters are already called on the main thread, this wrapper was unnecessary and caused run() to read the stale value (0) before the update applied. Fix: remove the async dispatch so currentPageIndex is updated synchronously on selection.

  2. showPinned() was the only display mode not calling installKeyMonitor(), so the ESC key did not work to dismiss the overlay in pinned mode.

…ned mode

Two bugs fixed:

1. Clicking a page in the sidebar then pressing Play always started from
   page 1 instead of the selected page. Root cause: the `sidebarSelection`
   setter wrapped the `currentPageIndex` update in `DispatchQueue.main.async`,
   deferring it asynchronously. Since SwiftUI binding setters are already
   called on the main thread, this wrapper was unnecessary and caused `run()`
   to read the stale value (0) before the update applied. Fix: remove the
   async dispatch so `currentPageIndex` is updated synchronously on selection.

2. `showPinned()` was the only display mode not calling `installKeyMonitor()`,
   so the ESC key did not work to dismiss the overlay in pinned mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@f f merged commit f90c3a0 into f:master May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants