Skip to content

Let the comment box grow down to the window's edge before it slides - #3139

Merged
max-sixty merged 5 commits into
mainfrom
composer-growth-direction
Oct 18, 2026
Merged

max-sixty merged 5 commits into
mainfrom
composer-growth-direction

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A comment box beside a passage near the window's foot rose as the user typed, moving the words already written, while its field still had about 70px of room below. Now it grows down from its top until the field itself reaches the window's edge.

Why it rose

The box's frame (.lf-fab-bar) keeps the sent card's head row (45px) and reply row (71px) as transparent padding, so Send can open the card around the words without moving them (#1587). Placement held that whole frame inside the boundary, so once the unpainted reply row met the window's foot, each new line slid the frame up. Replayed in Firefox at 1728×999 on the user's page: on main, one wrapped line moves the field's top from 725 to 704 with its foot fixed at 862; on this branch the top stays at 725.5 and the foot moves from 862.5 to 883.5.

What changes

One rule, stated in comment-placement.js (overhang): what a surface paints is what the boundary holds, and the comment box's reserve at the end it grows toward may stand past the boundary. Each consumer of the boundary now follows it:

  • placement's shift takes the overhang as negative padding;
  • the frame may grow taller than the boundary by it, so the field can reach the edge, then slides one line per line, then scrolls;
  • withholding asks whether the box's controls fit what the frame keeps inside the boundary;
  • the drag grip holds the box in by the same bounds, so a press no longer jumps it;
  • a card adopting the frame on Send caps its stood floor at the boundary, so a long draft becomes a card that fills the window and scrolls its words, which stay put.

Behavior changes

  • Send from a box whose reserve stood past the edge moves the words by that overhang (at most 71px at the foot, 45px at the top, more on phones) to bring the card inside. Before, typing had already spent that movement.
  • A window too short for the frame but tall enough for the box's controls shows the box rather than withholding it.
  • Window-edge tests now measure the painted field rather than the frame. The Send test allows exactly the overhang and holds the card inside the boundary; the phone send-placement snapshot records the move. New assertions cover the field holding its top, the one-line-per-line rise, a grip press, and short windows with response choices open; each failed on the earlier code.

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

max-sixty and others added 5 commits October 17, 2026 22:43
Typing in a comment box beside a passage near the window's foot moved the
words up before the field reached the edge. The box's frame reserves its
sent card's head row and reply row unpainted, and placement held that whole
frame inside the window, so the invisible reply row (about 70px) met the
edge first and every new line slid the field up, part of a line or all of it.

Placement now lets the reserve at the end the box grows toward stand past
the boundary, by no more than the room the frame leaves, so the field's top
holds until the field itself meets the edge, and a box that fills the window
still stands wholly inside.

Behavior changes: Send from a box whose reserve stood past the edge moves
the words by that overhang to bring the card's head or reply row inside;
before, typing had already spent it. The window-edge tests now measure the
painted field rather than the frame, the Send test allows exactly the
overhang, and the phone send-placement snapshot records that move.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review found two cases the first change still moved the field. Capping
the overhang at the room the frame left made each line near the window's
full height slide the field by two lines and lift its foot off the edge;
now the reserve at the growing end always may stand past the boundary, and
the frame may grow that much taller than the boundary, so after the field
meets the edge each line raises it by one line, its foot on the edge, until
it scrolls. Pressing the drag grip clamped the whole frame inside the
boundary, jumping an overhanging box on pointer-down; the grip now holds the
box in by the same bounds placement does (`overhang` in comment-placement.js
names the end for both).

Behavior changes: a long draft's field fills the window to its edge, and
Send from it moves the words by the reserve to fit the card. A window too
short for the frame but tall enough for the box's controls now shows the
box rather than withholding it. Tests that held the unpainted frame inside
the window now measure what it paints.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
#	skills/leaf/kernel/kernel.json
… interrupted

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Second review found two places the overhang let painted things past the
window's edge. A long draft's frame, taller than the boundary by its
reserve, handed that height to the card on Send, whose `stood` floor kept
it, so the card's reply row hung below the boundary; `stood` now caps at
the boundary plus the surface's own overhang (none for a card). The card
then fills the boundary and scrolls its words, which stay put through Send.
And withholding measured the controls against the frame, so a short window
with the response choices open kept a box whose choices and Send fell
outside; it now withholds once the controls can't fit what the frame keeps
inside the boundary.

Behavior changes: Send from a draft taller than the window no longer moves
its words. The Send test holds every frame of the card inside the
boundary, and the short-window test checks the painted controls at each
height the box still shows.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 7d6801f into main Oct 18, 2026
3 checks passed
@max-sixty
max-sixty deleted the composer-growth-direction branch October 18, 2026 06:54
leaf-agent added a commit that referenced this pull request Oct 18, 2026
The send-placement snapshot now records that the phone touch passage's
sent thread card stays at the same vertical position as its comment box.
[#3139](#3139) intentionally lets
that box grow farther down before sliding, and the old snapshot's “near
down” movement no longer describes the observed handoff. This was the
sole snapshot difference in the [daily CI
failure](https://github.com/max-sixty/leaf/actions/runs/39120899705).

The focused journey reproduced the old mismatch, then passed after its
recording was reset. The other placement cases in the snapshot did not
change.

Co-authored-by: leaf-agent <[email protected]>
max-sixty added a commit that referenced this pull request Oct 19, 2026
The comment box now draws itself as the card it becomes while it is
being written, and Send swaps the box for the card in the same
rectangle, so nothing on screen moves.

## Why

The box's frame (`.lf-fab-bar`) reserves its card's name row (45px) and
Reply row (71px) around the editor so Send can open the card without
moving the words (#1587). Only the editor painted, so near the window's
foot the box rose while the room below it looked free. #3139 let the
unpainted Reply row hang past the window's edge instead, which kept the
box still while typing but moved the words up by that row at Send. The
user chose to draw the box at its card's size instead: the edge it rises
against is then one they can see.

## What changes

- The box paints its frame (the card's ground, border and shadow) while
its field has focus or holds words. Offered on a selection, it is still
only the field.
- Placement holds the whole frame inside the window again: this reverts
#3139's overhang in placement, sizing, withholding and the grip, with
the tests it changed.
- The painted rows are the box's grip, stacked beneath its controls, so
a press there carries the box and keeps the caret, and controls that
borrow the reserved rows in a short window still take their presses.
- Send no longer animates the card opening out of the field (`growOut`),
since the box is already the card's size.

## Behavior changes

- Typing near the window's foot: the box grows down until its painted
edge meets the window's, then rises a line at a time.
- Send: no movement; `test_send_grows_thread_around_the_words` now
requires the painted box and the card to share one rectangle (less the
response-choices row, which only the box carries).
- A window too short for the whole card hides the box again, as before
#3139.
- Sending with an attached image or drawing still changes the frame,
since the card lays attachments out differently from the box; that
predates this change.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 20, 2026
… it at Send (#3187)

While a comment is written, its box paints only its field again, and
Send grows the sent card out of that field, as before #3157.

The user preferred the box as a field that opens into its card at Send
to a box painted as the card while it is written (#3157, #3161). The
frame still reserves the card's name and Reply rows unpainted around the
field, and placement still holds that whole frame inside the window
(#3157's revert of #3139's overhang stays), so the card Send opens
stands where the frame stood and no word moves.

- `annotation-chrome.css`: the frame's `::before` paint and its growth
on writing (#3161) go, as do the frame-wide grip and its accent; the
grip is again the band around the field. The card's `lf-comment-grow`
returns on `.lf-margin-preview[data-lf-grows]`, keeping #3161's ending
past the shadow's reach so the shadow is whole when the clip lifts.
- `thread-preview.js`: `growOut` returns. The card keeps opening at its
box's width (#3166).
- The reading region's cut, which `placeThreadPreview` wrote as the
card's inline `clip-path`, is now four properties (`--lf-cut-*`) that
the card's clip and its growth both read. The growth animates
`clip-path` too and overrode the inline cut while it ran, so a card sent
in a pane painted itself and its shadow past the pane's edge for 240ms
(`test_a_sent_card_grows_inside_its_reading_region`, which fails without
this). Each growth edge now stops at the cut, and the growth ends on the
cut it rests at.
- `comment-placement.js` header: records both rejected designs.

## Behavior changes

- Writing: the box shows only its field. Near the window's foot the
field rises while empty room still shows below it, since that room is
kept for the card's Reply row.
- Send: the card opens out of the field over 240ms (whole at once under
reduced motion). `test_send_grows_thread_around_the_words` asserts the
box paints nothing beyond its field and that the card grows, besides its
existing checks that the card takes the box's rectangle and no word
moves.
- The reserved rows take no presses or wheel turns: they reach the page
beneath. The wheel-return test keeps wheeling the pane above its
passage, since its old spot now lies on the box's field.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[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