Repository navigation
Keep a margin reply's focus ring whole while the card grows - #4380
Merged
Merged
Conversation
In Firefox, when a margin card's reply field grew, by Shift+Enter or a soft wrap, its focus ring lost its top edge for the whole growth tween (about 300 ms); the sides and bottom stayed. While a card moves, box-motion draws the field's ring on the card's surface, which stands behind every part of the card. Two containers between the card face and the field painted paper of their own: the margin thread (`background: var(--paper)`) and its reply row (`background: inherit`). The reply row spans the field's width with 16px of top padding, so its paper covered the ring's 2px band above the field, while the side and bottom bands fell outside it. Both grounds date from #640, when the margin thread wore a focus tint and a pinned reply row had to match it. The card's face has since become the thread's one ground (the thread "fills it with no ground or ring of its own"), and box-motion holds that face transparent over its own paper fill while it moves, so the two backgrounds were redundant paint. The thread now paints `none`, which still overrides the quiet ground the theme gives a thread holding focus, and the reply row paints nothing. At rest the card looks the same: both read transparent over the card's opaque paper, focused or not. In a Firefox recording of three Shift+Enters, frames showing the side ring without the top fell from 27 to 0. box-motion.js now states the rule: the box's face is the only ground between the surface and a ring it draws. The floating panel already keeps it; nothing between its card and its field paints. test_a_margin_reply_shares_its_threads_opaque_surface asserted the thread and reply row were opaque and matched; it becomes test_a_margin_reply_stands_on_its_cards_face, which asserts they paint nothing over the card's opaque face as focus enters and leaves; and test_a_margin_card_is_one_frame_that_rings_for_its_thread checks "no tint" as the thread painting no ground rather than painting paper. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…hows While a margin card grows with its reply field (Shift+Enter or a soft wrap), box-motion draws the field's focus ring on the card's surface, behind every part of the card. The field itself (`.lf-compose-field`) paints its own paper, and its layout already stands at its grown size, so that paper covered the ring's edge on the side it grows toward until the ring had nearly reached its rest: for the tween's first 2-5 frames the ring showed its top and sides but no bottom. On main the reply row's paper was clipped to its old outline while it moved, which happened to clip the field's paper too and hid this. The parent commit removes that paper (the ring's top edge was vanishing under it), which exposes the field's own paper. So the surface now draws the ringed part's ground as well as its ring: the ring's fill takes the part's background colour, and the part stands transparent while it moves, as the box itself already does over the surface's fill. Measured in recordings of a soft wrap and of Shift+Enters, 25 fps, counting frames with the ring's top edge but not its bottom: Firefox: main 0, parent commit 8 and 11, this commit 0 and 0; Chromium: main 0, parent commit 13 and 19, this commit 0 and 0. The floating panel's field paints no ground, so it is unchanged. test_a_growing_margin_reply_keeps_its_whole_ring_from_the_first_frame holds the growth at its first frame and checks the ring's top and bottom bands are drawn in its colour; without this change the bottom band reads 0%. Co-Authored-By: Claude Opus 5.5 <[email protected]>
leaf-agent
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a margin card's reply field grew, by Shift+Enter or a soft wrap, its focus ring lost an edge during the card's resize tween: the top edge for the whole tween (about 300 ms) on main, and, once that was fixed, the bottom edge for the tween's first 2–5 frames. Firefox and Chromium both show it.
While a card moves, box-motion draws the field's ring on the card's surface, which stands behind every part of the card, so anything the card paints over that surface hides the ring. Two kinds of paint did that.
background: var(--paper)) and its reply row (background: inherit) painted paper of their own. The reply row has 16px of top padding, so its paper covered the ring's band above the field. Both backgrounds date from Keep margin replies on the conversation surface #640, when the thread wore a focus tint; the card's face has since become the thread's one ground, and box-motion holds that face transparent over its own fill while it moves. So both now paint nothing (annotation-chrome.css). At rest the card looks the same..lf-compose-fieldpaints its own paper, and its layout already stands at its grown size, so that paper covered the ring's edge on the side it grows toward until the ring had nearly reached its rest. On main the reply row's paper was clipped to its old outline while it moved, which clipped the field's paper too and hid this; removing the row's paper exposed it. The surface now draws the ringed part's ground along with its ring: the ring's fill takes the part's background colour, and the part stands transparent while it moves, as the card's face already does (drawRinginbox-motion.js).The
box-motion.jsheader now states the rule: the box's face is the only ground between the surface and a ring it draws, and the surface draws the wearer's own ground inside the ring.Measured in recordings at 25 fps, counting frames where the ring shows its top edge but not its bottom (soft wrap / three Shift+Enters):
and frames missing the top edge fell from 27–37 on main to 0. The floating panel's field paints no ground and nothing between its card and field paints, so it is unchanged.
Tests:
test_a_growing_margin_reply_keeps_its_whole_ring_from_the_first_frame(new) holds the growth at its first frame and checks the ring's top and bottom bands are drawn in its colour; without thedrawRingchange the bottom band reads 0%.test_a_margin_reply_shares_its_threads_opaque_surfacebecomestest_a_margin_reply_stands_on_its_cards_face: the thread and reply row paint nothing over the card's opaque face as focus enters and leaves.test_a_margin_card_is_one_frame_that_rings_for_its_threadchecks "no tint" as the thread painting no ground rather than painting paper.