fix(web): return from footer pages to active thread - #6481
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved 2cfbf04 Simple UX improvement that conditionally uses browser history navigation instead of always navigating to root. Uses standard tanstack/react-router hooks and browser APIs with existing fallback behavior preserved. You can customize Macroscope's approvability policy. Learn more. |
Problem
Opening Usage or Pull Requests from an active thread replaces the footer actions with a Back button, but that button always navigated to
/. This discarded the originating thread and showed the new-thread screen.Fix
Use the router's in-app history state for the shared sidebar Back action. When history is available, the button returns to the route that opened the footer page; direct entries still fall back to
/.Impact
Users return to the active thread they came from after viewing Usage or Pull Requests. Direct links retain the existing safe fallback.
Validation
./node_modules/.bin/vp run --filter @t3tools/web typecheckNote
Fix footer back button to return to active thread using browser history
The footer back button in
SidebarChromeFooternow callswindow.history.back()when a browser history entry exists, falling back to navigating to/when there is no history. This uses theuseCanGoBackhook from@tanstack/react-routerto determine which path to take.Macroscope summarized 2cfbf04.
Note
Low Risk
Small navigation-only change in the sidebar footer with a safe
/fallback when history is empty.Overview
The sidebar Back control on Usage and Pull Requests no longer always routes to
/.SidebarChromeFooternow usesuseCanGoBackfrom TanStack Router: when in-app history exists,handleBackClickcallswindow.history.back()so users return to the thread (or route) they came from; if there is no history (e.g. direct entry), it still navigates to/.This matches the back-navigation pattern already used in settings-related screens.
Reviewed by Cursor Bugbot for commit 2cfbf04. Bugbot is set up for automated code reviews on this repo. Configure here.