scroll sidebar to active thread#3705
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 Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 This PR adds auto-scroll behavior to the sidebar, a self-contained UI enhancement. Changes are limited to presentational logic using standard DOM APIs with no impact on business logic, data handling, or critical paths. You can customize Macroscope's approvability policy. Learn more. |
6dcce5c to
ef8d8f7
Compare
|
Fixed by clearing the sidebar scroll dedupe key when leaving thread/draft routes, so revisiting the same target scrolls again. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ef8d8f7. Configure here.
ef8d8f7 to
360e4d2
Compare
360e4d2 to
3f9268f
Compare

What Changed
Why
Opening a thread should reveal its sidebar row without retriggering on expand/collapse or print dialogs.
UI Changes
t3code-sidebar-scroll-aperture.mp4
Checklist
Note
Low Risk
Sidebar navigation and rendering UX only; no auth, data, or API changes. Slight behavior change when projects are collapsed (single active row vs prior pinned-preview rendering).
Overview
The sidebar now scrolls to reveal the current route when you open a thread or a draft composer session. Thread rows and project headers get
data-sidebar-thread-key/data-sidebar-project-keyattributes; auseLayoutEffectfinds the matching element and callsscrollIntoView(centered, instant). Scrolling runs only when the scroll target changes (tracked in a ref), skips mobile when the sheet is closed, and can target the project header when there is no thread route.Collapsed project thread lists no longer duplicate ad-hoc preview logic: they use shared
getVisibleThreadsForProject, which now accepts an optionalgetThreadIdso comparisons use scoped thread keys. When a project is collapsed, only the active thread row is rendered (if it is among the visible set); expanded projects still show the full preview/expand behavior.Draft routes contribute to
activeRouteProjectKeythe same way thread routes do, so draft sessions highlight and scroll the correct grouped project.Reviewed by Cursor Bugbot for commit 3f9268f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scroll sidebar to active thread or project when sidebar becomes visible
data-sidebar-thread-keyanddata-sidebar-project-keyattributes to thread rows and project headers in Sidebar.tsx to enable DOM queries for scroll targeting.getVisibleThreadsForProjectin Sidebar.logic.ts, keyed by scoped thread key; collapsed projects now render only the active thread row.Macroscope summarized e3f86a3.