Skip to content

fix: align compact comment test with shared Send spacing - #4700

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-4467-shared-spacing
Oct 29, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-4467-shared-spacing

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

The compact-comment test still expected its text column to end exactly at Send's hit box. #3824 intentionally changed comment, card and card-reply spacing to preserve line breaks through submission; the current 3px gap is the action inset plus the frame around the field. The assertion now accounts for that shared spacing rather than rejecting it. The 0.1px tolerance, motion-completion wait and trailing-space height/position checks remain in place. This changes only the test.

The focused test reproduces 292 == 295 ± 0.1 before this change and passes afterward, both normally and at 6× CPU throttling. The failure screenshot was inspected; no runtime or visual behavior is changed. CI and review remain pending.

Closes #4467 — automated triage

Account for the action inset and enclosing frame introduced by #3824. Keep the 0.1px tolerance and trailing-space stability assertions; no product behavior changes.

Closes #4467
@leaf-agent
leaf-agent merged commit 43aac8a into main Oct 29, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4467-shared-spacing branch October 29, 2026 13:04
max-sixty added a commit that referenced this pull request Oct 30, 2026
…nd in the corner they leave free (#4714)

Under a mouse, a composer's words now run the whole line, and Send takes
the corner they leave free. Before, every line of a draft stopped short
of Send's column, about 30 px, so the column above Send stood empty. The
user picked this design on the review page, over keeping that room and
over a Send that stays hidden until the corner frees.

Under a finger nothing changes: the boxes keep Send's room on every
line, as on main.

**Experimental.** The user chose to try this although it departs from
common practice: chat and comment boxes elsewhere keep Send drawn beside
or below the words and leave the column above it empty. The header in
`response.css` records that, and names main's layout, with Send's room
kept on every line, as the one to return to.

### What the user sees

- The card's reply box, the comment box and the floating panel's field
run their words to the same inset at the end as at the start. A card's
messages end their lines at the same place, so a comment or reply breaks
each line where it did as it was typed. On a test line, 26 words fit a
row where main fits 24.
- Send stands in its corner while the row beside it leaves the corner
free. Once that row reaches the corner, Send hides and Enter sends.
- Pointing at the corner shows Send over the words at once, with its
tint and the pointing hand. It takes a press only after the pointer has
rested there for 150 ms, so a quick click on the last letters places the
caret and a double-click selects. Typing, or a press on the words, hides
it again. Tab shows it too.
- Over the words, Send is a square one line tall, centred on the last
row and clear of the row above. The letters it covers fade into the
field's paper across an em.

### How it works

- `text-field.js` adds `--lf-field-corner`. A box that sets it gets
`:state(corner-taken)` whenever the words in view, or the caret, reach
that square. Only the row across the square's middle counts.
- `input.js` sets `data-send-pointed` on the field as soon as the
pointer is inside Send's box, and `data-send-armed` once it has rested
there for `SEND_DWELL`. It reads the pointer's position from both moves
and leaves, because Firefox follows nearly every move with a
`pointerleave` at the same point.
- `response.css` holds the shared rules under `(hover: hover) and
(pointer: fine)`: the field keeps no room at the end of its lines, and
Send is a line tall, centred on the last row, hidden while the corner is
taken and not pointed at, and ignoring presses until armed. The panel's
sheet is unlayered and outranks those rules, so `floating-panel.css`
restates them for its own field.
- Send reads its row as the field's `1lh`. So the comment box and the
panel now set their words' face on the field rather than on `leaf-text`,
which inherits it; before, the panel's disc came out 18 px beside 21 px
rows. Over the words Send's box is painted in `--lf-field-ground`, which
the panel sets to its own surface.
- Under a mouse an empty card reply box is one row tall, so the card's
reserved reply row (`--lf-comment-reply-row`, `chrome.css`) drops the
extra 2 px it had kept. Without that, the draft jumped up 2 px at its
first wrap.

### Tests

- New: `drafts/test_send_corner.py`. It covers the card reply in
Chromium and Firefox and the panel's field in Chromium, on a paused page
clock. In each, Send hides once the words reach it and the words run
under its column. A press 1 ms short of the rest reaches the words, and
a press after the rest sends. I checked it fails when the rest is cut to
0 ms, and when the panel keeps its room.
- Extended:
`test_a_reply_written_in_a_card_keeps_its_line_breaks_once_sent` now
also checks that a comment keeps its line breaks from the comment box
into the card, under a mouse and under a finger.
- Rewritten for the new behavior, which they had checked against keeping
Send's room:
  - `test_the_row_s_marks_and_presses_share_the_words_line`
- `test_a_compact_comment_keeps_no_room_for_send_under_a_mouse`,
formerly `…reserves_only_the_room_send_occupies`. It replaces the
assertion that #4700 aligned on main: under a mouse the words keep no
room for Send.
- `test_the_margin_reply_keeps_its_shape_when_the_user_enters_it` fails
on main as it does here.

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

Compact comment Send clearance differs by more than its tolerance

1 participant