Accept collaborative @ mentions with Tab - #1301
Merged
Paul Lizer (paullizer) merged 2 commits intoAug 19, 2026
Merged
Conversation
In multi-user conversations the chat composer's @ mention menu only accepted the highlighted suggestion on Enter. Tab fell through to the browser default, moving focus out of the message box and leaving the half-typed @name behind. The agent-instruction mention menu already treated Tab and Enter the same way, so the chat composer was the odd one out. Extract the inline Enter selection logic into selectActiveMentionSuggestion() so every accept key routes through one implementation of the participant tag, ai_tag invocation target, and invite-confirmation branches, then add a Tab branch that reuses it. Shift+Tab and the empty-results state are deliberately left unhandled so normal focus movement still works, and the Enter guard is unchanged. Also fix the listbox semantics in the same code path: suggestions are now real options with stable ids and aria-selected, and the composer references the highlighted option via aria-activedescendant paired with aria-controls, which ARIA 1.2 requires because the menu is a sibling of the textarea rather than a descendant. Those attributes are applied only while the menu is open. The highlighted option is scrolled into view inside the height-capped menu. Fixes #1299 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
PR #1300 landed on Development and claimed 0.260.004, so this branch moves to 0.260.005 and its release notes entries move into a new 0.260.005 section above the merged 0.260.004 entry. The fixes index keeps both new entries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.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.
Fixes #1299
What was broken
In multi-user (collaborative) conversations, typing
@in the chat composer opens the participant / agent suggestion menu. Arrow keys moved the highlight and Enter accepted the highlighted entry, but Tab did nothing — it fell through to the browser default, moved focus out of the message box, and left the half-typed@partext behind.The agent-instruction mention menu (
static/js/agent_instruction_mentions.js) already treated Tab and Enter as the same "accept" action, so the chat composer was the odd one out.What changed
Tab support in
handleComposerKeydown()(static/js/chat/chat-collaboration.js):Enterselection body into a sharedselectActiveMentionSuggestion()helper, so every accept key routes through one implementation of the three suggestion kinds (participanttag, agent/modelai_tag, invite confirmation) instead of duplicating the branching.Tabbranch that reuses the helper, callspreventDefault()so focus stays in the composer, and returnstrue.hasActiveMentionSuggestion()guard that runs beforepreventDefault(), so Tab is only captured when there is something to accept.Enterguard is unchanged, so unrelated Enter presses still send the message.Adjacent accessibility fix found in the same code path:
#collaboration-mention-menuis declaredrole="listbox"inchats.html, but its items were plain buttons with norole="option"/aria-selected, so screen readers could not announce which suggestion was highlighted.collaboration-mention-option-{index}) andaria-selected.aria-activedescendant, paired witharia-controlsandaria-autocomplete="list". ARIA 1.2 only resolvesaria-activedescendantfrom a focused textbox when the option lives inside the element named byaria-controls, and the menu is a sibling of#user-input, not a descendant. All three attributes are applied only while the menu is open and removed when it closes, so the composer stays a plain textbox the rest of the time.max-height: 240px) menu, so arrowing through a long list no longer highlights an off-screen entry.Validation
Before / after, measured by running the real shipped functions from
chat-collaboration.jsagainst a jsdom document (pre-fix source pulled fromgit show HEAD):falsetruerole="option"aria-activedescendanton the composerfunctional_tests/test_collaboration_mention_tab_autocomplete.py— 5/5 passed. Parses the real function bodies out of the module and asserts the Tab branch, theshiftKeyguard, the guard-before-preventDefault()ordering, the shared selection path, and the ARIA wiring. Run against the pre-fix source it fails 3/5, so it is a real regression test.ui_tests/test_chat_collaboration_mention_tab_selection.py— new Playwright regression test covering Tab, ArrowDown+Tab, Enter, Shift+Tab, focus retention, and the listbox ARIA. Skips withoutSIMPLECHAT_UI_BASE_URL/SIMPLECHAT_UI_STORAGE_STATE.chat-collaboration.js— no regressions, verified again after mergingDevelopment.Notes
0.260.005.Developmentmoved ahead mid-review and Reset the conversation Documents pane on New chat #1300 claimed0.260.004, so this branch mergedDevelopmentand rebumped; the release notes now have a0.260.005section above the merged0.260.004entry.Known-unrelated red marks
check-release-notesCI failure is not caused by this PR. ItsValidate release notes updatestep passes; the job fails on the follow-upPost PR comment (when latest features likely needed but missing)step withHttpError: Resource not accessible by integration(403). Reset the conversation Documents pane on New chat #1300 fails the same check for the same reason. The reminder itself is documented as non-blocking, and no Latest Features card is warranted here — that catalog is a major-release showcase (release_250_*entries such as Agents Catalog and Workflows), not a home for a keyboard-shortcut bug fix.functional_tests/test_conversation_contents_drawer_settings.py::test_user_preference_route_persists_boolean_and_rejects_invalid_typefails withname 'AI_NOTICE_USER_SETTINGS_KEY' is not defined. Reproduced on a cleanorigin/Developmentworktree, so it is pre-existing and unrelated.ui_tests/test_workspace_document_selection_controls.py:46calls.first()instead of the.firstproperty, so that test errors out before its assertions run. Pre-existing, spotted during review, deliberately not fixed here — worth its own issue.