Skip to content

Give every attachment shelf the panel's picture with a corner × - #3214

Merged
max-sixty merged 2 commits into
mainfrom
agent-afda6ba3a9c673bc5
Oct 20, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-afda6ba3a9c673bc5

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The floating panel's field draws an attached image as its picture alone with a round × on its corner (#3190). The anchored comment box, a card's reply and the other composers still drew the old tile: a cropped thumbnail in a bordered box, beside a full-height × press behind a divider. This makes the panel's look the one shared face of .lf-composer-media in response.css. Each picture keeps its own proportions (up to twice as wide as tall), is 56px tall unless the surface has less room, and has 8px corners, a ring and a --raise-1 shadow. Its 18px × shows on hover or focus, always under a finger, and reaches to the aim floor.

Why the panel had its own copy. The document layers response.css, while the chrome sheet is unlayered. So the panel's generic press face (button:where(:not(.lf-fp-outlet *)), its icon size and focus ring) beat the shelf's own rules whatever their specificity. Those rules now exclude .lf-composer-media *, as they already excluded outlet content. floating-panel.css keeps only where its shelf stands, plus its ground and ring.

Anchored comment box. The shelf used to stand beside the field, so attaching an image widened the box from 380px to 454px at 1280px wide and moved the words 74px. Under a finger at 390px it took 92px from the field. The shelf now stands in the header row the box already keeps for the card it becomes, over the field's start, with 34px pictures (50px under touch). Attaching changes neither the box nor the words, and the card that Send opens stays where the box was (x=779 before and after; on main it jumped to 853). #3187 left that header row in place, as undrawn room.

Smaller changes. The shelf image no longer also wears the theme's page-image frame, which drew a second ring and shadow under the press's own; in the panel that makes the shadow a touch lighter. Card-reply pictures are 56px at their own proportions instead of a 52px crop, so the reply row grows 6px more when an image is attached. Drawings keep their tile.

Tests. test_media's image-only composer test now checks that the box and field stay put and that the pictures sit above the field. It pastes six images, so the narrow shelf still overflows. test_layout's in-bounds check now reads the pictures and their × rather than the shelf's unpainted padding. test_render_threads now checks the picture's corner and the round ×. Before and after were probed on triage-board in Chromium and Firefox: anchored box, hover, keyboard focus on the ×, dark, touch at 390px, card reply, and the panel field. All match, and the panel field's picture and × keep their geometry.

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

max-sixty and others added 2 commits October 19, 2026 19:09
The floating panel's field drew an attached image as its picture alone with
a round × on its corner (#3190), but the anchored comment box, a card's
reply and every other composer still drew the old tile: a cropped
thumbnail in a bordered box beside a full-height × press behind a divider.
That face now lives once, on `.lf-composer-media` in response.css: the
picture at its own proportions (up to twice as wide as tall), 56px tall
unless the surface has less room, 8px corners, a ring and a --raise-1
shadow, and an 18px × that shows on hover or focus, always under a
finger, with a reach to the aim floor.

The panel had restated the whole face because the document layers
response.css while the chrome sheet is unlayered, so the panel's generic
press face (`button:where(:not(.lf-fp-outlet *))`, its icon size and
focus ring) beat the shelf's own rules whatever their specificity. Those
rules now exclude the shelf as they already excluded outlet content, and
the panel keeps only where its shelf stands and its ground and ring.

In the anchored comment box the shelf stood beside the field, so
attaching widened the box (380px to 454px at 1280px) and moved the words
74px; under a finger at 390px it took 92px from the field. It now stands
in the header row the box keeps for the card it becomes, over the field's
start, with 34px pictures (50px under touch), so attaching changes
neither, and the card Send opens stays where the box was.

The shelf image no longer also wears the theme's page-image frame, which
drew the ring and shadow a second time under the press's own. In a
card's reply the pictures are 56px rather than a 52px crop, so the reply
row grows 6px more with one attached.

Tests: test_media's image-only composer now checks the box and field keep
their place and the pictures stand above the field (with six images, so
the narrow shelf still overflows), rather than the shelf standing beside
the field; test_layout's in-bounds check reads the pictures and their ×
rather than the shelf's unpainted padding; test_render_threads checks the
picture's 8px corner and the round × rather than the tile's radius.

Drawings keep their tile, the drawing-tile case of the same sweep.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 93128f9 into main Oct 20, 2026
3 checks passed
@max-sixty
max-sixty deleted the agent-afda6ba3a9c673bc5 branch October 20, 2026 02:24
max-sixty added a commit that referenced this pull request Oct 20, 2026
Follows #3214. The comment box seated in the panel's row
(`.lf-fp-response`, on a page that draws its own annotations) and in a
widget's outlet, such as a diff's file comment, still stood an attached
image beside the field at 34px. In the panel seat, attaching took 58px
of the field's width and moved its words 58px. In the diff, the field
shrank and dropped 10px.

**No shelf sits beside its field now.** `response.css` already gives the
shelf a line of its own wherever a row holds a field, as in a card's
reply. The inline comment box now joins that same rule, since its
composer adds no box of its own (`display: contents`). This removes the
34px height, the beside-the-field width cap, and the drawing shelf's
matching cap along with its preview-width variable. In the panel, the
seat's shelf hangs over the panel exactly as the field's does. Both
carry the field's anchor, only one shows at a time, and one placement
rule reads it. So pasting there leaves the panel and the field where
they were.

**The × stays inside its row.** In-flow pictures now stand 6px into
their row rather than 4px, so the removal mark on their corner stays
inside the row. In a diff it no longer reaches over the edge above.

**Trade-off:** in a diff, the comment box grows by the shelf's line when
an image is attached, as a card's reply does.

**Tests:** the panel-seat test now pastes an image and checks that the
panel and field keep their place and that the picture sits above the
panel. The diff-outlet test checks that the picture sits above the
field, that the field keeps the box's width, and that the × stays inside
the box. Both new checks fail on the previous sheets. The focused shelf
tests pass, and I probed both seats in Chromium and Firefox.

> _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
The comment box drew a drawing as a bordered tile: a 96×64 snapshot of
the page under the ink, then two presses as tall as the drawing, Undo
last stroke and Remove drawing, each behind its own divider. That made
three cells and two seams for one picture. #3214 had already given every
attached image the floating panel's look: the picture on its own, with a
round × on its corner. Drawings stayed boxed.

Now a drawing looks like an image. It is its picture alone, with 8px
corners, a ring and the `--raise-1` shadow. Remove drawing is the same
18px × on its top-right corner, and Undo last stroke is a ↶ mark on its
top-left. Both marks show on hover or keyboard focus, are always shown
under a finger, and reach the aim floor (24px with a mouse, 44px under
touch) through a `::before` that paints nothing. The tile keeps its own
row above the field, now because the 64px picture is taller than the
header row the images use, not because of its presses. The field doesn't
move (y=285 at 1280×900 on main and here).

**One set of rules for the marks.** `response.css` used to style the
image's × through `.lf-composer-media-remove` and the drawing's presses
through a second set of rules. Now one rule set covers every button in a
shelf item other than its picture (`.lf-composer-media-item >
button:not(.lf-media-open)`). Removal sits on the right by default, and
`.lf-composer-drawing-undo`, the one class this adds in `input.js`, puts
undo on the left. The ring, radius and shadow apply to every picture.
Images keep their own height rule. A drawing keeps its fixed size, plus
a paper background so the page behind the box doesn't show through where
the canvas letterboxes.

**Marks stand over the carry band.** Under touch, the box's carry band
(`.lf-surface-grip`, 12px outside the field's edge) covered the top 11px
of the undo mark's 44px reach. A press there grabbed the box instead of
undoing. The marks now take `z-index: 1`, so the whole reach belongs to
the mark. This also covers an image's × wherever it meets the band.

**The undo mark shows in Draw mode and out of it.** Outside Draw mode it
is the only touch route to undo. In Draw mode, the panel row's Undo
stroke and `z`/`⌘Z` also undo, but they take back the latest stroke
wherever it went (`undoTarget` in `drawing.js`), while the mark takes
back this draft's own. A mark that came and went with the mode would
also move under the user. The `response.css` header records this choice.

**Tests and tooling.** `test_render_drawing_context` checked that each
drawing button was at least 44px wide under touch. It now checks that a
press 21px from each mark's centre, diagonally, reaches the mark.
`leaf-dev stills` gains `drawing-comment-hover`, `-hover-dark`,
`-keyboard` and `-touch` states, and `drawing-photo-comment` now crops
to the comment box rather than the shelf, whose size this change alters.

I probed in Chromium and Firefox against main: rest, hover, keyboard
focus on Undo, a press 2px outside the painted mark (undoes, then focus
returns to the field), touch at 390px, and dark mode. Firefox can't
drive a drawing under touch emulation on main either, so I checked touch
in Chromium. Tests run: the drawing context test, six drawing tests that
press undo or removal, the shelf tests from #3214 and #3220 (16 passed),
`pnpm run test:runtime`, and `check:browser`.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Oct 20, 2026
The floating panel's generic face for its own buttons was unlayered,
while the document layers every component's face (`lf-base`). So the
panel's face beat any component it held, whatever their specificity.
Each leak got one more exclusion, repeated through eight selectors:
first what Leaf's reader draws in a view's outlet, then the attachment
shelf (#3214), then the comment box seated in the row (#3223).

**The boundary.** The face now stands where defaults that yield to
components stand: in `lf-base`, as the marks sheet's indication default
does, inside `@scope (.lf-floating-panel) to (.lf-fp-outlet,
.lf-fp-response, .lf-composer-media)`.
- **The scope's limit** is the one place that names what the panel
holds. The face reaches none of those components' properties, including
ones a component leaves unset, such as the press reach and
`white-space`. A layer alone still let those through, so the limit is
needed.
- **The layer** lets the panel's own unlayered rules outrank the face,
and so does a shared face a panel control wears. The face still outranks
the chrome's control reset (`lf-reset`) and the focus band, which
carries no weight. In the lowest layer instead, that band moved every
panel focus ring from -2px to 3px.
- **What's removed:** the per-component exclusions. The field's
exclusion from the press reach stays, because the field's presses are
the panel's own, sized by its editor.

**Checked.** I diffed every visible control's computed face (at rest and
hovered) and its focus ring, main against this branch, in Chromium, in
Firefox and under touch. The states: the panel at rest, writing with an
image attached, Threads, the leaf's menu, the seated comment box, and a
thread open in the panel. The outlet, the shelf and the seated comment
box are identical. So are the panel's own presses, except two that now
take the face their own rules state:
- **The field's Send** is now the composers' accent arrow, with its
tinted disc on hover, as the user asked on 15 October (#3073). Before,
it was an ink arrow on the panel's hover fill.
- **A thread's Resolve icon** is 14px, as `.lf-fp-settle
.lf-action-icon` states, rather than 16px. #3214's `:not()` on the
panel's icon rule had given that rule more weight.

**Tests.** The Send test now checks that Send wears the accent. It fails
on the previous sheet. The focused panel, ring, chrome-scope,
stylesheet-delivery and shelf tests pass.

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