Skip to content

feat(inbox): move the selection with the arrow keys (MUL-5622) - #6269

Merged
Bohan-J merged 1 commit into
mainfrom
agent/j/4d5ef0b7
Aug 2, 2026
Merged

feat(inbox): move the selection with the arrow keys (MUL-5622)#6269
Bohan-J merged 1 commit into
mainfrom
agent/j/4d5ef0b7

Conversation

@Bohan-J

@Bohan-J Bohan-J commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

What

Arrow keys in the inbox list only scrolled the scroll container — the selection stayed put, so notifications could only be opened with the mouse. Up/Down now walk the selection like every mail-style list.

  • Down/Up move the selection by one row and stop at the ends of the list.
  • With nothing selected, Down enters the list at the top and Up at the bottom.
  • The new row is scrolled into view through Virtuoso's scrollIntoView, so a row that virtualization has not mounted still gets there, and a selection moving inside the viewport does not scroll at all. The DOM's own scrollIntoView is avoided on purpose — it scrolls every ancestor and shoves the desktop shell around ([Bug]: Small UI bug #3929).
  • The keypress is claimed even at the ends of the list, so the native scroll cannot pull the viewport off the selected row.

Details worth calling out:

  • The handler is bound to the scroll container, not the document. Pressing Down while reading the issue detail in the right panel must not swap the row out from under the reader.
  • Focus is parked on the container, not on a row. Virtualization unmounts the clicked row as soon as it scrolls out, and focus falling back to <body> would silently kill the next keypress. Clicking a row focuses the container too — Safari does not focus a <button> on click, so without that the arrow keys would stay dead after a click.
  • Modified arrows (Shift/Cmd/Ctrl/Alt), text fields, and IME composition keep their own meaning.

Testing

  • New packages/views/inbox/components/inbox-list.test.tsx — 9 cases covering both directions, entering the list from either end, clamping at the ends while still claiming the key, the Virtuoso scroll call, modified arrows, text fields, IME composition, and focus after a click.
  • pnpm exec vitest run in packages/views — 298 files / 3474 tests pass.
  • pnpm typecheck (repo-wide) and eslint on the touched files pass.

Up/Down inside the inbox list scrolled the container instead of walking the
selection, so a notification could only be opened with the mouse.

The list's scroll container now owns the arrow keys: it moves the selection
by one row, scrolls the new row into view through Virtuoso (never the DOM's
scrollIntoView, which also scrolls ancestors), and claims the keypress so the
native scroll cannot pull the viewport off the selected row. Keyboard focus
is parked on the container rather than a row, because virtualization unmounts
rows as they scroll out. Scoping the handler to the container keeps Down from
swapping the row out while the user is reading the issue detail.

Co-authored-by: multica-agent <github@multica.ai>
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multica-docs Ready Ready Preview Aug 2, 2026 3:04pm

Request Review

@Bohan-J
Bohan-J merged commit 9b013e3 into main Aug 2, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant