Skip to content

Open the comment box slim wherever it stands, widening away from the edge it stands by - #7329

Merged
max-sixty merged 4 commits into
mainfrom
comment-box-width
Nov 27, 2026
Merged

max-sixty merged 4 commits into
mainfrom
comment-box-width

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A comment box left of a wide block, under a whole block, or under words near a line's end opened at the full 592 px card width (480 px where the room capped it), while beside a paragraph it opened at 320 px and widened with its words. The box and card widened only from the edge their words start at, and in those places the placement holds the other edge, so widens (comment-placement.js) sent them to full width at once. Now every box and card widens away from the inline edge its placement holds (holds), so every one opens at 320 px. The widens posture list, data-lf-card-width and its CSS rule, and the read of the writing direction are gone.

To weigh: a box standing by the edge its words end at grows toward their start as its first line grows, so the words before the caret slide while the caret stays put, and such a card's one widening at a long answer moves its words rather than its controls. In a left-to-right page that is a box left of its subject; in a right-to-left page it is every box except one left of its subject, which before this change took full width at once instead. The shift watch's widening credit now accepts either inline edge, and a rise in the same frame only as a message joins the card's transcript. More cards now open slim, so more show what a slim card beside a paragraph already shows on desktop: with Previous and Next in its head, the news count draws cut ("2 …") and the message controls cover the name and time under the pointer. The alternative, a slim box at the far end of its place, keeps words still but stands it up to 272 px from its subject.

Max asked for this on a Leaf page; Codex reviewed it over three rounds. Tests: runtime placement and handoff cases, new browser cases for the left and under postures and the shift-watch bound, the focused send-placement, aim, margin and layout browser tests, and the placement sweep at 1000 px.

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

…edge it stands by

A comment box left of a wide block, under a whole block, or under words near a
line's end opened at the full 592 px card width (480 px where the room capped
it), while beside a paragraph it opened at 320 px and widened with its words.
The box and its card widened only from the edge their words start at, and in
those places the placement holds the other edge, so `widens`
(comment-placement.js) sent them to the full width at once. Max asked why the
box beside a wide playground opened so much wider than beside a paragraph, and
for a fix that removes the inconsistency rather than adds a case.

Now every box and card widens away from the inline edge its placement holds
(`holds`): beside its subject, the edge facing it; under or over, the end of
its measure-wide place nearer the quoted words' first character or the
element's right edge; carried, its left edge; with nothing to stand by, the
room's left edge. So every one opens at 320 px. Under or over, the hold
middleware stands the surface at its held end in either writing direction, and
the capture Send hands the card carries the held edge, so the card keeps it.

What a user sees differently: a box standing by its right edge grows leftward
as its first line grows, so the words before the caret slide left while the
caret stays put, and such a card's one widening at a long answer moves its
words rather than its controls. The shift watch credits a card's widening from
either inline edge, and, for a card standing on its foot, a rise in the same
frame only as a message joins its transcript.

Removed: the `widens` posture list, the `data-lf-card-width` attribute and its
CSS rule, and the read of the page's writing direction.

Tests: a box left of a block and under a whole paragraph opens at the least
width, widens toward its start keeping its right edge, Send keeps its sides,
and a long answer widens the card from that edge under the shift watch
(failing without the watch's credit); a carried box holds its left edge; the
runtime test reads the held edge and spot per posture; the card keeps the
box's held edge after the words scroll sideways; a carried surface whose words
scrolled past the room is capped at the room's width; a rising card's widening
is credited only when a message joins it. The two right-to-left tests and the
measure-at-once test went with the rule they held. The restored-draft lane
test now compares the restored box with the same draft typed. The Send
scoreboard measures a move at the edge the box held; its snapshot is unchanged.
…d's widening by its transcript's growth

The card Send opens keeps the edge the box held where it stood, its right edge
included: the carried offset now names the held edge, so a sideways scroll in
the task that sends no longer moves a right-held card to its place's end. A
left-of-subject card is carried by its right edge the same way rather than
placed again.

The shift watch credits a card that stands on its foot for rising as it widens
only as far as a region it holds that grows at its end grew on screen, so a
hidden child or a rise with no message is reported, and a streaming reply
growing is credited.

Tests: the card keeps a right edge that stood away from its place's end; four
cases of a rising card's widening, two credited and two reported.

@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.

On a right-to-left page, this change makes words slide as the user types in nearly every placement, which the PR doesn't mention. The two right-to-left tests it deletes (test_a_right_to_left_box_keeps_the_start_of_its_words_as_it_fills and its carried-by-the-grip twin) protected that behavior, and nothing replaces them.

holds is chosen with no regard to writing direction. The field's text aligns to start (CSS's default), which is the right edge on a right-to-left page. So there, a surface held by its left edge grows rightward and carries the start of its words with each key. That covers a box right of its text, under or over quoted words near the start of their place, a carried box, and an unanchored one. Before this change, those placements took the measure at once so the words stayed still (widens(scale, rtl)). Only a left-of-text box keeps its words still now.

That may be the price of opening slim everywhere. But the PR body's "To weigh" paragraph, the fit header comment and size-width all describe the cost as belonging to a box "standing by its right edge", which is true only left to right. Either restate the cost as belonging to the edge the words don't start at and name the right-to-left case in the description, so the maintainer weighs it knowingly, or keep the direction read that was removed. The second option would hold the edge the words start at where that edge also faces the subject.

…ipt, and name the right-to-left cost

The shift watch credits a card standing on its foot for growing as it widens
only by the room the children that joined its transcript take after the last
old one, and the growth of a streaming tail, so padding on the transcript or the
card, or a short message with padding past it, is reported.

The placement header, the size-width rule, the card's header and the hold rule
state the cost of widening by the edge a surface's words end at: its right
edge left to right, its left edge right to left.

Tests: two more cases of a rising card's widening, both reported.
… for

The case opened its card under a whole heading, which took the full width at
once and now opens slim like a card beside a paragraph. Its desktop comment is
now long enough to open the card at the measure, where the head keeps its name
and time whole; the finger case still covers a card at its least width.
@max-sixty
max-sixty merged commit aedabee into main Nov 27, 2026
7 checks passed
@max-sixty
max-sixty deleted the comment-box-width branch November 27, 2026 00:17
leaf-agent added a commit that referenced this pull request Nov 27, 2026
…#7348)

#7329 opens every comment box and card at 320 px and widens each away
from the inline edge its placement holds. Its message accepts that a box
held by the edge its words end at grows toward their start. Five browser
tests still asserted the full-width box and have failed on every `main`
run since ([run
45920651738](https://github.com/max-sixty/leaf/actions/runs/45920651738)).
This PR changes only tests, keeping #7329's intent and the behaviour
each test protects:

- **`test_render_aim.py`, the two growing-comment tests.** These now
assert that the box's **held** inline edge stays put as it grows, read
from `floating.js`'s `held` edges. Before, they asserted the left edge.
In both fixtures the box stands by its right edge (708.5 + 320 = 436.5 +
592), so the left edge moves by design.
- **`test_a_caret_is_drawn_at_a_lines_end_and_after_a_list_bullet`, both
engines.** "The box neither narrows to its words nor widens as they
arrive" is now "the box opens slim and widens with its first line, up to
the wrapped measure" (320 → 570.75 → 592 px). The guarantee the subtest
exists for still passes in Chromium and Firefox: a caret at a line's end
paints inside the field (`CARET_ROOM`), at the widened box and at a
narrow window.
-
**`test_a_changed_datum_keeps_its_old_words_open_when_its_label_changes`.**
The relabel must leave the opened quote exactly as it was: still
expanded, the same size, and either whole or scrolling. At 592 px the
12-sentence quote fit whole. In the 320 px card it scrolls inside its
own share (362 px of words in 259 px). `annotation-chrome.css` designs
an opened quote to scroll this way rather than push the reply out of the
card.

`HELD_EDGE` moves from `test_render_send_placement.py` to
`render_cases_interaction.py`, so the aim and send-placement tests read
the held edge through one definition.

**Verification.** Run by node id, all five failed on this base
(`983d688fe`) with the messages in #7347 and pass after the change.
`test_a_box_held_by_its_right_edge_opens_slim_and_widens_toward_its_start`,
whose constant moved, also passes.

**For a reviewer to weigh.** In the datum test the card is capped at
`max-height: 425px` in a 900 px window, so a long opened quote scrolls
even though the window has room below. That cap comes from the card's
placement room, not from #7329. With a 592 px card nobody saw it. I
haven't traced it further, and this PR doesn't change it.

Closes #7347 — automated triage

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Nov 27, 2026
…x from the edge it holds (#7354)

`leaf-dev placement cards` now draws the comment box beside the card
Send opens. When the reader starts a thread, the gallery shows three
tiles: the box as it opens, the box once a long first line is typed, and
the card. Each tile names the edge the surface stands by. A card's tile
flags a fault where it stands by a different edge than its box did, or
opens slim at a different width. Five new cases cover the box's
postures: beside words on either side, under a whole paragraph, over
words at the page's foot, and carried by its grip. So a mismatch like
the full-width box that #7329 fixed now shows as a row in the gallery.

The carried case found a defect in the width rule (comment-placement.js,
`size`). A box dragged from its spot left of a block holds its left
edge, but its width came from Floating UI's available width, which for a
left placement runs leftward. So whether it widened depended on shift
data. In the fixture it reached 515 px at 1728 px and stayed at 320 px
at 1440 px. #7329 already took the lane, measured from the held edge,
for a box under or over its subject. Now every surface does, which drops
that branch.

To weigh: a carried box beside its subject now widens away from its left
edge and may cover its subject, as one above it already did. Before
#7329 it stayed at 320 px and wrapped. The gallery draws that cover
without the fault chip, since the reader put the box there. The
gallery's "room" is now measured from the held edge, which changes the
existing under/over card readings.

Max asked for the box in the gallery on a Leaf page. Tests: a runtime
case drops the box against the room's left edge (the old rule gives 320,
the lane gives 1284); the 1151 runtime tests, the browser type check,
and focused browser tests on grip, left-side and carried surfaces pass.

> _This was written by Claude Code on behalf of max-sixty_
leaf-agent added a commit that referenced this pull request Nov 27, 2026
…#7415)

#7329 opens every comment card slim (320 px) instead of the 592 px a
card under its words used to take. In this test the first message now
wraps, so the card stands 21 px taller. At the 1000×608 window the
draft's second line then already reaches the window's foot (542 px): the
card stops there and the transcript scrolls 4 px, which lifts the editor
from 481 to 477. The card's top and width hold throughout, so the box
isn't re-standing or widening. This is the test's own later "bounded"
phase, arriving one line early.

The repair gives the test a 640 px window. The second line grows below
the first again, and the long draft still reaches the foot and shares
the card with its transcript, so both behaviors the test protects are
still checked. #7329's slim card stays, and no runtime code changes.
This follows the precedent of #5928, which resized thread-card tests
after a placement change.

Verification: the test fails on `main` at 608 px (`assert 477 == 481 ±
0.5`) and passes at 640 px on this branch (Linux, run by node id). A
probe at #7329's parent (`a5d8c24ec`) confirmed the cause: there the
card was 592 px wide and the message 64 px tall, and with the slim card
it is 85 px. The test failed on macOS in scheduled run 45985529285. Mac
fonts can wrap differently, and 640 px leaves about 30 px more room than
Linux needs.

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

2 participants