Skip to content

fix: seat a diff file's comment box inline when the file's end is below the window - #5496

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-5459
Nov 5, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-5459

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Since #5361, a diff file's Comment opens a floating comment box, not its inline box at the end of the file, whenever the file's end is below the window. #5361 replaced seatFab's question "does a panel stand over this seat?" (underOccluder) with "does the user see this seat?" (seenRect). Its intent was one way to answer "is this in front of the user", and its list of visible changes doesn't include comment boxes. seenRect also cuts at the window's top and bottom, so a seat that is only scrolled out of view now counts as unseen too. In pr-walkthrough, once ] opens a file's hunk, that file's thread outlet sits at y≈914 in a 900px window. The inline seat is refused and the box opens floating. That is the failure test_each_sampled_focus_ring_is_shown_whole_in_its_surface reports (#pr-exact-patch .lf-diff-file-comment did not open an inline response).

seatFab now refuses a seat only where the chrome covers it (covered, the same cover rule seenRect cuts with). A seat under the floating panel's room still sends the box to its home, as #5361 intended. A seat that is only scrolled away takes the box, and the field's focus scrolls it into view, which is what happened before #5361. One behavior moves further than a plain revert would: a seat the chrome covers in part is now refused too, where seenRect accepted any visible part. A box whose seat is half under the panel opens at its home rather than half hidden. Seats inside the panel itself are unaffected, since coverBoxes skips the cover that holds them.

On screen, in the new leaf-dev stills --state diff-file-comment (pr-walkthrough's longest file opened beneath the window's top, then its Comment pressed, 1440×900): on main the box opens floating over the contents column, away from the file; with this change it opens in the file's thread at the file's end, scrolled into view under the file's pinned header.

main this PR
Before: the file's comment box floats over the contents column After: the comment box opens inline at the end of the file

Verification:

  • New test_a_file_s_comment_opens_inline_where_the_file_ends_below_the_window (tests/browser/widgets/test_diffs.py): an 80-line file in a 1200×700 window. On main, no inline composer opens. With the change, the inline composer opens, its field takes focus and is in the viewport.
  • Ran the ring journey restricted to pr-walkthrough. On main it fails with the reported assertion. With the change, every pr-walkthrough scope opens its surface with no ring faults. The only remaining failure is the check that other examples' scopes were reached, which the one-page restriction drops.
  • pnpm run test:runtime (816 pass) and pnpm run check:framework pass. Three tests/browser/test_render_diff_controls.py tests (test_file_tree_lands_at_the_file_start_after_reading_down[document,pane], test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place) fail the same way on unmodified main 018fc2587, so this change doesn't cause them.

This fixes the failure the issue currently reports. The earlier scheduled runs' ring faults (lf-ask.lf-projected-location rings 5px past the window, runs 41816958231 and 41622727492, both before #5361) are a separate cause that #5432 bears on. So this PR refers to the issue and doesn't close it.

Refs #5459 — automated triage

…ow the window

#5361 replaced the response bar's seat refusal, "a panel stands over this
seat" (underOccluder), with "the user doesn't see this seat" (seenRect).
seenRect also cuts at the window's top and foot, so a seat merely scrolled
away now counts as unseen: a diff file's Comment, whose thread outlet
stands at the file's end, opened a floating box whenever a long hunk left
that end below the window. In pr-walkthrough this made
test_each_sampled_focus_ring_is_shown_whole_in_its_surface fail with
"#pr-exact-patch .lf-diff-file-comment did not open an inline response".

seatFab now refuses only a seat the chrome covers (covered, the cover rule
seenRect cuts with). A seat under the floating panel's room still sends the
box home. A seat scrolled out of the window takes it, and the field's
focus brings it in, as before #5361. Behavior change: a seat the chrome
covers in part is refused too, where seenRect accepted any visible part.

Refs #5459
`diff-file-comment` opens pr-walkthrough's longest file beneath the window's
top and presses its Comment, so the file's end, where the box seats, starts
below the window. On the base the box opens floating over the contents; with
this branch it opens in the file's thread and its focus brings it into view.
@leaf-agent
leaf-agent merged commit 75cd152 into main Nov 5, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5459 branch November 5, 2026 13:18
leaf-agent added a commit that referenced this pull request Nov 5, 2026
…ring probe (#5497)

#5230 made visual review's "Looks right" checkbox a `.choice`, and a
choice's label wears the focus ring for its input (`:is(.lf-choice,
.choice):has(> input[data-lf-focus-visible])` sets `--lf-wears-ring: 1`,
`browser/styles/components/controls.css`). The ring is painted on the
label, but the test probe's `carriesFocus`
(`tests/page_scripts/focus_rings.js`) didn't recognise that declaration,
so it marked the label's ring as not the focused control's and
`current_location_ring` returned `None`. `ringsDrawn` now credits the
box the runtime's `ringBox` (`browser/runtime/focus.js`, exported
through `browser/runtime/check-api.js`) names for the focused control,
so the probe and the runtime share one reading of which box wears a
ring. Only the test probe and the diagnostic check API change; nothing a
user sees changes.

`git bisect run` over the scheduled-run range
`19757c94c59b..8b759a5` found #5230 (`b63836193`) as the first
commit where the journey fails with `the focused destination paints no
keyboard ring`.
`test_an_authenticated_navigation_journey_becomes_credential_free_review_evidence`
(`--run-nightly`) fails on main and passes with this change.

The same step also unblocks
`test_visual_review_keeps_its_inline_comment_editor_in_view_after_phone_resize[600|760]`.
Its earlier `assert_keyboard_focus` calls now pass, and it fails later,
at line 206, with `{'unobscured': False, 'inViewport': False}`. #5475
(#5228) already owns that failure.

<details><summary>Other probe consumers run</summary>

Passed with the change: `tests/browser/controls/test_rings.py`, the rest
of `tests/browser/test_render_visual_review_journey.py`,
`test_a_key_onto_a_control_at_a_scrollers_edge_shows_its_ring`,
`test_escape_on_a_declaring_control_does_exactly_what_it_says`,
`test_a_label_press_keeps_the_controls_current_keyboard_location`, two
`test_render_pages.py` ring tests, and
`tests/journeys/test_render_controls.py` (Chromium). Two tests failed
both with and without the change, so the change didn't cause them:
`test_trace_pointer_annotation_stays_inside_the_panned_image_viewport`
(ring 5px outside the image viewport) and
`test_each_sampled_focus_ring_is_shown_whole_in_its_surface` (the diff
file's inline response, which #5496 targets).

</details>

Closes #5460 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
Since #5496, Add feedback on a visual review case opens no inline
comment box on a 390×844 phone, which is what
`test_visual_review_returns_to_case_feedback_on_phone` reports. The
case's thread outlet is `display: none` while its discussion is empty,
so `seatFab` judges the box that lays it out instead: the whole
`.lf-vr-case` (y 159–1153 in the test). The phone's bottom bar (y
786–830) crosses that box. #5496 made `seatFab` refuse any seat a cover
crosses even in part (`covered`), so the case was refused. Before #5496,
`seenRect` accepted the case's visible top.

A stand-in box only says the editor will land somewhere in it, so
`seatFab` now refuses a stand-in only where a cover crosses it **and**
the user sees none of it. A seat with its own box keeps #5496's rule as
written: refused where the chrome covers any of it, accepted where it is
only scrolled out of the window. So #5496's intent holds: the diff
file's comment box below the window still opens inline, and a seat half
under the panel still sends the box home. The only behavior that moves
is a boxless outlet whose stand-in is partly seen and partly under a
cover. Its box opens inline again, as it did before #5496.

Verification:
- `test_visual_review_returns_to_case_feedback_on_phone` fails on main
`a54c1bcea` and passes with this change.
- #5496's
`test_a_file_s_comment_opens_inline_where_the_file_ends_below_the_window`
passes.
- The composer, comment and feedback tests in
`test_render_floating_panel.py`, `widgets/test_diffs.py` and
`test_render_visual_review_journey.py` (21 selected) pass. So do `pnpm
run test:runtime` (896) and `pnpm run check`.

Closes #5648 — automated triage

Co-authored-by: leaf-agent <[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.

1 participant