You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(groups): scroll active @mention option into view on keyboard navigation - #1729
When typing @ in a group chat with enough members to overflow the .mentionPopover (max-height: 220px; overflow-y: auto), pressing ArrowDown / ArrowUp moved mentionIndex without scrolling the popover container because focus remains in the composer <textarea> (combobox pattern). Users had to scroll the list manually with the mouse to see the highlighted member.
Attach mentionPopoverRef to the role="listbox" container and scroll the active [role="option"][aria-selected="true"] element into view via scrollIntoView({ block: "nearest" }) whenever the active mention option changes (matching PopupSelectView.tsx / MenuView.tsx).
Clamp activeMentionIndex to mentionCandidates.length - 1 across rendering and ArrowDown / ArrowUp / Enter / Tab handlers so dynamic roster shrinkage cannot leave the highlight out of bounds.
This change keeps the highlighted @mention visible during keyboard navigation and prevents an out-of-range highlight when the member list shrinks. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
标题“fix(groups): scroll active @mention option into view on keyboard navigation”与变更内容直接相关。变更在 GroupComposer.tsx 中为 @ 提及弹层的选中项添加滚动逻辑,并在 GroupChatPage.module.css 中为 .mentionOption 添加 scroll-margin-block,…
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Source excerpt: Reuse components and icons from `@deepseek-ai/dsh-client-ui-primitives` (`packages/client/ui-primitives/src/index.ts`); never ship OS-native `` (use `SelectField` or `Menu`).
CodeRabbit inference engine (apps/web-ui/AGENTS.md)
Files:
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupChatPage.module.css
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupComposer.tsx
Source excerpt: Do not write browser, e2e, or component tests for Web pages (`apps/web-ui`); the user checks page changes directly.
CodeRabbit inference engine (AGENTS.md)
Files:
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupChatPage.module.css
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupComposer.tsx
Learnings: 1
Common learnings
Learnt from: CR
Repo: BytePioneer-AI/codex-host PR: 0
File: .agents/skills/codexhost-code-review/SKILL.md:0-0
Timestamp: 2026-12-05T16:51:14.466Z
Learning: Applicability reference:
AGENTS.md: # Repository Guidelines
## Repository Skills
| Task | Skill |
| --- | --- |
| Reviewing a PR or local diff for correctness and boundaries | [codexhost-code-review](.agents/skills/codexhost-code-review/SKILL.md) |
Source excerpt:
# codexhost 代码审查
## 人工检查
- **UI 底线与演示图**:涉及可见 UI 改动(Web / Desktop / Android / Renderer / Console)的 PR,对照 [DESIGN.md](../../../DESIGN.md) 检查底线(不使用原生 `<select>`、复用 `ui-primitives`、使用语义 token、亮暗色与 390px 移动端可用、无堆叠边框与 Unicode 字符图标),并确认 PR 描述中已附带脱敏演示图(截图或录屏);无视觉变化的纯逻辑改动应注明 `No visual changes: <原因>`。
Additional comments: 1
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupComposer.tsx: 1
405-405: Functional Correctness
The comment asks whether scrollIntoView({ block: "nearest" }) moves an outer container. The supplied code does not establish a path where this happens. The call moves a scrollable ancestor only when the selected option is outside that ancestor's visible area. The option sits inside the mention popover, and the comment identifies no case where the popover itself is clipped. The concern depends on a layout premise that the comment does not establish. It is therefore a speculative question rather than a supported defect.
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
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.
Summary
When typing
@in a group chat with enough members to overflow the.mentionPopover(max-height: 220px; overflow-y: auto), pressingArrowDown/ArrowUpmovedmentionIndexwithout scrolling the popover container because focus remains in the composer<textarea>(combobox pattern). Users had to scroll the list manually with the mouse to see the highlighted member.Changes
apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupComposer.tsx:mentionPopoverRefto therole="listbox"container and scroll the active[role="option"][aria-selected="true"]element into view viascrollIntoView({ block: "nearest" })whenever the active mention option changes (matchingPopupSelectView.tsx/MenuView.tsx).activeMentionIndextomentionCandidates.length - 1across rendering andArrowDown/ArrowUp/Enter/Tabhandlers so dynamic roster shrinkage cannot leave the highlight out of bounds.apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupChatPage.module.css:scroll-margin-block: 4pxto.mentionOptionto align with the4pxvertical padding on.mentionPopoverwhen scrolled to either edge.Related issues
无 / N/A
UI Demo
Sanitized screenshots captured in an isolated Web instance (sidebar collapsed, 12 synthetic members / 13 candidates):
ArrowDown×10:10-Julietoff-screen,scrollTop: 0)ArrowDown×10:10-Julietscrolled into view)ArrowUpwrap from top to last item12-Lima)390×844,ArrowDown×10)Test plan
npx prettier --check apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupComposer.tsx apps/web-ui/packages/client/ui-codexhost/src/client/groups/GroupChatPage.module.css— passednode tools/check-boundaries.mjs— passednpm run build:web:ui— passednpx vitest run --config tests/vitest.config.js apps/web-ui/packages/client/ui-codexhost/test/group-reply-target.test.ts apps/web-ui/packages/client/ui-codexhost/test/group-ime-guard.test.ts— 2 files, 34/34 tests passedego-browser, desktop + mobile390×844, 12-member group room):ArrowDown×10 leftscrollTop === 0with10-Julietoutside the visible viewport).ArrowDownstepping (scrollTop: 141/205), bottom-to-top wrap (scrollTop: 0), top-to-bottomArrowUpwrap (scrollTop: 205), stepping back to top, query filtering (@02),Enterinsertion,Escapedismiss, mouse click selection, zero outer page scroll (window.scrollY === 0), and zero uncaught page errors.lint,typecheck, fulltest, Rust checks) — left to GitHub Actions perAGENTS.md.