Skip to content

Draw the comment box as its card while it is written - #3157

Merged
max-sixty merged 2 commits into
mainfrom
composer-growth-direction
Oct 19, 2026
Merged

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

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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 Let the comment box grow down to the window's edge before it slides #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 Let the comment box grow down to the window's edge before it slides #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

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.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

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

The committed browser output is stale: pnpm run check:browser fails on this head and names skills/leaf/kernel/runtime/bundle-annotation-overlay~margin-placement.js and skills/leaf/kernel/kernel.json. Rebuild the browser output and commit those generated files so the test check can pass. I can push the rebuild if you prefer.

@max-sixty
max-sixty merged commit 698cadf into main Oct 19, 2026
3 checks passed
@max-sixty
max-sixty deleted the composer-growth-direction branch October 19, 2026 17:18
max-sixty added a commit that referenced this pull request Oct 19, 2026
The card paint moves to the bar's ::before, beneath its grip and controls,
so the growth clips only paint: presses in the frame's rows land from the
start, and frame tests keep the box's marker. The layer is promoted so its
raster survives a scroll out of the window; re-rastered on return, the
shadow missed the frame that brought the words back (wheel-return
document-target and code-target, failing since #3157).

The pane wheel-return case wheeled over the box's top row, which since
#3157 is the painted card's grip and takes the wheel as the thread card
does; it now wheels the pane above the passage.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Oct 19, 2026
…3161)

The comment box's card paint now opens out of its field when writing
starts, bringing back the growth #3157 removed from Send. The paint
moves to its own layer beneath the box, which also fixes three
compositor-frame tests #3157 broke.

## The growth

Before #3157, Send opened the card out of the comment box with a 240ms
clip (`growOut`). #3157 painted the box at its card's size while it is
written, so Send had nothing left to grow and the animation went. The
user asked for the growth back. It now plays where the box becomes the
card: the first time its field takes focus or holds words. Every edge
reaches the box's edge together, then the clip opens past the shadow's
reach so nothing pops when it lifts. Send still swaps the box for its
card in place.

## The paint's own layer

The card paint (ground, border, shadow) moves from `.lf-fab-bar` to its
`::before`, beneath the box's grip and controls:

- Growing a clip on the bar itself also clipped its presses and outline,
so a press in the frame's rows during the growth fell through to the
page
(`test_a_dropped_surface_keeps_its_box_until_placement_commits[composer]`)
and frame tests lost the box's marker. On the pseudo-element the growth
moves only paint.
- `will-change: transform` keeps the layer's raster while a scroll
carries the box out of the window. Rastered again on return, the 36px
shadow missed the frame that brought the box's words back, so the first
returning frame showed the field without its card
(`test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame[document-target]`
and `[code-target]`, failing on main since #3157).

## Behavior changes

- Writing starts: the card paint opens out of the field over 240ms
(nothing under reduced motion). One run per writing session: none on
typing, wrapping, a grip press or blur with words, checked in Firefox
and Chromium.
- `test_a_wheel_return_…[pane-selection]` wheeled with the pointer over
the box's top row. Since #3157 that row is the painted card's grip,
which takes the wheel as the thread card does, so the pane no longer
scrolled. The test now wheels the pane above the passage.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 19, 2026
The two remaining browser failures in [main CI run
39295617122](https://github.com/max-sixty/leaf/actions/runs/39295617122)
came from test presses landing on the comment card rather than their
intended page targets.
[#3157](#3157) deliberately made
the card’s painted rows a drag grip while writing; the adjacent button
and passage in these fixtures now sit behind that grip.

Move the newer button above the composer’s area and give the draft
test’s second passage its own clear line. The tests still use real
presses to check that a later control keeps focus and that each passage
keeps its own unsent words. Both cases failed on current `main` before
this change and pass after it; the focus test’s other parameter also
passes.

The run’s other five failed cases are addressed by merged
[#3161](#3161),
[#3162](#3162), and
[#3163](#3163); those cases passed
in the focused current-main run.

---------

Co-authored-by: leaf-agent <[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