Skip to content

Keep a seated diff comment box's words where its card puts them, and test both comment boxes' words from their card's edge - #6874

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-6871
Nov 23, 2026
Merged

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

Conversation

@leaf-agent

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

Copy link
Copy Markdown
Collaborator

This PR measures where each comment box's words start and end from its card's outer edge. Measured that way, the journey found a seated box in a diff standing its words 4px off its card's, which this PR fixes in response.css. It also updates the nightly test #6871 reported, which still read the alt+click box's geometry from before #6803.

The fix. If an alt+click comment box has been opened earlier in the session, a box later seated in a diff stood its field and words 4px right of where its card puts them: 19px from the card's edge, where the card puts them at 15px under a mouse (20px and 16px under a finger). So Send moved them sideways. The floating box's surface layer (.lf-fab-ground, from box-motion.js) stays in the one native bar when the bar seats. The rule that hides it is in annotation-chrome.css, scoped to .lf-chrome, and doesn't reach a widget's shadow tree. Left in flow, the empty layer took the bar's 4px gap before the field. response.css now hides it in the seated presentation.

Seated diff comment box, mouse, light, after an alt+click box was opened (before → after):

before after

The test. test_response_and_message_reading_keep_their_face_across_shadow_seating compared the two boxes' field padding after subtracting the frame, so a change to the seated card's own inset could move its words with no compared value changing. It now reads each editor's text start, end and top from its card's actual outer edge. For the floating box that is the frame .lf-compose-field; for the seated box it is the bar, which stands where its card will. Start and end must match between the two boxes, before and after typing. In the block direction, the floating frame also runs over the card's edge and padding above the field, so its words stand the frame lower (frame + 12) than the seated box's (12, the author's inset). The mouse/touch parameters, the author's inset and action overrides, the ::after forced-colors ring, and the Markdown reading checks are unchanged.

Verified with uv run pytest --run-nightly <node-id> -n0:

  • Both parameters fail on main at 1bf9209 with the issue's (18.0 + 1) == 12.
  • With only the test change, both fail on the 4px shift: {'start': 19, …} == {'start': 15, …}.
  • With the CSS fix, both pass.
  • Widening the seated card's padding by 2px also fails both.

The focused browser tests for seated diff threads and inline comments pass as well.

Closes #6871 — automated triage

…ame #6803 gave it

#6803 made the floating comment box the frame of the card it becomes: its
field takes the card's padding and one-pixel edge (`--lf-thread-frame`)
inside its own padding, and its focus ring moved to a `::after` box over
the field so an error about the box can't cover it. The seated (inline)
box keeps the card's padding and wears its ring as before.

test_response_and_message_reading_keep_their_face_across_shadow_seating
still read the old geometry: it expected the floating field's padding to
be the author's 12px text inset alone, looked for the ring only on the
field and its frame, and held the seated box to the floating box's raw
padding. It now takes the frame off the floating box's padding before
comparing, and also reads the frame's `::after` for the ring. What it
protects is unchanged: the author's inset and action overrides reach both
boxes, including one seated in a widget's shadow tree, and both boxes put
their words in the same place with the same ring.

Closes #6871
@max-sixty

Copy link
Copy Markdown
Owner

@leaf-agent The updated framed(face(floating)) == face(inline) comparison still misses a visible regression: it subtracts 1 + --lf-thread-pad from the floating field's computed padding, but never measures the seated card's actual padding or border. If that card's outer inset changes, its words move while every compared field value stays the same and the test passes. Please compare each editor's text start relative to its actual outer card edge, while keeping the mouse/touch and focus-ring coverage.

This was written by Codex on behalf of max-sixty

…ted box's words where its card puts them

The diff-controls journey compared the floating and seated boxes' field
padding after subtracting the frame, so a change to the seated card's own
inset moved its words without changing any value it read. It now measures
where each editor's words start and end from its card's outer edge (the
floating frame, `.lf-compose-field`, and the seated bar), keeping the
mouse/touch parameters and the forced-colors ring.

Measured that way, a seated box opened after an alt+click comment box stood
its words 4px right of where its card puts them (19px from the card's edge
against the card's 15px under a mouse; 20px against 16px under a finger), so
Send moved them sideways. The floating box's surface (`.lf-fab-ground`,
box-motion.js) stays in the one native bar when it seats, and the rule
hiding it lives in annotation-chrome.css, scoped to `.lf-chrome`, which
doesn't reach a widget's shadow tree. In flow, the empty layer took the
bar's 4px gap before the field. response.css now hides it in the seated
presentation.

Co-Authored-By: Claude <[email protected]>
@leaf-agent leaf-agent changed the title test: read the alt+click comment box's insets and focus ring through the frame #6803 gave it Keep a seated diff comment box's words where its card puts them, and test both comment boxes' words from their card's edge Nov 23, 2026
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Done in 95b8590. The test now reads where each editor's words start, end and begin vertically, measured from its card's actual outer edge. For the floating box that edge is the frame .lf-compose-field; for the seated box it is the bar, which stands where its card will. The mouse/touch parameters and the ::after focus-ring check are unchanged.

Measuring that way caught the regression you described. If an alt+click box has been opened earlier in the session, a box seated in a diff stood its words 4px right of its card's: 19px from the edge against the card's 15px under a mouse, and 20px against 16px under a finger. The floating box's surface layer (.lf-fab-ground) stays in the bar when the bar seats. The rule hiding it is scoped to .lf-chrome and doesn't reach the diff's shadow tree, so the empty layer took the bar's 4px gap before the field. response.css now hides it in the seated presentation. Before and after captures are in the description. The test fails without the CSS fix, and it also fails if the seated card's padding grows by 2px.

@leaf-agent
leaf-agent merged commit f5cf981 into main Nov 23, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6871 branch November 23, 2026 15:58
leaf-agent added a commit that referenced this pull request Nov 24, 2026
#7026)

`test_response_and_message_reading_keep_their_face_across_shadow_seating`
still expected a seated diff comment box's draft to end its words at the
floating box's end inset (15px under a mouse, 85px under a finger). That
expectation predates #6831, which ends a seated box's words where its
sent message's will, at `--lf-comment-text-end` inside the seat's card
column (`surfaces.css`, `[data-lf-thread-surface] > .lf-fab-bar
leaf-text.lf-fab-input`). In this test's 874px diff row that puts the
end 296.77px from the bar's edge. #6874 fixed the test's earlier
assertions, and that let it reach this one. The product does what #6831
intended: under a mouse, the seated draft and the message it sends both
end their words 296.766px from the card's edge.

The test now checks the seated draft's start and top against the
floating box, and its end against the sent message's words in the seated
card. The test's author override also had to cover the seat itself
(`[data-lf-thread-surface]`). Core declares `--lf-compose-action-inset`
and `--lf-comment-text-end` there (`response.css`), and the card
inherits them. Without that, under a finger the override reached the box
but not the card, and the two ended 26px apart only because of the
test's own styles.

Both parameters, `[False-light]` and `[True-dark]`, fail on `main` at
e80dd78 and pass with this change. This is a `journeys` test, so the
PR's CI doesn't run it. The next scheduled `ci` run on `main` is the
check after merge.

Closes #6871 — 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.

test_response_and_message_reading_keep_their_face_across_shadow_seating: expects the alt+click comment box's padding from before #6803

2 participants