Skip to content

Keep margin replies on the conversation surface - #640

Merged
max-sixty merged 1 commit into
mainfrom
codex/thread-surface
Sep 12, 2026
Merged

max-sixty merged 1 commit into
mainfrom
codex/thread-surface

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

An independently colored reply surround produced a white band in the UI-precision work. Give the margin conversation and reply surround one opaque surface that follows the conversation's focus tint. This isolates the surface contract from that branch's broader layout changes.

Add an everyday browser check for collapsed replies, editing, and focus outside the conversation in light and dark mode. Restoring the mismatched card background fails both cases. Validation includes the everyday suite, full margin browser file, and pre-commit checks.

This was written by Codex on behalf of max-sixty

@max-sixty
max-sixty merged commit ad3fe38 into main Sep 12, 2026
7 checks passed
@max-sixty
max-sixty deleted the codex/thread-surface branch September 12, 2026 18:59
max-sixty added a commit that referenced this pull request Oct 27, 2026
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]>
max-sixty added a commit that referenced this pull request Oct 27, 2026
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.

- **Containers around the field.** The margin thread (`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
#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.
- **The field's own ground.** `.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. 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 (`drawRing` in `box-motion.js`).

The `box-motion.js` header 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):

| | main | containers only | this PR |
|---|---|---|---|
| Firefox | 0 / 0 | 8 / 11 | 0 / 0 |
| Chromium | 0 / 0 | 13 / 19 | 0 / 0 |

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 the `drawRing` change the
bottom band reads 0%.
- `test_a_margin_reply_shares_its_threads_opaque_surface` becomes
`test_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_thread` checks "no
tint" as the thread painting no ground rather than painting paper.

> _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