Skip to content

feat: navigation stack with back/forward buttons, hotkeys, and mouse support - #79

Draft
adam4813 with Copilot wants to merge 3 commits into
mainfrom
copilot/create-navigation-stack
Draft

feat: navigation stack with back/forward buttons, hotkeys, and mouse support#79
adam4813 with Copilot wants to merge 3 commits into
mainfrom
copilot/create-navigation-stack

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Users navigating with mouse back/forward buttons (or keyboard) had no way to move through visited notes. This adds a global navigation history stack wired to the Ribbon, hotkeys, and mouse side-buttons.

State

  • WorkspaceState gains navHistory: NavEntry[] and navIndex: number
  • openFile pushes { path, title } to history; consecutive identical paths are collapsed; opening after going back truncates forward entries; history capped at 100

Actions

  • navBack / navForward move the pointer and activate/re-open the entry without re-pushing to history

UI — Ribbon

/ arrow buttons appear beside the search input (VS Code placement); disabled + dimmed when no history exists in that direction:

<button disabled={!canNavBack} onClick={onNavBack}></button>
<button disabled={!canNavForward} onClick={onNavForward}></button>

Input wiring

Trigger Action
Mouse button 3 navBack
Mouse button 4 navForward
Alt+Left navigate-back command
Alt+Right navigate-forward command

Both hotkeys are user-rebindable via the existing hotkey system.

Copilot AI linked an issue Aug 28, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits August 28, 2026 02:25
…support

- Add NavEntry type, navHistory and navIndex fields to WorkspaceState
- Add navBack / navForward actions; openFile pushes to history
- Register navigate-back (Alt+Left) and navigate-forward (Alt+Right) commands
- Listen for mouse buttons 3/4 (browser back/forward) to dispatch nav actions
- Add back/forward arrow buttons to Ribbon near the search input
- Add ribbon-nav CSS for the new buttons
- Add unit tests for all navigation stack scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI changed the title [WIP] Add navigation stack for browser-like functionality feat: navigation stack with back/forward buttons, hotkeys, and mouse support Aug 28, 2026
Copilot AI requested a review from adam4813 August 28, 2026 02:27
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.

Create a navigation "stack"

2 participants