Skip to content

Add mouse back/forward navigation to desktop app - #61

Open
Will-Hellinger wants to merge 1 commit into
fossisawesome:mainfrom
Will-Hellinger:mouse-back-forward-nav
Open

Add mouse back/forward navigation to desktop app#61
Will-Hellinger wants to merge 1 commit into
fossisawesome:mainfrom
Will-Hellinger:mouse-back-forward-nav

Conversation

@Will-Hellinger

Copy link
Copy Markdown

Adds support for the mouse's side back/forward buttons (plus a forward stack so you can navigate forward again after going back).

  • New Message::NavigateForward alongside the existing NavigateBack. They both now share the same per-view data-loading path that Navigate uses, so returning to a view via mouse button shows the same content a direct click would.
  • Raw mouse button events are picked up via iced::event::listen_with in subscription.rs, these are mapped to mouse::Button::Back/Forward.
  • If a modal overlay (add-to-playlist, create-playlist, account switcher, add-podcast) is open, the mouse buttons close it first instead of navigating underneath it (same priority order as the existing Escape-key handling).
  • nav_stack/forward_stack are cleared on logout, and pruned of stale entries when a local playlist is deleted or a podcast channel is unsubscribed, so back/forward can't land on a phantom page for something that no longer exists.

No behavior change for direct navigation, this only adds new ways to move through history you've already visited.

It's been tested locally successfully through:

  • cargo build --workspace
  • cargo test --workspace
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo run -p firmium
  • Manual testing

No crashes or errors were found locally.

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.

1 participant