Scroll active item into view in composer menu#1557
Merged
juliusmarminge merged 3 commits intopingdotgg:mainfrom Mar 30, 2026
Merged
Scroll active item into view in composer menu#1557juliusmarminge merged 3 commits intopingdotgg:mainfrom
juliusmarminge merged 3 commits intopingdotgg:mainfrom
Conversation
- Scroll the active menu item into view when the active item changes. - Attach a ref to the list container and query the item by its data- attribute to call scrollIntoView. - Add data-composer-item-id on items to support the lookup.
|
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 |
bf0c6e4 to
7b60351
Compare
- Keep highlighted menu items visually stable on hover - Preserve active item accent styling
juliusmarminge
approved these changes
Mar 30, 2026
This was referenced Mar 30, 2026
8 tasks
Chrono-byte
pushed a commit
to Chrono-byte/t3code
that referenced
this pull request
Mar 31, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
xddinside
pushed a commit
to xddinside/t3code
that referenced
this pull request
Apr 4, 2026
Co-authored-by: Julius Marminge <julius0216@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Why
When navigating the @ file/command popover with arrow keys, the highlighted item's CSS class updated but the list never scrolled. Holding arrow down past 8+ items left the active item hidden behind the bottom edge of the max-h-64 container.
UI Changes
Before: enter
@then filename, if result is more than 8, hold down arrow down, the highlighted element is hiddenArea.2026-03-30.08.24.21.mp4
After: the highlighted element is scrolled into view
Area.2026-03-30.08.26.02.mp4
Checklist
Note
Low Risk
Low risk UI-only change that adds
scrollIntoViewbehavior when the active item changes. Main risk is minor scrolling/hover styling regressions in the command popover.Overview
Keeps the composer @/slash-command popover usable with long lists by automatically scrolling the currently active (keyboard-highlighted) item into view.
Adds a
useLayoutEffectwith a container ref that finds the active row via a newdata-composer-item-idattribute and callsscrollIntoView({ block: "nearest" }), and tweaksCommandItemclasses to preserve styling while hovering/highlighting.Written by Cursor Bugbot for commit 4db73ec. This will update automatically on new commits. Configure here.
Note
Scroll active item into view in the composer command menu
useLayoutEffectinComposerCommandMenuthat callsscrollIntoView({ block: "nearest" })on the active item wheneveractiveItemIdchanges, using adata-composer-item-idattribute as the selector target.ComposerCommandMenuItemto avoid visual conflicts with the existingdata-highlightedstyles.Macroscope summarized 4db73ec.