Skip to content

Show each visible difference once in a Leaf handoff - #1861

Merged
max-sixty merged 2 commits into
mainfrom
agent-ad203bdcc15bb741d
Oct 6, 2026
Merged

max-sixty merged 2 commits into
mainfrom
agent-ad203bdcc15bb741d

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

"Prove and hand off a visible change" in the developing-leaf skill said every difference gets a before/after pair. A review of a composer layout change then carried about twenty lf-shot pairs, light and dark at every width for every composer. Most of them repeated one difference, and nothing in the change touched colour, because the agent treated each changed catalogue state as its own difference.

Now the handoff shows each difference once, in the state where it reads most clearly, and a single line lists the other states that repeat it. A dark-scheme or phone pair appears only where the change looks different there. Every captured state still has to be checked.

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

max-sixty and others added 2 commits October 4, 2026 17:21
A before/after review of a composer layout change carried about twenty
lf-shot pairs, light and dark at every width for every composer, though
most repeated one difference and nothing in the change touched colour.
"Prove and hand off a visible change" said every difference gets a pair,
and the agent read each changed catalogue state as its own difference.

The handoff now shows a difference once, in the state where it reads most
clearly, and names in a line the other states that repeat it. A dark or
phone pair is shown only where the change looks different there. Checking
every captured state stays required.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new instruction's central behavior is still unscored. The existing review-shows-the-change/visible-change eval supplies one before/after pair, so it cannot distinguish a handoff with one representative pair from the twenty repeated pairs this PR aims to prevent. AGENTS.md ("Working on the repository") calls for scoring an instruction change before and after, and the developing-leaf skill's "Score an instruction change" section calls for a diagnostic case when the suite lacks this behavior. A case with repeated captures across widths and themes, plus one genuinely different dark or phone result, would show whether the new wording selects the right pairs while retaining distinct differences.

max-sixty added a commit that referenced this pull request Oct 6, 2026
scrollMotions built a ViewTimeline or ScrollTimeline for every axis a
scroller scrolls, so in a browser without them a comment box on words in
a scroller threw instead of reaching floating.js's window-plane
fallback. It now lists those axes with no timeline, and the caller places
the box again on each scroll. The handoff instruction asks for an lf-shot
per difference rather than per changed state, matching #1861.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 904ee9b into main Oct 6, 2026
4 checks passed
@max-sixty
max-sixty deleted the agent-ad203bdcc15bb741d branch October 6, 2026 01:36
max-sixty added a commit that referenced this pull request Oct 6, 2026
The target trace, the aim and the visual marks were drawn in the
document's plane from the target's box as each pane clipped it, so every
scroll of a pane holding the target rewrote their position and clip, a
frame behind the words. They now move with every scroll around their
target without script, the way #1782 made the thread card do.

## Paint stands

Each paint box stands in a paint stand
(`runtime/target-paint-geometry.js`, `paintStand`): one frame per box
that clips the target, cut to that box's band, inside the frame of the
box holding it. `geometry.js` `paintClips` reads those bands from the
existing clip walk, which `clipped` and `pagePlaneRect` now share
through `clipWalk` and `cutBy`.

Each frame is moved by the scroll of the box holding it through native
motion layers (new `runtime/scroll-motion.js`). Lengths are written
where they stand at their scrollers' start, so placing the paint again
after a scroll writes nothing. A header stuck over the page's top cuts
the paint in the window's plane, as a fixed frame round the page's
motion. The thread panel and drawers cut only paint stacked above them
(`data-lf-paint-plane="chrome"`), since they hide what stacks under
them. A stand whose box is put away drops its frames and timelines.

## Motion layers

Each motion layer runs on a ViewTimeline of the box its scroller holds
next (the next frame's box, or the target), so content growing elsewhere
in a scroller leaves the paint on its target. Two cases keep the
scroller's ScrollTimeline: words standing directly in a scroller, and an
axis a scroller starts at its far end (right to left, vertical writing
modes, reversed flex), where Chrome measures a ViewTimeline's range from
the wrong end. The axis's direction comes from computed style.
`floating.js`'s motion layers move onto the same helper and gain both,
with the right sign for those axes. Where the browser has no scroll
timelines, as Firefox has none, the axes are listed without one and the
box is placed again on each scroll.

## Visible change

A contour whose target is partly scrolled out of a pane is now cut open
at the pane's edge, as the target is, instead of closing along the
pane's edge. `leaf-dev stills` gained a state for it (`sort-aim-cut`);
it is the only state that changed.

## Tooling and instructions

- `leaf-dev stills` captures at two device pixels per CSS pixel, so
crops show text and hairlines as the reader's display draws them.
- `/developing-leaf`: a visible change's before/after pairs are handed
over on a Leaf page, an `lf-shot` for each difference from the stills
crops, rather than "embedded in the reply", which a terminal session
cannot do. It keeps #1861's rule to show each difference once.

## Tests

- `test_the_paint_over_a_target_in_panes_rides_each_panes_scroll`: no
writes to the paint on either nested pane's scroll, the paint stays on
its element, and stays there when content grows below it. It fails on
main.
-
`test_a_comment_box_on_words_in_a_scroller_stands_without_scroll_timelines`:
with no scroll timelines, the comment box for words in a scroller stands
and holds its place; it threw before.
- Two aim tests that measured the paint box's own rect for a clip now
read the part its frames show.
- `npm run test:runtime` passes. Before the merge with main, the margin,
aim, drawing, reactions, anchors, navigation, controls, pages, widgets,
shift-watch and send-placement files and the gate's scroll-writes and
at-rest checks ran with 15 failures and 5 errors, all of which fail the
same way without this change.

## Still open

- A thread card in the page's plane that a pane's edge cuts still
rewrites its clip on each pane scroll; the stand's frames could carry
that clip.
- Paint over a sticky target inside a scroller still trails and is
rewritten on scroll.
- `lf-shot`'s change reading outlines the whole pane for this one-line
change, since the removed line touches the pane's border.

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