fix(web): restore composer mention menu highlight and scroll sync#1285
fix(web): restore composer mention menu highlight and scroll sync#1285GuilhermeVieiraDev wants to merge 1 commit intopingdotgg:mainfrom
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 Tip You can disable sequence diagrams in the walkthrough.Disable the |
What Changed
Fixed the composer
@mention menu so keyboard navigation keeps the highlighted item in view.Also restored a single highlight owner for the menu. Arrow key navigation now goes back through Base UI's built-in highlight handling, which fixes the duplicate-highlight behavior where one item could stay visually selected while another became active from keyboard navigation.
Why
The
@mention picker had two related issues:ArrowDown/ArrowUpcould move the active item without scrolling the menu, so the real selection could end up outside the visible area.This change keeps highlight ownership in one place and adds scroll sync on the active item, which makes keyboard navigation behave like a normal command menu again.
UI Changes
Before:
Screencast.From.2026-03-21.21-48-42.mp4
After:
Screencast.From.2026-03-21.21-50-58.mp4
Checklist
Note
Restore keyboard highlight ownership and scroll behavior in the composer mention menu
nudgeComposerMenuHighlightin ChatView.tsx to dispatchArrowUp/ArrowDownkeyboard events to a hiddenCommandInputinstead of computing the next item locally, delegating highlight ownership back to theCommandcomponent.useEffectin ComposerCommandMenu.tsx that callsscrollIntoView({block:"nearest"})on the active item whenever the highlighted item changes, keeping it visible during keyboard navigation.data-activeanddata-pathattributes onComposerCommandMenuItemand addsscroll-my-2to improve scroll positioning.ArrowDown, and asserts the list scrolls and the selected path is inserted into the prompt.Macroscope summarized 7ed9e84.