Skip to content

Move the comment box and its Send's card on the floating boxes' one motion - #4379

Merged
max-sixty merged 13 commits into
mainfrom
textbox-motion
Oct 27, 2026
Merged

max-sixty merged 13 commits into
mainfrom
textbox-motion

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The comment box beside a selected passage now moves the way the floating panel's field and the margin card do, on the one motion in box-motion.js. It used to change size in one frame, and its Send grew the margin card by a CSS clip of its own on a different clock (240 ms ease against the boxes' 300 ms ease-out). The user asked for every text box to move one way (on 26 October, choosing this over keeping the comment box's growth instant).

What the user sees. When a line is added or removed, the box's outline travels, its words ride the edge that moves and Send rides its corner. A line that takes the box past the window's foot shifts it up: the top edge travels with the words while the foot stays, where it used to jump whole. Send grows the card's outline out of the field on the same tween, the reading region's cut holds throughout, and the card's focus ring waits for the growth to end. At rest the box looks as before.

How

  • box-motion.js builds a box's surface itself (ground, a ring, a fill, and the ring layers drawn while a part moves), so the panel and the card no longer each build their own copy with copied rules. Shared rules are .lf-box-* in styles/chrome.css; each box places its layer and names its colours. The tween tokens apply to the whole chrome, and follow() defaults to them.
  • The comment box's field frame (.lf-compose-field) is the box, drawn by the surface, so the editor paints nothing of its own and its words travel inside it as the panel's do. Floating, the composer is a grid box holding what moves, so the grip beside it is never cut.
  • placed(place): a move the box's placement makes travels from where the box was drawn, where every move of the held edge used to read as the page carrying the box. The comment box's size observer waits for its placement, which lands before the frame paints, so a change that shifts the box starts one motion. Read first, the outline set out for the old placement and turned back a frame later.
  • drawnAt(rect): the card a Send opens draws its outline from the field it replaces. lf-comment-grow, its keyframes and growOut are deleted.
  • A ring the box comes to wear mid-tween waits for the tween's end.
  • The surface is cut at the shadow's drop plus twice its blur (a filter's blur is its Gaussian's deviation), where drop plus blur stopped the shadow in a visible step; this applies to the panel and the card too. --raise-1's lengths are registered like the others'.
  • Window resizes now make every box take the next reading as it stands, where only the panel did.

Tests

  • New: test_a_side_comment_s_words_and_send_ride_its_edges_as_it_grows. It fails with the placement's move left out, since the whole box then jumps 9px.
  • Rewritten for the new mechanism, guarding the same behaviour: the send-growth tests now read the card's surface rather than a clip on the card. open_compact_comment checks that the composer is open rather than display: contents. Two tests wait for the box's motion to end before measuring a send's words. Held-motion seeks skip cancelled motions, which reviving would replay.
  • Checked locally: focused browser tests across the panel, the card, send placement, aim and reactions, pnpm run test:runtime, pnpm run check:browser and pre-commit.
  • test_send_grows_thread_around_the_words[size1-0.75-…] fails on main too (its reply layout-shift count), so it is inherited.

Known limits: a Send within 300 ms of a line change moves the words about 2px as the card replaces the field. At fractional positions the field's 1px border can fall on a different pixel than before, as the panel's and the card's already did.

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

leaf-agent
leaf-agent previously approved these changes Oct 27, 2026
@max-sixty
max-sixty merged commit cd1c856 into main Oct 27, 2026
3 of 4 checks passed
@max-sixty
max-sixty deleted the textbox-motion branch October 27, 2026 07:32
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The compact-response test still read the editor's border, background and
filter after #4379 moved that paint onto the shared box-motion surface.
It therefore compared a transparent editor with a painted suggestion
button, despite the field retaining its visible frame.

Read the field's painted ring and fill, including their inset difference
for border thickness, and read elevation from the surface. Keep the
typography and placeholder checks, and compare border colour too. This
changes no on-screen state or product code and preserves #4379's moving
field surface.

The exact reported test fails on current main and passes with this
update. A temporary red-ring mutation makes the updated test fail on
border colour. Local Ruff checks could not run because Ruff is
unavailable; PR CI provides the lint gate.

Closes #4417 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
The compact comment test now checks the surrounding frame's 32px
footprint. #4379 moved the border from the editor to that frame so the
shared box motion can draw it; the borderless editor correctly occupies
the inner 30px. Reading the editor's old height stopped the test before
its send and thread assertions.

The reported test fails before this change (`30 != 32`) and passes
afterward, including comment admission, inline thread visibility, focus
landing and matching typography. This changes only the test's
measurement target and preserves the existing height expectation.

Closes #4416 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 27, 2026
Field motion was replacing the editor's normal 2px caret margin with its
travel distance, including zero. That cut off Firefox's line-end caret
while the comment box grew. The shared motion now preserves at least 2px
in the overflow clip and leaves the same inline room in its moving
content clip, preserving the box and word motion from #4326 and #4379.

The regression now holds the last moving frame and measures both clips,
so animation cleanup cannot conceal the failure. It fails against the
old motion code and passes with this change in Firefox and Chromium. The
panel's word/mark growth-and-shrink and below-cap deletion checks pass,
as do all 682 runtime tests and the browser build check. The kernel is
regenerated.

Closes #4428 — automated triage

---------

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 28, 2026
The shadow-seating journey still expected the floating editor to own its
outline, border and minimum height. #4379 deliberately moved those onto
the enclosing frame so the comment box could animate as one surface; the
forced-colors assertion consequently fails even while the frame draws
the focus cue.

Read the outline from the editor or its immediate composition frame, and
compare the shared text typography and padding without requiring
identical frame implementation. The existing Markdown rendering, table
overflow and sent-text inset assertions remain.

Both affected cases pass locally (desktop/light and touch/dark). The
original assertion fails on current main; removing the floating frame's
ring also makes the revised assertion fail. No runtime or appearance
changes.

Closes #4457 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 28, 2026
Remove the runtime exports left behind when their callers moved:
`submitLabel` after #4270 gave each field its own send label,
`agentLabel` after #4325 removed the named-agent notice, and the
external `liftReach` API after #4379 moved shadow measurement inside box
motion. Keep the shadow helper private and delete the two unused label
helpers, preserving those changes' behavior.

The same audit on current main also finds `quietWord`, `ICONS`, and the
`icons.js` re-export of `showAction`. Keep the first two private and
remove the redundant re-export; `showAction` remains exported by its
owning module for its real caller.

Rebuilt the kernel: only its source hashes change; the compiled
JavaScript is byte-for-byte unchanged.

Validation: the existing export audit failed before the change with all
six names. After the change the audit and the shipped-page browser
render gate both pass (2 tests). The browser build and all 695 runtime
tests also pass.

Closes #4461 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 28, 2026
The compact-comment clearance test compared the editor's final layout
with Send's still-animated position. #4379 deliberately made Send ride
changes in the box's width; the test now waits for the box's finite
animations before reading resting geometry. The 0.1px clearance
tolerance and trailing-space height/position assertions remain
unchanged. There is no runtime or visual change.

The focused test passes locally. A diagnostic fixture with Arial and a
slightly shorter draft reproduced the mismatch with motion held at 100ms
(text boundary 286.266px, Send 286.110px); that fixture passes with the
wait, including at 6× CPU throttling. macOS verification remains with
CI. Local Ruff checks could not run because the executable is absent.

Closes #4467 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Oct 29, 2026
The refused-reply test now recognizes the margin card's ground surface
in shift diagnostics. #4183 deliberately let a refused turn give its
room back; the shared box motion in #4379 reports that movement beside
`div.lf-box-ground.lf-margin-preview-ground`, while this test still
matched the enclosing `aside`. This updates that reference without
changing the runtime or adding another accepted surface.

The margin case fails before the change and passes after it, including
whole draft text, card bounds, retry identity and exactly one admitted
reply. The panel case also passes. Ruff check and format check pass.

The outlet and nested-end cases fail on both unchanged main
(`cf15e623131b432e234cf80c6d9ed0e1c3ba367f`) and the candidate: `pose()`
cannot find a visible action button and dereferences `undefined`;
teardown also reports shifts. Those failures are separate from the
margin diagnostic repaired here.

Closes #4460 — 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