Skip to content

Keep Threads focus on the thread the list shows open - #1535

Merged
max-sixty merged 9 commits into
mainfrom
thread-c-reply
Oct 1, 2026
Merged

max-sixty merged 9 commits into
mainfrom
thread-c-reply

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

On the Threads list, focus now always stands on the thread the list shows open, so the ring the user sees, the box c writes in, and the keys the line offers all name the same thread.

Why

Two rules were written while the list showed only titles: c on the list wrote on the page (Aug 25), and Escape from a thread returned to a "whole panel" stop that g T also landed on (#921). Then #999 kept one thread open whenever the list shows any, and #1480 made that card fill the list. The list's own focus ring therefore outlined the open card exactly, while c from there wrote in the page box and Escape, r, Enter and the shading treated the stop as no thread at all. A user saw a selected thread and c went somewhere else.

What changes for the user

  • Focus given to the list (g T, Escape from the panel's general box, a fold of the focused card) goes on to the open thread's title. There c writes its reply, r resolves, and the line offers r resolve and esc close threads. The list keeps focus itself only while it shows no thread.
  • Focus on a collapsed title opens its thread, however it arrives, so focus, selection and the open card never part. A pointer press still opens on its click.
  • Escape from a panel thread is the panel's own rungs: clear the narrowing, then close. Leaving a reply takes two Escapes rather than three.
  • In a narrow window, where the panel covers the page, c and e on a panel thread work; both were dead there. comment.create and reaction.open now declare covering, replacing the panel's own copy of c, which knew only the page box.
  • The expanded shortcut bar gives back the rows that fit once a wider row is trimmed.

Where to look

  • runtime/thread/thread-list-view.js: the list passes its focus to the open title, and a title taking focus becomes the choice.
  • runtime/keyboard/page.js: a panel thread has no let-go floor of its own.
  • runtime/user-intent.js: focus a container passed on, before any newer input, counts as displaced, so a resolve's landing still carries the user to the next thread.
  • runtime/thread/thread-list.js: the place hold is taken when a closed title's focus opens it.
  • runtime/composing/surface.js, runtime/reactions.js, runtime/thread/panel.js: one c row for page and panel.
  • runtime/keyboard/AGENTS.md: the Threads selection contract.

Tests

About 60 browser tests walked through the old whole-panel stop; they now assert where the user lands. Renamed where the name stated the old stop: test_go_to_threads_lands_on_the_open_thread_from_a_page_thread, test_a_panel_thread_closes_with_the_panel_as_go_to_threads_does, test_a_note_walked_on_inside_the_panel_is_left_by_the_panel_holding_it, test_the_line_offers_the_thread_g_t_lands_on_its_own_keys, test_an_empty_thread_list_wears_its_ring_whole. New: test_the_threads_list_hands_focus_to_the_thread_it_shows_open (1600 and 420px) and test_a_title_taking_focus_opens_its_thread. Tab walks down the list now cross each thread's controls, since each title Tab reaches opens, and a reader who stood on a later thread by scripted focus walks there with t.

The 26 browser files touching Threads pass apart from tests that fail the same way on main and load flakes whose rate matches main's in paired runs.

This was written by Claude Code on behalf of max-sixty

max-sixty and others added 9 commits September 30, 2026 21:12
Standing on the Threads list (after `g T`, or Escape out of the page box),
`c` went to the page comment box although the list shows one card
expanded with its Reply box, and where that card fills the list the
list's focus ring draws round it, so the card reads as selected. The
rule "from the list, `c` is the page box" dates from when the list
showed only titles; #999 gave it an always-expanded card and nothing
revisited the rule. #1204 fixed the same mismatch for the margin card.

- `standingThread` (thread/landing.js) reads a focused list as standing
  at its expanded card (`expandedThread`, thread-list-view.js), so the
  `c` badge, the shortcut bar, `c` and `e` all name that card.
- The panel's own `c` row (`comment.write`) is gone. It was a copy of
  the page's `c` that knew only the page box and stood down inside a
  thread for the page row to answer; where the panel covers the page
  (narrow windows) the dispatcher drops page rows, so `c` on a panel
  thread's title did nothing. `comment.create` and `reaction.open` now
  declare `covering: true`, as the walks already do, and gate on what a
  covering surface leaves reachable: the Threads panel for `c`, a reply
  for `e`. `e` on a panel thread at narrow width now opens reactions.
- The shortcut bar's trim now offers each trimmed row its place back,
  highest-ranked first, once a wider row has gone. At 420px the
  expanded bar on the list had dropped `c` and `t / T` because the
  longer "comment on the thread" label pushed them out and nothing put
  `t / T` back after `c` went.

Tests: `test_the_threads_list_answers_c_in_the_card_it_shows_expanded`
walks four routes at 1600px and 420px; seven of its eight cases fail on
the base. Four tests that used `c` from a list with threads as the way
into the page box now focus that box directly, or follow `c` into the
expanded card's reply.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Since #999 the list always shows one thread open, and since #1480 that
card fills the list, so the list's own focus ring outlined the card while
its keys answered for the whole panel: `c` wrote in the page box, and
Escape, `r`, Enter and the shading treated the stop as no thread at all.

Focus given to the list now goes on to its open thread's title, whatever
gave it (`g T`, Escape from the general box, Tab, a fold). The list holds
focus itself only while it shows no thread. A panel thread has no let-go
floor of its own any more: Escape from it is the panel's rungs, which
clear narrowing and then close. This replaces the previous commit's
reading of the list as standing for its card, which only `c` and `e`
shared.

Behavior that moved: `g T` lands on the open thread's title, so `c`
replies and `r` resolves from there; Escape from a reply box takes two
presses to close the panel rather than three; Escape from the general box
lands on the open thread. The keyboard contract's two-level Threads
selection and its TODO about page `t` exiting through whole-panel
selection are gone. `test_the_threads_list_hands_focus_to_the_thread_it_shows_open`
replaces the list-route test.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A resolve folds the focused card, and the list took focus as the card's
container; the resolve's landing then counted that as the user still being
there and carried them to the next thread. Now the list passes that focus
straight to its open thread, so retainUserIntent counts focus a container
passed on, before any newer input, as displaced like focus it holds.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
With the list passing its focus to the thread it shows open, no test can
stand on the list while a thread shows, and Escape from a panel thread
is the panel's own rungs. The tests that walked through that stop now
assert where the user really lands:

- `g T`, Escape from the general box, and a fold land on the open
  thread's title, with `r resolve` and `esc close threads` on the line
  and `Reply c` on its box.
- Escape from a reply box returns to its title, and the next one clears
  a narrowing or closes the panel, never stopping on the list.
- The list's own ring is exhibited, and checked whole, on an empty list,
  the only place it still shows. The case of threads scrolling under it
  is gone; the overlay stays for the last card folding away.

Renamed where the name stated the old stop:
`test_go_to_threads_lands_on_the_open_thread_from_a_page_thread`,
`test_a_panel_thread_closes_with_the_panel_as_go_to_threads_does`,
`test_a_note_walked_on_inside_the_panel_is_left_by_the_panel_holding_it`,
`test_the_line_offers_the_thread_g_t_lands_on_its_own_keys`,
`test_an_empty_thread_list_wears_its_ring_whole`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…er reaches it

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A title could hold focus closed while another card stood open, so the
Reply box on screen was the other thread's and nothing named where `c`
would write. Now focus on a title selects its thread however it arrives,
so focus, selection and the open card never part. A pointer press still
opens on its click, where the press's landing and the list's place hold
stand; the place hold is also taken when a closed title's focus opens it.

Tests: `test_a_title_taking_focus_opens_its_thread` is new. The Tab walk
down the list and the walk to the comments grip cross each thread's
controls now, since each title Tab reaches opens.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A title taking focus now opens its thread, so a scripted focus opened it
with no input behind the shift. The reader walks there with t instead,
which opens it under their own key.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 6bdfb6c into main Oct 1, 2026
4 checks passed
@max-sixty
max-sixty deleted the thread-c-reply branch October 1, 2026 23:29
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.

2 participants