Repository navigation
Messages can be reached from the keyboard: ↑ and ↓ select one in the timeline, Return opens its menu - #294
Merged
Conversation
The timeline is one Tab stop. Taking the keys it selects the newest message (or the top one in view); up and down move the selection and scroll it into view a row at a time; Return, or off macOS the menu key or Shift+F10, opens the message's menu under its bubble; Esc gives the keys back to the composer, where up still edits our last message. The selected row is the timeline's active descendant, so a screen reader reads it, and a band of the accent shows it while the timeline has the keys. A click in the timeline leaves the keys where they were.
…ts keys go Return on a selected message scrolled out of view brings its row back before opening the menu, so the menu is drawn and has the keys; the timeline taking the keys again brings back the one still selected. The menu opened from the keys closes when they go elsewhere (Tab, a shortcut, its row scrolled away), handing them to the timeline if they fell to the window. Esc in a chat without a composer leaves the keys in the timeline. The focus listener is kept with the state it serves, and the menu-key check takes the system so both are tested. Tests: Esc in the menu, a control's own Return and up, the timeline scrolled back, the menu under an incoming bubble and inside the window. Comments and DESIGN.md say what the code draws.
Owner
Author
Review (
|
This was referenced Nov 29, 2026
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
The timeline is one Tab stop, and from it the keyboard reaches every message and its actions (the owner's decision of 2026-11-29 in the issue):
aria_selected, so a screen reader reads its label ("who: what. when") as the current item. The timeline itself is aListlabelled "Messages".build_menuas its right-click and … menus (React ▸, Reply, Edit, Copy, Retry, Delete for Everyone…), drawn 4 under the bubble from its outer edge and kept in the window; a selection scrolled out of view comes back first. Closed, it gives the keys back to the timeline, unless the item took them (Reply and Edit go to the composer); it also closes as its keys go elsewhere (Tab, a shortcut, its row scrolled away).--snapshotgainsselected(Ana's long message selected) andselected-menu(its menu open).Code:
app/actions/mod.rs(selection state,timeline_key,step_selection,open_message_menu),app/actions/view.rs(with_keysfor the timeline, the band, the reveal, the menu under the bubble),app/view.rs(the row marks itself selected).Why
#284 left a message's hover buttons and right-click menu pointer-only (GPUI gives no Tab stops to hidden elements). The owner chose ↑↓ in the timeline over a Tab stop per button.
Choices to look at
// shortcut:a selected message out of view below goes to the top of the timeline, not the bottom (MessageScrollerStatescrolls only to a row's top, and only a drawn row can ask the list for more). This happens only when the timeline was scrolled away from the selection with the pointer; ↑↓ from a selection in view always scroll a row at a time.How it was tested
Window tests in
actions::window_tests, each written first and failing on the base (Tab never reaches messages), or for the review's fixes on the code before them; each fix was also taken out again to see its test fail:tab_reaches_the_timeline_where_up_and_down_move_the_selection: Tab selects the newest (drawn selected), ↑↑ / ↓↓↓ move and stop at the newest; a click in the timeline leaves the composer the keys and hides the selection; ⌥↓ from the timeline opens Ana's chat.the_selected_message_is_brought_into_view: 71 messages; 40 × ↑ then 40 × ↓, the selected row inside the timeline after each, never jumping to the top on the way down (fails without the reveal, without the autoscroll, and without the extra pixel).return_opens_the_selected_messages_actions_under_it_and_they_work: the newest's menu stays in the window and Esc closes it alone (keys and selection stay in the timeline); on Ana's message the menu is drawn under her bubble on her side; Copy copies and gives the keys back to the timeline; Reply replies ("Replying to Ana Popescu"), the composer has the keys and the selection no longer shows.the_menu_closes_when_its_keys_go_elsewhere: ⌘K with the menu open closes it.a_selection_out_of_view_comes_back_for_the_keys_and_its_menu: scrolled away, Return brings the row back with its menu; Tab back brings it into view; its row scrolled away under the open menu closes the menu and keeps the keys in the timeline.scrolled_back_the_timeline_takes_the_keys_on_a_message_in_view: the top one in view, not the newest.return_and_up_on_a_control_in_a_message_are_the_controls: on a reaction pill, Return opens who reacted, no message menu, and ↑ leaves the selection.esc_in_a_chat_without_a_composer_leaves_the_keys_in_the_timeline.esc_gives_the_keys_back_to_the_composer_where_up_edits_our_last: Esc clears the selection, the composer has the keys, ↑ there edits our last message.actions::tests::return_opens_a_messages_menu_and_off_macos_the_menu_key_and_shift_f10_too: both systems.make format && make checkon the branch merged withorigin/main(4e5b0ae):cargo fmt --checkpass;cargo clippy --all-targets -D warningspass, and with--features hush-desktop/snapshotpass;cargo test --features hush-desktop/snapshotpass (396 + 553 tests, 4 ignored as before).Snapshots (
cargo run -p hush-desktop --features snapshot -- --snapshot <dir>), looked at on 3bb6645 and again on 4e5b0ae:selected-light/selected-dark(Ana's long message on the band; in dark the grey incoming bubble stays distinct on it),selected-menu-light/selected-menu-dark(React ▸, Reply, Copy under her bubble, the band still shown),file-menu(a file's right-click menu still opens over the timeline),chat.Closes #286