Repository navigation
Hang a seated comment box's shelf above its field - #3220
Merged
Merged
Conversation
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 the field lost 58px of width and its words moved 58px; in the diff the field shrank and dropped 10px. Now no shelf stands beside its field. In a row holding a field, the shared rule in response.css already gave the shelf a line of its own (a card's reply, a seat's first message); the inline comment box now joins that rule, since its composer adds no box of its own. The 34px height, the beside-the-field width cap and the drawing shelf's matching cap go, the last 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 anchor, one shows at a time, and one placement rule reads it. So pasting there leaves the panel and the field as they were. An in-flow shelf's 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 file row above. In the 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 the panel and field keep their place with the picture above the panel; the diff-outlet test checks the picture stands above the field, the field keeps the box's width and the × stays inside the box. Both new checks fail on the previous sheets. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Oct 20, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 20, 2026
) Follows #3220. On a page that draws its own annotations, the anchored comment box stands in the panel's row in the field's place (`.lf-fp-response`). Its Send, and Dictate before any words, stood on a second line under the field, at the field's start. The panel grew from 44px to 72px while the box was open. **Cause:** the panel's generic press face. The chrome sheet is unlayered and the document layers `response.css`, so the face's rules beat the comment box's own whatever their specificity. Its reach rule set the box's Send to `position: relative`, which took it out of its absolute seat in the field's end corner and put it in a grid row of its own. The face also added `padding: 0 8px` and the panel's hover fill. **Fix:** the face already skipped what Leaf's reader draws in a view's outlet, and the attachment shelf. It now skips the seated comment box too, which carries its own face in `response.css`, the same one it has on the page. Send now stands at the field's end on its line, as in every comment box, and the panel keeps its resting height while the box is open. **Tests:** the panel-seat test now checks that Send stands inside the field's line, at its end. The check fails on the previous sheet. > _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_
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.
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.cssalready 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.