Repository navigation
feat(nav): add in-app navigate back/forward - #211
Merged
Merged
Conversation
Browser-style back/forward over visited chat views on omp-web's own stack (not the browser history, which belongs to the mobile back-gesture machinery). ⌘[/⌘] on macOS, Alt+←/→ on Windows/Linux, plus the mouse back/forward buttons; sidebar header buttons hide below a 240px sidebar, and an exhausted stack swallows the keystroke so the app is never backed out of. Deleted sessions are skipped; ?session= URL handling is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
?session=URL handling is unchanged.?session=URLs, and the real history stack already belongs to the mobile back-gesture / exit-guard machinery (useSidebarHistory+ the popstate bridge).⌘[/⌘]on macOS (Safari/Finder standard) andAlt+←/Alt+→on Windows/Linux (the platform back/forward pair), plus the mouse back/forward buttons (BrowserBack/BrowserForward). Alt+Arrow is deliberately not bound on macOS, where it is word-wise caret movement. Shift chords are excluded (⌘⇧]switches tabs)./api/sessions: dead ids (deleted sessions) are dropped and the next entry in the same direction is tried, a failed list fetch aborts without dropping, and a view change during the await aborts the navigation so a slow fetch never yanks the chat away.lib/navigation-history.ts(pure stack + shortcut matcher),hooks/useNavigationHistory.ts(record/peek/commit/drop controller). Recording the entry the cursor already sits on is a no-op, which makes back/forward application self-suppressing — it can never push onto itself.Verification
npm run typecheck— clean.npm run lint— 0 errors (11 pre-existing warnings, unchanged frommain).npm test— 1165 tests: all pass exceptrunCli with --status returns status objectinbin/omp-web-tray.test.mjs, which also fails on unmodifiedmainunder the parallel full-suite run (it reads the machine's real~/.omp/agent/web-service.json); it passes when run standalone. 28 new tests cover the stack arithmetic, the shortcut matcher matrix (both platforms, IME composition, shift/mixed-modifier rejections), the hook choreography (self-suppression, forward truncation, dead-entry drop), and a static-render check that the sidebar buttons sit before Archived Sessions inside their collapsible wrapper with correct disabled states.npm run build— compiles successfully.⌘[/⌘]andAlt+←/Alt+→presses across sidebar/palette switches, fork then back, back onto a deleted session, repeated back at the end of the stack (must stay in the app), and dragging the sidebar below ~240px (buttons hide, title intact).