Skip to content

Press the panel's controls with their answer held, on every corpus page - #4660

Merged
max-sixty merged 3 commits into
mainfrom
playground-submit-flicker
Oct 29, 2026
Merged

max-sixty merged 3 commits into
mainfrom
playground-submit-flicker

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

#4608 added a suite test that presses every bundled widget's controls with the server's answer held. This extends the same check to Leaf's own controls that send a reader's gestures, which stand in the floating panel: On me's answers and to-do Done, and in each thread's view its Resolve or Reopen and its reactions.

The panel sweep. tests/journeys/test_pressed_controls.py (nightly) opens On me, then each thread the Threads view lists, on every corpus page served with its log, and presses every control in the view with the event POST held. Each control must keep its cursor and its available, idle face while its gesture travels, and a second press on the same control must send again. The test also fails if On me lists an item and nothing was pressed, or if any thread's sweep didn't check a Resolve or Reopen, so it can't pass by reaching nothing. All 44 corpus pages pass in about 80 s on four workers.

A thread's card in the margin isn't swept: its Resolve and reactions remove the control they were pressed on, so there's no face left to compare.

The shared sweep. press_each_control in browser/widgets/test_pressed_controls.py now takes an open page and a selector for the elements whose controls count. It presses the controls a press revealed first, such as a reaction palette's buttons after its trigger. It passes over a control the pointer can't reach. When nothing is left, it presses Escape and calls the caller's restore, which reopens a thread's view that a control such as Show on page took away. An earlier version that pressed every control on the whole page reached thread controls only by luck: two runs of one page pressed 39 and 11 controls, and several pages never reached Reopen. Opening each view by its own route makes the reach the same on every run. The package test takes about 8% longer than before.

Bug-back controls. Each of these broken versions made a sweep fail:

  • the panel's Resolve/Reopen showing aria-busy, or ignoring a second press;
  • lf-options' Done showing busy, or ignoring a second press;
  • the playground's submit showing busy, or ignoring a second press;
  • lf-suggestion's Undo standing disabled after Accept.

Two failures on main fixed:

  • test_a_pressed_control_keeps_its_face_and_takes_the_next_press[reading] has failed since Split Leaf's reading look into a bundled theme a page can decline #4637 added reading, a package with no widgets. The test now expects no presses from a package with no own tags, and two packages drop off its hand-kept list.
  • test_an_older_settlement_cannot_repaint_over_a_newer_decision has failed since Keep pressed controls live while their gesture travels #4561, which made lf-suggestion name its decision through the dispatch's says. The runtime now announces "Accepted suggested change" when Accept is pressed, so the live region still holds it after the other tab's reject arrives. The test read the live region for the old behavior, where the widget announced in its send's continuation. It now checks what protects the user: once the late accept is answered, the suggestion still shows the reject. It also drops a fixed 100 ms wait.

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

The press check in browser/widgets/test_pressed_controls.py covered each
bundled package's widgets. Leaf's own controls that send a reader's
gestures stand in the floating panel: On me's answers and to-do Done, and
in each thread's view its Resolve or Reopen and its reactions. A new
nightly test, journeys/test_pressed_controls.py, opens On me and then every
thread the Threads view lists on each corpus page, served with its log, and
presses every control in the view with the event POST held. It asserts the
sweep pressed something wherever On me lists an item, and checked a
settlement on every thread. All 44 corpus pages pass, in about 80 s on four
workers.

The sweep is shared with the package test. It now takes an open page and a
selector for the elements whose controls count, presses the controls a
press revealed first (a palette's reactions after its trigger), passes over
a control the pointer can't reach, and once nothing is left presses Escape
and calls the caller's restore, which reopens the thread's view a control
such as Show on page took away. The package test's run time is within 10%
of before.

A thread's card in the margin is not swept: its Resolve and reactions take
away the control they were pressed on, so there is no face to compare.

Each control was confirmed by a failing run: the panel's settle wearing
aria-busy or ignoring a second press while its gesture travels, and in the
package test, lf-options' Done and the playground's submit doing either,
and lf-suggestion's Undo standing disabled after Accept.

The package test also stops expecting controls from a package with no
widgets, which fixes its `[reading]` case on main since #4637.
test_an_older_settlement_cannot_repaint_over_a_newer_decision has failed on
main since #4561. That change made lf-suggestion name its decision through
the dispatch's `says`, so the runtime announces "Accepted suggested change"
when the user presses Accept, and the live region still holds it after the
other tab's reject arrives. The test read the live region for the old
behavior, where the widget announced in its send's continuation.

The guarantee is the paint: once the late accept is answered, the
suggestion still shows the reject. The test now waits for the round trip
and reads `data-lf-state` and the hidden new text once, and drops its fixed
100 ms wait.
@max-sixty
max-sixty merged commit 24cfac4 into main Oct 29, 2026
4 checks passed
@max-sixty
max-sixty deleted the playground-submit-flicker branch October 29, 2026 07:40
leaf-agent added a commit that referenced this pull request Oct 29, 2026
The undo-settlement test treated retained live-region text as evidence
that an older Accept response repainted the suggestion. #4561 moved that
announcement into the shared dispatch path, independent of whether the
accepted decision still stands. The test now waits for delivery and
rendering to complete, then checks the suggestion's state, authored old
text and absent Undo offer after releasing the stale response. No
runtime behavior changes.

#4660 already made the corresponding correction for the newer-Reject
case. The remaining undo case reproduced the reported announcement
failure before this change; both affected cases pass afterward. Ruff
lint, formatting and Python compilation pass. Review and CI follow-up
use the queued workflows with `await_ci: false`.

Closes #4677 — automated triage

Co-authored-by: leaf-agent <[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