Repository navigation
Read arrival at a thread from where the user stands - #1920
Merged
Merged
Conversation
Held thread news showed on arrival only where a route remembered to call `showHeld`: the t/T walk's panel path, `openPageThread`, the panel's `showThread`, `materializeAsk`, and the panel list's title choice. Two different checks kept a route that puts the user back from releasing anything: a `carried` flag threaded through `replyDestination`, `openPageThread`, `showThread` and the panel's continuation, and a `restoringFocus()` test in the title choice. Each new route was one more place to forget. `focus.js` now publishes each change to where the user stands (`onStanding`), with what moved them: `return` for the runtime putting them back or handing them across (a hold restoring, a chrome placement, `returningFocus`, `handBack`, or the platform returning focus from a dialog or popover it closed), `press` for the platform's own focus on the node a press landed on, and `move` for everything else, a key's own move or a route. Each shadow stage reads its own `focusin` (`watchStandingIn`), since a move between two nodes of one shadow tree reaches the document as no event; such a move now also counts as a placement for waiting holds. `held-news.js` subscribes once: coming to stand in a thread from outside it, by a `move` or by a `press` on its title, shows what any seat holds of it. Coming back to the thread the user stood in is a stay, whatever puts them there, and so is any move within it. The release runs inside the `focus()` that moved the user, before the route measures its landing. The call sites, `carried` and the title choice's check are gone. The More menu's hand-back of the focus it borrowed (`restoreBannerStanding`) now goes through `returningFocus`, so it reads as the return it is. `showHeld` stays for a destination that is itself held, a message or an Ask in a held turn, which has no node to focus until it shows. A thread a seat holds whole is the third such destination: `openPageThread` shows it (`showHeldThread`, which shows a seat's held new threads and nothing it holds of threads it draws) where no surface draws the thread, so a t walk to the second thread an outlet holds on a diff line still lands in the outlet (`test_a_walk_to_a_thread_a_diff_line_holds_lands_in_its_outlet`, which opened Threads without it). This reverses the record #1780 wrote in `held-news.js`'s header, that arrival is the routes calling `showHeld`; the header now records the user's decision and the rejected alternative. #1780's record named two gaps in the earlier attempt, and each now has a test: - focus moving inside one shadow tree: the diff-thread read test's new `return` case Shift+Tabs to the file's header and walks back with t, both moves inside the widget's shadow tree, and fails without `watchStandingIn`; - a dialog handing focus back: the new `test_a_dialog_handing_the_user_back_to_a_thread_is_no_arrival` opens and closes the command reference from a thread holding a reply, and failed until a closed layer's own return read as `return`. Behavior that moved: - t/T at the end of the list, onto the thread the user already stands in, is a stay, so its news stays held, with the panel open (`test_walking_to_a_thread_shows_the_replies_it_held[*-onto]`) or shut (`test_replies_held_in_a_page_seat_show_when_the_user_turns_to_them[onto]`). A new `return` case walks back onto a card that stood open throughout, from outside it, and shows its news. - Going to an Ask from inside its own thread is a stay too; the `standing-ask` case now starts with the user standing nowhere. - Focusing a page seat's thread from outside it is an arrival, so the held-reopening test now stands the user in the thread before the reply comes, and `r` there reopens it as before. - A press into a held diff thread's reply box keeps the reply held under it; the test presses rather than focusing from script. - Escape out of a panel card's reply box lands on its title, a move within the thread, so the card keeps holding what it held; a press on the title the user already stands on, and Enter or Space there, show nothing either. The two drafts tests whose panel card held an agent's resolution now press its "Resolved" notice after Escape, as the inactive-agent case did. - A route from a thread's page seat to its panel or margin card is a stay, and the gallery's `showView({thread})`, which takes no focus, shows nothing held. - A t walk to a thread a page seat holds whole lands in the margin card, as on main, and that arrival shows the thread the seat held (`test_a_thread_the_agent_starts_in_a_page_seat_waits_in_the_row_it_would_follow[box-walked]`). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
previously approved these changes
Oct 6, 2026
leaf-agent
reviewed
Oct 6, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The test job is red on this head in two places, so my approval no longer stands. CI log.
test_a_news_resolved_card_keeps_its_place_after_an_offscreen_draft_is_clearedstill expects Escape from the reply box to remove its editor immediately. Under this PR's arrival rule, Escape lands on the same card and leaves its resolution held behind the notice. The test times out waiting forleaf-textto disappear; update that expectation to release the notice before checking removal, as the changed draft tests do.test_the_register_is_the_only_way_a_key_enters_the_runtimefinds the new standalonekeydownlistener infocus.js. The key register contract permits the existing shared input listener, not another global key listener. ClearpressedPaththrough that existing listener so the contract stays intact.
leaf-agent
dismissed
their stale review
October 6, 2026 18:22
CI test job failed: one outdated expectation and a new keydown listener violate the current gate.
…held settlement by its notice in the chrome contract test The key register allows the runtime's existing input listener, not another global keydown listener, so the press path is read and cleared there. Escape out of a resolved card's reply box is a move within the thread, so the card keeps the agent's settlement behind its notice; test_a_news_resolved_card_keeps_its_place_after_an_offscreen_draft_is_cleared now presses the notice before checking the editor is gone, as the drafts tests do. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 6, 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.
Held thread news showed on arrival only where a route remembered to call
showHeld, and routes that put the user back opted out with acarriedflag or arestoringFocus()check. This reads arrival once, from where the user stands.runtime/focus.jspublishes each change to where the user stands (onStanding), labeledreturn(a hold restoring, a chrome placement,returningFocus,handBack, or the platform returning focus from a layer it closed),press(focus landing where the last press was), ormove(a key's own move or a route). Each shadow stage reads its ownfocusin(watchStandingIn, called fromshadowStage), since a move inside one shadow tree reaches the document as no event.thread/held-news.jssubscribes: coming to stand in a thread from outside it, by amoveor apresson its title, shows what any seat holds of it. Coming back to the thread the user stood in, and any move within it, is a stay. The release runs inside thefocus()call, before each route measures its landing.showHeldcall sites,carried, and the title choice's check are gone.showHeldstays only where the destination is itself held (a message or an Ask in a held turn);showHeldThreadshows a thread a seat holds whole where no surface draws it, so a walk to it lands in its outlet.returningFocus.This reverses the record #1780 wrote in
held-news.js(arrival as the routes that callshowHeld), at the user's decision on the held-news case-study page; the header now records the rejected alternative.Behavior that moved: t/T onto the thread the user already stands in, going to an Ask from inside its thread, and Escape out of a panel card's reply box onto its title are stays, so held news stays behind its notice; a press into a thread's reply box keeps what it holds. The commit message lists each with its test.
Tests: the earlier attempt's two gaps each have a test that fails without the fix (an in-stage return in the diff-thread read test, without
watchStandingIn;test_a_dialog_handing_the_user_back_to_a_thread_is_no_arrival, without the closed-layer return), as does the outlet walk (test_a_walk_to_a_thread_a_diff_line_holds_lands_in_its_outlet). Locallytest_render_threads.py,test_render_read_state.py,test_render_drafts.pyandtest_render_reactions.pypass (491), as donpm run test:runtimeand pre-commit; a wider run over navigation, margin, widgets and aim showed only load flakes and two aim failures that fail the same way on main.