fix(ux): spamming cmd + , no longer stack opening settings#2757
fix(ux): spamming cmd + , no longer stack opening settings#2757jamesx0416 wants to merge 3 commits into
Conversation
📝 WalkthroughWalkthroughAppSidebarLayout component now tracks the current pathname using ChangesSettings navigation history management
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 Straightforward UX fix that prevents browser history pollution when repeatedly pressing cmd+, to open settings. Changes are limited to navigation behavior with no broader runtime impact. You can customize Macroscope's approvability policy. Learn more. |
ac55c27 to
4ec0d32
Compare
Dismissing prior approval to re-evaluate 4ec0d32
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/components/AppSidebarLayout.tsx`:
- Line 50: The replace decision uses pathnameRef.current.startsWith("/settings")
which incorrectly matches paths like "/settings-foo"; update the condition used
when calling navigate({ to: "/settings", replace: ... }) to perform a
boundary-safe check (e.g. test that pathnameRef.current is exactly "/settings"
or matches the "/settings" segment boundary such as using a regex like
/^\/settings(\/|$)/ or checking startsWith("/settings/")) so only true settings
routes trigger replace; locate the call in AppSidebarLayout where navigate and
pathnameRef.current are used and replace the startsWith check with the
boundary-safe check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 77a90cc7-57b7-4e7a-9b9f-651716d83758
📒 Files selected for processing (1)
apps/web/src/components/AppSidebarLayout.tsx
4ec0d32 to
ea54c3d
Compare
Dismissing prior approval to re-evaluate bc35b12
bc35b12 to
916a1b2
Compare
What Changed
Replaced repeated settings-route pushes from the desktop menu action when the current route is already under
/settings.Why
Pressing Cmd+, or using the macOS Settings menu item while already in settings could push duplicate settings entries onto browser history. That forced users to press Escape or Back multiple times to leave settings. Replacing the current history entry for repeated settings opens keeps the escape/back path to a single step.
UI Changes
No visual UI changes. This only changes settings navigation history behavior.
Before:
Screen.Recording.2026-05-19.at.5.17.24.pm.mp4
After:
Screen.Recording.2026-05-19.at.5.18.13.pm.mp4
Checklist
Note
Low Risk
Small navigation-only change in the desktop menu handler with no auth, data, or API impact.
Overview
Fixes desktop Settings / Cmd+, navigation so repeated opens while already in settings no longer push duplicate browser history entries.
AppSidebarLayoutnow reads the current pathname (via a ref so the menu callback stays stable) and callsnavigateto/settingswithreplace: truewhen the active route already matches/settingsor a child path. The first jump into settings from elsewhere still uses a normal push.Reviewed by Cursor Bugbot for commit 916a1b2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix repeated cmd+, keypresses stacking duplicate settings history entries
When navigating to
/settingsvia the menu action in AppSidebarLayout.tsx, the router now usesreplaceinstead ofpushif the user is already on/settingsor a subroute, preventing history stack buildup from repeated keypresses.Macroscope summarized 916a1b2.
Summary by CodeRabbit