Skip to content

Let a key go of focus the user can't see, and read where they are by one rule - #5468

Merged
max-sixty merged 10 commits into
mainfrom
agent-acb5b884bf9c39a8b
Nov 5, 2026
Merged

max-sixty merged 10 commits into
mainfrom
agent-acb5b884bf9c39a8b

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

The last step of the cutover to one way to know what's on screen. The user's decision (2026-11-04): a key pressed while the focused place is off screen lets go of it first, and every key then acts from what the user sees. Accepted: after such a key, scrolling back doesn't bring the place's keys back until the user clicks or Tabs there, and Tab goes on from what they're reading.

The rule is that focus is where the user is while they see it, else what is on screen.

  • focusPlace (user-place.js) answers whether focus is where the user is. It is while any of focus, or the box it stands at (standsAt: a thread's reply box, a shelf proxy's block), is in front of them, or while a running motion carries them to it: a glide, or a finite animation that moves a box holding it, as a board card's slide. A control in a stuck box counts unless something inside that box clips it away or it stands beside the window, and a row scrolled out of a chrome list counts while the list shows. It replaces focusedInView and focusScrolledAway with its settle flag.
  • keyboard/controller.js lets go (letGo, not Escape's release, so a card open beside the control stays open) before any other keydown listener of Leaf's reads the key. Escape, a key typed into a text field and a lone modifier keep the control; Tab types nothing, so it lets go of a field too. The key then stops at the document, so a listener on the control or a widget around it doesn't hear it, and Leaf's own command for it runs from there. A script's own listener on the document or window hears that one key only in capture; module-input.md says so. Chromium applies a radio's, slider's or select's own keys at the control the key was aimed at after focus moves, so those are withheld in every engine, and that one press scrolls nothing (notes/browser-support.md).
  • reading-place.js pageReadingBlock is what the user reads otherwise: the block across their column (readingBlock now takes the pointer's or focus's column, as capturePlace does), else, on a screen with no text block, what stands at the reading line, so a walk and a let-go start there rather than at the page's top. A key at focus the user can't see names no place (declareFocusPlace), so the pointer's column stays theirs for the let-go.
  • Readers outside a key read the same rule: capturePlace, readerColumn and three readers in version.js ask focusPlace (a stuck focus still names no reading place); focusedPlace in composing/surface.js does, for where c goes (Show where c goes before the press, and stop it following focus out of sight #5428), with user-place.js still repainting at a scroll's end while focus is on a control; a let-go of something the user can't see leaves no walk origin (current-target.js); a tally's Next counts from the block read in its region.

Deleted: the dispatcher's scope filter (#5192), the command hints' scrolled-away repaint, focusScrolledAway's settle flag, focusedInView, and the dispatcher's dependency-cruiser closure entries they needed.

Measured on a shot's view radios on release-notes, scrolled 1,100px past the shot, both engines: Space stayed on the radio and paged nothing on main, and now pages on. ArrowRight changed the view out of sight and moved the page 363px on main, and now changes nothing and moves nothing.

Fixed where the let-go exposed them:

  • reading-regions.js: focus on the body named the page as the region the user reads since Let a page's header, nav and footer stand beside main #5228, so u and d after a let-go, or after a click on a pane's words, scrolled the page instead of the region last acted in.
  • off-flow.js: Tab reaching a card the page carried away brings the card back, since Firefox can't reveal a control in a fixed box and the next key would let go.
  • heading-links.js reads the current location once the script ends, so a let-go's passing focus on a heading writes nothing.
  • focus.js letGo blurs what held focus after its landing, since inside a modal dialog the page is inert and takes no focus.

Behavior changes, by test:

  • test_r_leaves_a_thread_the_user_scrolled_away_from: r away now takes focus out of the card, which stays open; back in view the open card is the conversation the page shows, so r resolves it.
  • test_digits_leave_an_obligation_the_user_scrolled_away_from: back in view the digits stay gone and 2 chooses nothing until m and Tab return to the ask.
  • test_a_thread_walk_card_leaves_and_returns_with_its_anchor: c after the g that let go of the card opens the page's field, not the card's reply; a click on the card's words and c reach the reply, and Tab from it still brings the card back.
  • test_c_travels_to_an_item_its_own_scroller_has_taken_away, renamed test_c_leaves_an_item_its_own_scroller_has_taken_away: c at a card a board carried away opens the page's field and leaves the board where it was scrolled; the sliver case focuses the card, which shows, rather than its cut-off link.
  • test_a_crowded_outline_keeps_the_reading_position_when_it_fits_again: Tab from a contents link scrolled out of its outline goes on from what the user reads, so the test scrolls back to the link first.
  • test_vertical_landing_crosses_a_quarter_turn_without_changing_horizontal_reading: g z with focus off screen aligns what the user reads, so the start case lands the target through scrollIntoView as the nearest case does.
  • test_restore_selection_failed_datum_hydration_leaves_history_untouched: the page's field wears c once the key let go of the line scrolled away.
  • test_sample_file_editor_resize_keeps_classic_scrollbars_inside_its_document: F2 pressed with the editor scrolled out of its sample lets go of the editor, and the sample's own listener now captures to hear that key.
  • test_merge_film_inspection_has_touch_and_keyboard_routes: the step pressing i on Next after scrolling it away is gone, since that key now lets go.
  • Setup only, focus now where the user sees it: the scroller-edge ring test (a taller window, focus by focus()), the seated-reply c test (a longer thread), the staged-controls test (summary clear of the panel) and the native-row test (an owner with a box).
  • Runtime: unseen-focus.test.mjs mounts the keyboard and checks the let-go, what hears its key, the arrow withheld at an unseen radio, Escape's step and a field's Enter; user-place.test.mjs checks focusPlace (a stuck heading now counts; a running slide carries, and an endless animation, a fade, a paused slide and a pseudo-element's slide don't); dom.mjs drops inView.
  • Added, both engines: test_a_key_at_a_control_scrolled_away_acts_from_what_the_user_reads (Enter, an arrow, End at a select, Space, and Tab from a link and a text field), test_a_key_at_a_control_out_of_sight_in_a_fixed_box_lets_go_of_it (a fixed box's scroller, beside a narrower window, inside a modal), test_tab_at_a_control_scrolled_away_goes_on_in_the_column_the_pointer_is_in (from a button and a field) and test_tab_reaching_a_card_the_page_carried_away_brings_it_back.
  • test_motion_preference_changes_are_heard_without_reloading failed about one run in five: a glide shares a frame the page already asked for (rendering.js), so with one pending when the test replaced requestAnimationFrame it recorded nothing. It now waits for the page to render first, and passed 14 of 14.

Left as main has it: a same-origin Leaf frame scrolled entirely off the outer page still takes its keys, since a frame reads only its own viewport. A control in a stuck box is on screen, so a key acts there: after pressing a depth on a sticky lf-dial and reading on, Space stays with the radio, as focus on any sticky toolbar's button does in a browser.

Two independent reviews ran; each case they confirmed against main that this change moved, or that departed from the decision, is fixed here with a test.

Runtime +284 −157, net +127, against the prototype's +43: the fixes above and the header prose that records them. Tests +429 −94.

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

…one rule

The user's decision (2026-11-04): a key pressed while the focused place is off
screen lets go of it first, and every key then acts from what the user sees.
Accepted: after such a key, scrolling back doesn't bring the place's keys back
until the user clicks or Tabs there, and Tab goes on from what they're reading.

The rule: focus is where the user is while they see it, else what is on screen.

- `user-place.js` `focusPlace` answers whether focus is where the user is: any of
  it, or the box it stands at (`standsAt`: a thread's reply box, a shelf proxy's
  block), is in front of them, or a motion under way carries them to it (a glide,
  or a finite animation of a box holding it, as a board card's slide). A control in
  a stuck box counts, measured against the window and the chrome only; a row
  scrolled out of a chrome list counts while the list shows. It replaces
  `focusedInView` and `focusScrolledAway` with its settle flag.
- `keyboard/controller.js` lets go (`letGo`, not Escape's release, so a card open
  beside the control stays open) before any other keydown listener of Leaf's reads
  the key. Escape, typing into a text field and a lone modifier keep the control.
  Chromium applies a radio's, slider's or select's own arrows at the control the
  key was aimed at after focus moves, so those are withheld in every engine
  (`notes/browser-support.md`).
- `reading-place.js` `pageReadingBlock` is what the user reads otherwise: the block
  across their column (`readingBlock` now takes the pointer's or focus's column, as
  `capturePlace` does), else, on a screen with no text block, what stands at the
  reading line, so a walk and a let-go start there rather than at the page's top.
- Readers outside a key read the same rule: `capturePlace`, `readerColumn` and
  three readers in `version.js` ask `focusPlace` (a stuck focus still names no
  reading place); a let-go of something the user can't see leaves no walk origin
  (`current-target.js`); a tally's Next counts from the block read in its region.

Deleted: the dispatcher's scope filter (#5192), the command hints' scrolled-away
repaint, `focusScrolledAway`'s settle flag, `focusedInView`, and the dispatcher's
dependency-cruiser closure entries they needed.

Fixed where the let-go exposed them:
- `reading-regions.js`: focus on the body named the page as the region the user
  reads since #5228, so `u` and `d` after a let-go, or after a click on a pane's
  words, scrolled the page instead of the region last acted in.
- `off-flow.js`: Tab reaching a card the page carried away brings the card back,
  since Firefox can't reveal a control in a fixed box and the next key would let go.
- `role-button-press.js` presses an offer only while it holds focus, and
  `tabFromBlock` steps from its block only while its control does, as native
  controls do once a key's listener moves focus.
- `heading-links.js` reads the current location once the script ends, so a
  let-go's passing focus on a heading writes nothing.

Behavior changes, by test:
- `test_r_leaves_a_thread_the_user_scrolled_away_from`: `r` away now takes focus
  out of the card, which stays open; back in view the open card is the
  conversation the page shows, so `r` resolves it.
- `test_digits_leave_an_obligation_the_user_scrolled_away_from`: back in view the
  digits stay gone and `2` chooses nothing until `m` and Tab return to the ask.
- `test_a_thread_walk_card_leaves_and_returns_with_its_anchor`: `c` after the `g`
  that let go of the card opens the page's field, not the card's reply; a click on
  the card's words and `c` reach the reply, and Tab from it still brings the card
  back.
- `test_c_travels_to_an_item_its_own_scroller_has_taken_away`, renamed
  `test_c_leaves_an_item_its_own_scroller_has_taken_away`: `c` at a card a board
  carried away opens the page's field and leaves the board where it was scrolled;
  the sliver case focuses the card, which shows, rather than its cut-off link.
- `test_a_crowded_outline_keeps_the_reading_position_when_it_fits_again`: Tab from
  a contents link scrolled out of its outline goes on from what the user reads, so
  the test scrolls back to the link first.
- `test_vertical_landing_crosses_a_quarter_turn_without_changing_horizontal_reading`:
  `g z` with focus off screen aligns what the user reads, so the start case lands
  the target through `scrollIntoView` as the nearest case does.
- `test_restore_selection_failed_datum_hydration_leaves_history_untouched`: the
  page's field wears `c` once the key let go of the line scrolled away.
- `test_sample_file_editor_resize_keeps_classic_scrollbars_inside_its_document`:
  F2 pressed with the editor scrolled out of its sample lets go of the editor.
- `test_merge_film_inspection_has_touch_and_keyboard_routes`: the step pressing
  `i` on Next after scrolling it away is gone, since that key now lets go.
- Setup only, focus now where the user sees it: the scroller-edge ring test (a
  taller window, focus by `focus()`), the seated-reply `c` test (a longer thread),
  the staged-controls test (summary clear of the panel) and the native-row test (an
  owner with a box).
- Runtime: `unseen-focus.test.mjs` mounts the keyboard and checks the let-go, the
  arrow withheld at an unseen radio, Escape's step and a field's Enter;
  `user-place.test.mjs` checks `focusPlace` (a stuck heading now counts, a glide or
  a finite animation carries, an endless one doesn't); `dom.mjs` drops `inView`.
- Added: `test_a_key_at_a_control_scrolled_away_acts_from_what_the_user_reads`
  (Enter, an arrow, Space and Tab, both engines) and
  `test_tab_reaching_a_card_the_page_carried_away_brings_it_back` (both engines).

Left as it was: a widget's own keydown listener on the control still hears the
key that lets go, so a Web Awesome radio group scrolled away (`lf-dial`, shot
views, `lf-trace`) still chooses on an arrow and keeps Space, as on main. Stopping
the key at the document would end that, and every page script's own document or
window listener would miss that key.
… a select's keys, the pointer's column

From review of the let-go:

- A control in a stuck box counted as where the user is by its raw box, so one the fixed box's own scroller had taken out of sight still took keys (`2` chose an option on head, nothing on main). `focusPlace` now asks what clips the control out to the stuck box first.
- Every finite animation of a box holding focus counted as carrying the user there, an opacity fade or a paused slide included, which kept an unseen control's keys for as long as it lasted. Only a running animation that moves the box counts now.
- A select's Home, End and page keys still changed its value after the let-go, in both engines. They are withheld as its arrows were.
- A key at off-screen focus set the place input to focus before the let-go read it, so Tab with the pointer resting in a second column went on from the first. A key pressed at focus the user can't see now names no place (`declareFocusPlace`).

`test_tab_reaching_a_card_the_page_carried_away_brings_it_back` now waits for the card's return to settle before its second Tab, which failed about 1 in 25 in Firefox.
A key pressed at a control the user has scrolled away from let go of the control,
but a listener on the control still heard it. A Web Awesome radio group out of
sight took focus back on Space, so the page didn't move, and chose on an arrow.

The let-go's capture listener now stops the key. A listener on the control or a
widget around it doesn't hear that key, and a page script's listener on the
document or window hears it only in capture. Leaf's own command still runs: the
capture listener for characters shares the node, so the stop doesn't skip it, and
any other key's dispatch, which would have run in the bubble pass the stop skips,
runs from the let-go. The browser's default still runs from where focus landed, and
the arrows withheld at a radio, slider or select stay withheld.

Measured against the previous commit in Chromium and Firefox, on a shot's view
radios and on a dial with its stick taken off: Space pages on from what the user
reads, an arrow changes nothing, focus goes to the body, and a page's document
listener misses that key's keydown and hears the next key's. That key's keypress and
keyup still reach the document and window, aimed at where focus landed.

Deleted: the two gates the previous commit added because a let-go key still reached
them, `:focus` in `role-button-press.js` and `currentLocationIn` in `tabFromBlock`.

Left as it was: `lf-dial` as shipped sticks at the window's top, so `focusPlace`
reads it as where the user is and no let-go fires. Space keeps the radio there.

Behavior changes, by test:
- `test_sample_file_editor_resize_keeps_classic_scrollbars_inside_its_document`:
  the F2 that lets go of the editor no longer reaches the sample's bubble listener,
  which left the test's first resize undone with every assertion still passing. The
  sample's listener now captures, and the test asserts that F2 resized the editor.
- `unseen-focus.test.mjs`: the key that lets go reaches neither a listener on the
  control nor a bubble listener on the document, a page command on a key that isn't
  a character still runs, and the next key reaches the document.
…ab from an unseen field

From review of the stop and the stricter reading:

- A let-go inside a modal dialog landed on the inert page, which takes no focus, so focus stayed on the hidden control and its command ran (0 runs on main, 1 here). `letGo` now blurs what held focus after its landing.
- A fixed control left beside a narrower window still counted, since the walk out to the stuck box stops short of the window and `inFront` cuts only top and foot. `focusPlace` now checks the sides.
- A pseudo-element's transform on an ancestor no longer carries focus, since it moves no box.
- Tab from a text field the user scrolled away from went to the field's old neighbour and moved the page 2,374px, as on main. Tab types nothing, so it now lets go and goes on from what they read, as the decision says.

`test_motion_preference_changes_are_heard_without_reloading` failed about one run in five: a glide shares a frame the page already asked for (rendering.js), so with one pending when the test replaced `requestAnimationFrame` it recorded nothing. It now waits for the page to render first, and passed 14 of 14.
# Conflicts:
#	browser/runtime/keyboard/command-hints.js
#	browser/runtime/keyboard/dispatch.js
#	browser/runtime/user-place.js
#	tests/browser/navigation/test_commenting.py
leaf-agent
leaf-agent previously approved these changes Nov 5, 2026
Comment thread browser/runtime/keyboard/controller.js Resolved
A character typed into a field read seenRect twice, in the let-go's check and the place input's, where main read none. Both now ask whether the field types first.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the newest commit, a Tab from a text field the user has scrolled away from no longer follows the pointer's column. Details and a fix are inline.

Comment thread browser/runtime/focus.js Resolved
The keystroke fix named focus as the place for every key into a field, Tab included, so a Tab that let go of a field scrolled away went on from the first column rather than the pointer's. The column test now runs from a field too; without this it fails in both engines.
@max-sixty
max-sixty merged commit b5f5c5d into main Nov 5, 2026
5 checks passed
@max-sixty
max-sixty deleted the agent-acb5b884bf9c39a8b branch November 5, 2026 10:42
max-sixty added a commit that referenced this pull request Nov 5, 2026
#5468 landed the same body-focus predicate for userReadingRegion and pageReadingRegion,
as a local focusInPage in reading-regions.js, and its own fix to the motion test. This
keeps main's motion test, and keeps one focusInPage, in passages.js with main's wording,
since version.js's place recorder, which main left on inPage, reads it too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
max-sixty added a commit that referenced this pull request Nov 5, 2026
… focusInPage one home (#5425)

A key pressed with focus on the body, which is where focus stands after
a click on words or a wheel, no longer records a place for the page.
That place outranked the one the reader made in a pane, so a window
narrowed afterwards left them at the top of the page rather than on the
paragraph they had read. Recording it on every keydown also cost 303.8
ms per key on a workspace of 801 panes.

Refs #4062. That issue's fresh-load gap, where the keys move nothing
before the user acts in any pane, stays open here; choosing a pane for
the user is proposed separately in #5456.

## Cause

#5228 widened `pageDocument()` from `main` to `body`, so
`inPage(document.body)` became true. The browser gives the body focus
whenever focus stands on nothing. Three readers asked whether focus
stands in the page, and each then answered yes. #5468 fixed two of them,
`userReadingRegion` and `pageReadingRegion`, with a local `focusInPage`
in `reading-regions.js`, and fixed
`test_motion_preference_changes_are_heard_without_reloading` too. The
third, `recordCurrentLocation` in `version.js`, still reads `inPage` on
`main`.

## Change

`focusInPage` moves to `passages.js`, beside `inPage`, and all three
readers import it: one home for the question, with #5468's wording.
`browser/AGENTS.md`, "One answer for each question", names it.

## Evidence

A wheel in a pane, a key, then a window narrowed to 520 px, in Chromium:
on the parent of #5228 and on this branch the page returns to the
paragraph the reader had reached (`scrollTop` 941). With `inPage` back
in the recorder it stays at 0.

Keydown dispatch for a key pressed with focus on the body, on a
workspace of N panes, in ms. The `main` figures are one run at
22accdd, and this branch's the range over three rounds before the
merge:

| Panes | `main` | This branch | Only the recorder back on `inPage` |
| ----- | ------ | ----------- | ---------------------------------- |
| 51    | 2.7    | 0.4 to 0.8  | 2.6                                |
| 201   | 21.6   | 1.0 to 1.3  | 23.8                               |
| 801   | 303.8  | 1.4 to 1.9  | 310.1                              |

On `main`, four times the panes cost 8 to 14 times as much per key,
which root `AGENTS.md`, "Responsiveness", rules out. The last column
shows that the recorder alone holds that cost. I measured `k` and `j`;
the recorder runs on every keydown, so I expect the same of other keys,
but did not measure them.

## What I ran

On the merge with b5f5c5d:

-
`test_a_key_pressed_with_nothing_focused_keeps_the_place_read_in_a_pane`
passes here, and fails on `main`'s runtime with `assert 0 > 0`.
-
`test_a_wheel_or_a_press_on_words_gives_a_pane_the_reading_keys_and_the_walk`
passes here and on `main`'s runtime. #5468 fixed the readers it holds,
so it now guards them.
- `test_motion_preference_changes_are_heard_without_reloading` passes.
Before the merge, the 46 tests by node id that press a reading key, read
the region answer or restore a place all passed at two workers.
- `pnpm run test:runtime` (815 passed) and `pnpm run check:browser`.


`test_a_click_on_a_panes_words_makes_it_the_subject_of_every_scroll_key`
fails here and on `main`'s runtime alike: the resting "Comment on pane ·
Left reading" button that #5428 added covers `#right-start`, so the
click never lands.

I did not run WebKit, or `leaf page check --render` over the corpus. The
change adds no work on the startup path.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 5, 2026
`test_a_side_list_is_a_queue_beside_the_item_it_opens` failed in every
scheduled run since 2026-11-03 because its last step pressed ArrowDown
on a tab the test had scrolled out of sight. Since #5192, and as #5468
now states (`browser/runtime/keyboard/controller.js` header), a key at a
control the user can't see lets go of it first and acts from what they
see, so focus landed on `body` and Ticket c was never selected. The
step's purpose is to show that a tab switch in a scrolling root set
keeps the page's scroll position; it now scrolls the page to 12px short
of the panel's top with both tabs in view, then walks to Ticket c and
asserts `scrollTop` is unchanged. A switch that jumped to the page's top
or to the panel would still fail it.

#5468 updated the tests it moved, but this journey runs only nightly, so
its pull request CI never reached it. No runtime behavior changes here:
the walk from an off-screen tab is a gesture #5468 deliberately stopped
honoring, and the repair keeps that decision.

Verification: on `main` the test fails locally at line 276
(`aria-selected="false"` on Ticket c). A probe showed focus on Ticket b
before the press and `letGo` (`focus.js`, called from the controller's
capture listener) moving it to `body`. With this change the test passes
in three local `--run-nightly` runs.

Closes #5461 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 5, 2026
Travel and the walks land a destination at its start or centre, but
since #5361 they decided whether to land by asking `alreadyShown`, which
asks whether a *nearest* landing would move nothing. A nearest landing
moves nothing for a box taller than the window that already fills it. So
`t` to a thread on a long section the user is reading inside, and a diff
file chosen in its tree after reading down, stopped bringing in the
destination's opening. Before #5361, `readableDestination` always landed
a tall destination's opening. #5361's description lists no such change,
and two tests that protect it went red.

`alreadyShown` now takes the `block` of the landing that follows. A box
taller than its room counts as shown only where that landing would move
nothing. Travel's start and centre gates, its departure plan, the queue
walk and the change walk pass their block. Every nearest caller (Tab
arrivals, entering a reply, returning to a thread, `scrollIntoView`'s
own nearest check) keeps today's answer. For a box that fits its room,
the block changes nothing.

This fixes three of the seven tests #5486 tracks. Each fails on `main`
(`19e31482b`) and passes here:

-
`test_render_aim.py::test_a_pointed_comment_keeps_the_rows_still_owed[thread]`:
`t` lands the thread's section at its top again.
-
`test_render_diff_controls.py::test_file_tree_lands_at_the_file_start_after_reading_down[pane]`
and `[document]`: choosing a file in the tree lands its first line
again.
-
`test_current_location.py::test_the_obligation_walk_keeps_its_place_when_a_version_lands`:
a test-only change. Its 400px window left the decision the user stands
on taller than its room and under the floating panel. It passed before
#5361 only because that hid the decision, so the version's restore
didn't land it. Since #5468 a key lets go of a focused control the user
can't see, so that setup tests something else. At 600px the decision
fits and stays on screen with the earlier obligation's words above it,
which is the case the test describes. It still tells the kept walk place
from the viewport's reading, since a walk from the reading block would
step to `t-baffles`, not `t-bath`.

**Verification.** `pnpm run test:runtime` (819) and `check:browser`
pass. The landing change also ran with `test_obligation_walk.py`,
`test_threads.py`, `test_render_navigation.py`,
`test_render_diff_controls.py`, `test_render_aim.py`,
`test_current_location.py`, `test_reading_place.py`,
`test_changes_in_place.py`, `test_seated_threads.py` and
`test_go_to.py`. Every failure there also fails on unchanged `main`.

#5551 fixes three of the other four tests, through the floating panel's
cover. The last one,
`test_sample_host_view_changes_leave_its_scroll_and_keyboard_position`,
stays open on #5486.

Refs #5486 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 6, 2026
…stop above the view (#5587)

Two On me grouping tests have failed on main since #5468 (bisected from
#5331's passing head to `b5f5c5d43`). #5468 made a key pressed at focus
the user can't see let go of it and act from what they read. Both tests'
page fits a 1440×900 window, so the walk's second `m` lands the Rollout
ask (y 506–643) under the open On me view (y 381–802), with no room to
scroll it clear. The next `m` then lets go and steps from the reading
position, wrapping to the first Options card instead of reaching the
thread's Reply. Both tests now open a 1400px-tall window, which puts
every stop above the view, so they go back to checking the grouping and
walk order they cover.

This changes only the test setup, and the tests' assertions and #5468's
rule stay as they are. A short page still walks round a subset of the
list while the view covers a stop, as it does on main now. That is a
product question for #5586: give the body end room for the open view,
count a stop the walk just reached as the user's place, or accept the
behavior.

Verified locally: both tests fail on `main` (`d133d573a`) with the
errors in #5534 and pass on this branch, three runs before the rebase
and one after it.

Closes #5534 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…sed (#5667)

`test_a_refused_position_reconciles_the_logged_order_of_sibling_units`
has failed on main since #5468. Under #5468 a key lets go of focus the
user can't see, and a motion counts as carrying the user to focus only
while it is running (`user-place.js`, `carried`). The test holds every
gesture animation paused at its first frame (`HOLD_MOTION`). After
ArrowRight moves the heater card to Done, the board shrinks (its bottom
moves from 271 to 217 px), while the paused slide keeps the card's grip
at 219 to 247 px, outside the board's clip. So `focusPlace` returns
null, and the dropping Enter lets go of the grip instead of sending the
move. The test then times out waiting for `/api/event`.

The grip is on screen when the test focuses it and when it presses the
first Enter. The off-screen state comes only from the paused frame: a
real slide is either running when the user presses Enter, so `carried`
holds focus, or already finished with the card in view. So the repair
goes in the test, and #5468's rule stays. Before the drop, the test now
plays the held slide at a playback rate of 1e-6, so Enter lands
mid-slide as a user's would and the slide is still running when the
refusal cancels it. The test's positive control, which checks that the
heater card's animation was cancelled, still holds.

The test fails on main at `1ccf6cc04` (the 120 s timeout from the
report) and passes four times in a row with this change. No product code
changes.

Closes #5646 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit that referenced this pull request Nov 7, 2026
…ws it (#5676)

With On me open, `m` from the last item it lists walked back to the one
before it instead of coming round to the first. The test
`test_the_m_walk_brings_its_card_into_on_me_s_view_and_rings_it` failed
this way on every `ci` push run on main since `6b3159dd6`. Two rules
collide. On me stays open over a stop it lists, because its ringed card
shows that item
([`clearFor`](https://github.com/max-sixty/leaf/blob/b366a8794997f43eb5b046869b98b07aef1cdddf/browser/runtime/floating-panel.js#L5030)).
The keyboard controller lets go of focus the user can't see before
acting on a key
([`focusPlace`](https://github.com/max-sixty/leaf/blob/b366a8794997f43eb5b046869b98b07aef1cdddf/browser/runtime/user-place.js#L129),
#5468). A stop at the page's foot can't be scrolled clear of the open
view. So at 1000×560, `#ask-8` (y 251–392) stood wholly under the panel
(y 134–546, x 230–770) with the page scrolled to its end. The next `m`
found focus on `<body>` and stepped from the reading block, an `h2`
inside `#ask-7`, which landed on 7 of 8.

The walked card is now the box the focused stop stands at (`standsAt`),
so focus on the stop counts as where the user is while that card is in
view. `boxStoodAt` now takes the first matching rule that names a box,
so the panel's catch-all rule doesn't affect the thread and shelf rules.
**Behavior changed:** with On me open, a key pressed on the stop `m`
reached acts there while its ringed card is in view, even where the
panel covers the stop.

Verification: the test failed deterministically on this runner before
the change (`m` went 8 → 7 → 8 → 7) and passes after it. 58 focused
tests also pass: `-k "walk or scroll or away or on_me or let"` over
`test_on_panel.py`, `test_obligation_walk.py`, `test_key_scopes.py` and
`test_current_location.py`. `pnpm run test:runtime` passes (896), as do
`check:browser` and pre-commit on the two files.

The commit that tipped the geometry into overlap inside
`53337b5e9..6b3159d` isn't established. The conflict between the two
rules exists whatever the panel's exact size.

Closes #5654 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
Co-authored-by: Claude <[email protected]>
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