feat(sidebar): search the workspace switcher when a user has many workspaces#5893
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Settings sidebar changes the scroll container from top-only padding ( Reviewed by Cursor Bugbot for commit 04534ce. Configure here. |
5d2477d to
4854375
Compare
Greptile SummarySearch and navigation enhancements for the workspace switcher, plus bottom padding for the settings sidebar.
Confidence Score: 5/5The PR appears safe to merge. No blocking failures remain within the scope of the previous review threads. Important Files Changed
Reviews (4): Last reviewed commit: "fix(settings): pad settings-sidebar scro..." | Re-trigger Greptile |
4854375 to
827a6ee
Compare
827a6ee to
c34ead2
Compare
|
@greptile Addressed the positional-index finding: the highlighted row is now clamped against the current filtered results on read ( |
|
@cursor review |
|
The clamping is clean and the consumption is consistent — One minor note: the clamp always resets to Otherwise the fix is solid. Thanks for addressing it. |
c34ead2 to
c553795
Compare
c553795 to
43b8fe4
Compare
43b8fe4 to
a1d7bb1
Compare
|
@cursor review |
a1d7bb1 to
6404d68
Compare
|
@cursor review |
…kspaces Shows a search input in the workspace dropdown once the list exceeds WORKSPACE_SEARCH_THRESHOLD (3). ArrowUp/Down move through results, Enter switches, and the query resets on close. All the search machinery is gated on showSearch so users with few workspaces get no extra re-renders. The input reuses the emcn ChipInput chrome (icon prop) rather than hand-rolling the field. The highlight tracks the highlighted workspace by identity (a stored id, not a numeric position). An effect keeps that id pinned to a workspace that is actually in the current results — seeding the first result on open and re-seeding when a query filters the current one out — so even the default highlight is identity- stable. A live list change while the menu is open (shrink, grow, or reorder from a membership change or background refetch) therefore carries the highlight and Enter along with the same workspace instead of stranding them on whatever now sits at that row. `activeIndex` derives from the id and is the single source of truth for Enter, the visual highlight, and the scroll target. Search and highlight reset via an effect keyed on the menu-open state, so closing by any path (selecting a workspace, Escape, click-away) clears them — not only the Radix-driven close that routes through onOpenChange. Hover-highlight is wired to mousemove rather than mouseenter so a keyboard-driven scrollIntoView can't fire a synthetic enter that hijacks the keyboard selection, and composition keys are ignored while an IME is active so confirming a candidate can't switch workspace.
…ver isn't clipped The scrollable settings-nav container had `pt-1.5` but no bottom padding, so the last item's rounded `--surface-active` hover pill was clipped against the container's overflow edge (visible on "Custom blocks", the final Enterprise item). Give it symmetric vertical padding (`py-1.5`) so the last row gets equal breathing room. Padding sits on the scroll container, not between items, so item spacing is unchanged.
6404d68 to
04534ce
Compare
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 04534ce. Configure here.
Summary
Two sidebar improvements:
1. Workspace switcher search (
workspace-header.tsx)Restores searchable, keyboard-navigable workspace selection for users with many workspaces — the switcher becomes hard to navigate once the list is long.
WORKSPACE_SEARCH_THRESHOLD(> 3 workspaces).chipVariants({ active })so it matches hover/active exactly.ChipInput(iconprop) — no hand-rolled field chrome.showSearch, so users at ≤3 workspaces get zero extra work.Reuses the pattern that previously lived on an unmerged branch, ported onto current code with the anti-flash refinements (prefetched list means
showSearchis stable from first paint; the input only mounts inside the opened, already-hydrated dropdown).2. Settings-sidebar last-item hover clip (
settings-sidebar.tsx)The scrollable settings-nav container had top padding but no bottom padding, so the last item's rounded hover pill was clipped against the overflow edge (visible on "Custom blocks", the final Enterprise item). Fixed with symmetric
py-1.5on the scroll container — item spacing is unchanged.Testing
buntypecheck + biome clean on both files./cleanuppass (effects, state, memo, callback, React Query, url-state, emcn, comments) over both surfaces — no anti-patterns; only inlined a trivial filter memo and collapsed a padding shorthand.