Repository navigation
Conversation
Each docpage built its own copy of the desktop sidebar inside its route component, so every client-side navigation unmounted it and lost the scroll position and any groups the reader had expanded. Render the sidebar once as an app wrap instead. It reads the current route from react-router, opens a group when the route is one of its descendant pages, and scrolls the active link into view only when it is off-screen. Docpages reserve the column with an empty slot, and CSS hides the shared sidebar on pages without one. Also truncate long sidebar leaf labels so a selected item no longer wraps past its fixed-height highlight; the full label shows on hover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; the numbered finding is fixed. SummaryThe desktop docs sidebar now stays mounted across navigation, preserving its scroll position and expanded groups.
Reviews (3) · Last reviewed commit: "Use rx.el.div for the docs sidebar wrapp..." · Reviewed by Greptile |
Merging this PR will degrade performance by 2.1%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
Groups derived their open prop from the live route, so React closed a group the reader had expanded as soon as they navigated away from a page inside it. Render each group's initial state from the route the sidebar mounted on, which never changes afterwards, and have navigation open the active link's ancestor groups directly instead. Navigation now only ever opens groups, leaving the reader's own choices alone. Also use rx.el.div for the sidebar column slot, per the docs app's element conventions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Every docs page built its own copy of the desktop sidebar inside its route component. Each client-side navigation therefore unmounted it and mounted a fresh one, which:
Change
extra_app_wraps), outside the page routes, so navigation no longer unmounts it.useLocationinstead of from values computed per page in Python (calculate_index/normalize_urlare removed). A group is open when the current route is one of its descendant pages..docs-sidebar-slot. The shared sidebar is fixed-positioned over it, and a CSS:hasrule hides it on pages without a slot (404, redirects).on_mountscript, which added a newpopstatelistener on every mount.reflex-site-shared): a selected leaf such asreflex-components-react-playerused to wrap past its fixed-height highlight. Leaf labels now truncate with an ellipsis, and the full name shows on hover.Behavior notes
Testing
test_sidebar_offsets_follow_navbar_and_announcementfailed once on a freshly compiled dev server and passed on every re-run. It looks like a pre-existing hydration race on the "Dismiss announcement" click, but I haven't checked it againstmain.🤖 Generated with Claude Code