Repository navigation
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
Conversation
…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
|
@leaf-agent The updated
|
…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]>
|
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 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 ( |
#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]>
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, frombox-motion.js) stays in the one native bar when the bar seats. The rule that hides it is inannotation-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 4pxgapbefore the field.response.cssnow hides it in the seated presentation.Seated diff comment box, mouse, light, after an alt+click box was opened (before → after):
The test.
test_response_and_message_reading_keep_their_face_across_shadow_seatingcompared 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::afterforced-colors ring, and the Markdown reading checks are unchanged.Verified with
uv run pytest --run-nightly <node-id> -n0:(18.0 + 1) == 12.{'start': 19, …} == {'start': 15, …}.The focused browser tests for seated diff threads and inline comments pass as well.
Closes #6871 — automated triage