Skip to content

test: click an attachment clear of the fold mark, and count the export's gallery against its samples - #6637

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-6636
Nov 21, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-6636

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Two browser tests that fail on main since push run 44843074595 (1b70176f1) broke on changes that moved the interface on purpose. This PR updates both tests to the new behavior and changes no product code.

Both tests fail on current main and pass with this change.

The run's third failure, test_resolving_a_thread_restyles_what_focus_marks (255 restyles at 4 sections, 313 at 24), did not reproduce locally. It is tracked separately from #6636.

One finding for #6622's author: its description says the fold mark stands "just below the picture's left edge, without overlap". The measurement above shows the mark overlapping the picture by about 3 px, so a press on the bottom-left corner of an attached picture folds the panel instead of opening the viewer. This PR doesn't move the mark, because where the mark stands is a placement choice for #6622's author.

Refs #6636 — automated triage

…t's gallery against its samples

Two browser tests on main broke on changes that moved the interface on
purpose (ci run 44843074595 on 1b70176):

- test_looking_at_an_attached_image_keeps_the_draft_where_it_stands
  clicked the draft attachment at its foot's start. Since #6622 the
  panel's fold mark rides the box's top-left corner and shows under a
  pointer there, and its top edge reaches the picture's lowest three
  pixel rows, so the click landed on the mark. The test now clicks the
  foot's middle, clear of both the removal mark and the fold mark.
- test_an_export_reveals_its_widgets_and_releases_readable_failure_fallback
  asserted 23 margin-entry gallery items; #6627 added a News sample, so
  the gallery draws 24. Instead of moving the literal again (#6347 moved
  it to 23), the test asserts that both galleries draw the same
  non-empty set of samples with one face each, as #6393 did for the
  journey test.

Both fail on main and pass with this change.

Refs #6636
@leaf-agent
leaf-agent merged commit ffd552b into main Nov 21, 2026
7 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-6636 branch November 21, 2026 03:05
max-sixty added a commit that referenced this pull request Nov 23, 2026
Closes #6639

#6622 stood the floating panel's fold mark (−) on the box's top-left
corner and promised: "With a picture attached, the mark under a pointer
at the corner stands just below the picture's left edge, without
overlap." It overlapped. The mark stood 9px out past the corner, and its
press area reaches 2px past its 20px face, so it took presses from 11px
above the box, while a draft's pictures stand 8px above the box
(`--lf-media-gap`). With a wrapping draft and a pasted 40×30 picture in
a 1440×900 window, the mark covered the picture's lowest 3 rows across
its first 13 columns, and a press there folded the panel instead of
opening the picture's viewer. The mark also showed whenever the pointer
was within the box's left 64px at any height, so it appeared over the
picture itself, and the picture lost its hover, removal mark included.

| | Before | After |
| --- | --- | --- |
| Pointer on the picture's foot, 3px in | ![Fold mark over the picture's
bottom-left
corner](https://github.com/user-attachments/assets/49f371d7-92d7-4b3b-9faf-69c82e087db8)
| ![The picture hovered with its removal mark, no
fold](https://github.com/user-attachments/assets/481cc50b-a042-4b2c-b844-8d9a04c2dcf3)
|
| Pointer at the box's top-left corner | ![Fold mark overlapping the
picture's
foot](https://github.com/user-attachments/assets/1559ea91-d32e-4ce1-a42c-535246c84f24)
| ![Fold mark clear of the
picture](https://github.com/user-attachments/assets/236461af-c209-43ef-bf8e-27b2d517a056)
|

Two changes:

- **One overhang for every corner mark.** `--lf-media-mark-overhang`
(6px) moves from `response.css` into `tokens.css` as
`--lf-mark-overhang`, beside `--lf-mark-size`, and the fold reads it for
its `top` and `left`. The fold, reach included, now ends at the
picture's foot. It sits 3px further into the corner; on a long draft its
face meets the field's first glyph only at a corner point. The
attachments' marks don't move.
- **Near means the box or the mark.** `readCorner` (`floating-panel.js`)
keeps whether the pointer event's target is the mark, and counts the
pointer as near only while it is over the box's corner or over the mark
where the mark stands out past the box. A pointer on a picture above the
corner shows the picture's own marks and leaves the press to the
picture.

Touch is unaffected: the fold shows only under `@media (hover: hover)`,
so it stays hidden under a finger on both versions.

Measured with a probe journey on both versions, in the test's setup:

| | main | this branch |
| --- | --- | --- |
| Fold shown with the pointer on the picture's foot | yes | no |
| Picture pixels whose press goes to the fold, fold shown at the corner
| 39 | 0 |
| Press at the picture's foot start | folds the panel | opens the viewer
|

Tests:

- `test_a_pointer_folds_the_panel_from_its_corner` reads the offset from
the token: the mark's top-left stands `--lf-mark-overhang` out past the
box's corner. It used to assert the mark's centre on the corner within
2px.
- `test_looking_at_an_attached_image_keeps_the_draft_where_it_stands`
presses the picture's foot start again, where it pressed before #6637
moved the press to the mid-foot. It also checks that, with the fold
shown at the corner, the picture's lowest row takes the picture's press,
and that a pointer on the foot shows no fold. Reverting either change
alone fails it.
- A new stills state, `page-comment-photo-corner`, shows the fold beside
an attached picture.

Run: those two tests and
`test_the_leaf_paints_inside_its_focus_ring_after_folding` by node id
(pass); `pnpm run test:runtime` (1083 pass); `pnpm run check:browser`;
`tests/model/test_theme_tokens.py`; pre-commit on the changed files.
`leaf-dev stills` against main changes `page-comment-photo-corner` and
`panel-corner-hover` (the mark 3px into the corner) and leaves the
pixels of `page-comment-photo`, `page-comment-photo-hover`,
`thread-reply-photo`, `drawing-photo-comment`, `drawing-comment-hover`,
`drawing-comment-keyboard` and `plan-card-reply-photo` unchanged.

> _This was written by Claude Code on behalf of max-sixty_
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.

1 participant