Skip to content

fix: choose a comment's side again when its side runs out of room, and carry it from its subject's whole left edge - #7383

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-7380
Nov 27, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-7380

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Two browser tests about a comment box beside words that move sideways have failed on main since #7363. This fixes both in commentPlacement (comment-placement.js) and keeps #7363's intent: a sideways scroll of a box around the log still carries the comment box with its words, on the side it already holds.

A held side is chosen again when it runs out of room. #7363 keyed the fresh side choice on the subject's width instead of its left and right edges, so motion the words share with their box no longer jumps the box. It also stopped the choice when a transform carried the paragraph 600 px toward the right rail, which left the box right-start on a side with no room. choose now also chooses afresh when the room beside the subject on the held side no longer fits the least card width. That is the test commentSide already chose the side by, now shared as besideFits. A sideways scroll that leaves room keeps the side, as #7363 intended.

The carried offset is measured from the subject's whole box. #7363 removed the old edge key, so a box beside a part of a scrolled diagram is no longer placed afresh when the part's left edge slides under its scroller's edge. Its carried offset was measured from clear.left, the clipped edge, which stops moving once clipped, so the box lagged the part by 6 px. The offset is now measured from extent.left, the unclipped box, which moves with its content. Quoted passages still measure from their column. Both callers of options now pass extent.

What a user sees differently from current main:

Nothing else should change. Every other placement keeps its side and offset.

Verification:

Closes #7380 — automated triage

…d carry it from its subject's whole left edge

#7363 keyed `commentPlacement`'s fresh side choice on the subject's width, so a
sideways scroll of a box around the log keeps the side. That also kept the
side when a transform carried the paragraph 600 px toward the right rail,
leaving the box on a side with no room. `choose` now also chooses afresh when
the room beside the subject on the side it holds no longer holds the least
width, the same test `commentSide` chose it by.

Without the old edge key, a box beside a part of a scrolled diagram is no
longer placed afresh as the part's left edge passes under its scroller's edge,
so the carried offset, measured from the clipped `clear.left`, lagged the
part by 6 px. The offset is now measured from `extent.left`, the whole box,
which moves with its content.

Behavior protected: test_a_side_comment_rechooses_its_rail_after_horizontal_target_motion
and test_a_visual_action_follows_its_own_scroller_even_when_the_target_is_gone,
which fail on main and pass here.

Closes #7380
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.

Side-comment rail rechoice and diagram-scroller follow tests fail since #7363 keyed the fresh choice on the target's width

1 participant