Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions plugins/leaf/skills/leaf/assets/leaf.js
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,14 @@ export async function sendAction(el, action, detail, { attempt } = {}) {
});
}
sending.set(el.id, (sending.get(el.id) ?? 0) + 1);
// Both edges repaint the line, the way undoLast does for its own record: this store
// is half of unrecordedGesture, which is what `z`'s row asks, so a send starting or
// ending moves whether that key works and no focus event reports it. Without them
// the line's answer trails the dispatcher's by however long until the next paint
// some other signal happens to schedule — the line offering a press the dispatcher
// would refuse, which is the one thing "a key on screen is a key that works" is
// there to rule out. paintHere coalesces to a frame, so the pair costs nothing.
paintKeys();
Comment thread
leaf-agent marked this conversation as resolved.
Resolved
let minted;
try {
minted = await post({
Expand Down Expand Up @@ -975,6 +983,7 @@ export async function sendAction(el, action, detail, { attempt } = {}) {
}
});
}
paintKeys();
}
}

Expand Down
30 changes: 30 additions & 0 deletions tests/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ machine's load rather than the product's behaviour: the reading it took was
whichever transient it was quick enough to catch. The scroll stopping is the
fact to wait on; where it stopped is the assertion.

A press the dispatcher can refuse needs the same fact before it, and reads as
neither wait nor assertion until it is given one. `z` is the one press whose
subject is read rather than pointed at, so it is dead while the page holds a
gesture the log has not taken — its predecessor's trip included. Every other press
can be made the moment the paint is there, and the paint arrives a turn before the
trip it was made on is over, so a `z` made on it is refused; what the refusal
leaves behind is the page an assertion on the un-undone state would find anyway.
Nothing distinguishes that from an undo that did the wrong thing, and the suite's
undo tests were failing that way one at a time, a different one per run. The line
and the dispatcher ask one predicate (`live`), so the offer standing on the line is
the page saying this press will be taken — which is what `undo(page)` waits for
before pressing. Where a gesture has a liveness of its own, wait for the page to
state it rather than for the gesture before it to have painted.

Where nothing will happen, there is no fact to consume and polling has no end. An
assertion of absence holds a window instead, and the window's length is derived
from the mechanism rather than picked: a manually launched server must outlive
Expand Down Expand Up @@ -415,6 +429,22 @@ for the reason it gave. What the second press would leave is a line in the log
once the queue drains, which is where a gate on it reads. Before asserting that a
gesture did not travel, ask what would have stopped it anyway.

The same question is owed to a paint, and there it is asked of whoever else was
going to draw the frame. What the line says the instant a gesture leaves is the
door's own statement (`sendAction`), and the first gate written on it was a pick,
made with the send held in the wire and the line read a frame later — which passed
with the door's paint deleted. A pick announces `lf-answered` before its send
leaves, and the paint that announcement schedules runs *after* the handler that
started the send, so it drew the answer the gate was there to demand. Every
neighbouring gesture had a writer of its own: a click focuses what it lands on and
focusin paints, a dropped card repaints its grips, a poll two seconds later paints
whatever else did not. So the gesture the gate ended up on is the one whose widget
does nothing until the log answers (a suggestion's accept, pressed on a control
already focused, on a page settled first), and the reading is taken once rather
than through a retrying `expect`, which the next poll would answer either way.
Where the fact under test is what the page says at an instant, list who else
paints that frame before believing the green.

## An assertion that nothing moved must straddle the change that could move it

A geometry assertion is worth only as much as the transition it is measured
Expand Down
Loading
Loading