Skip to content

test: update three undo and panel-search tests for z taking back messages - #5538

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-5484
Nov 5, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-5484

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Three browser tests have failed on main since #5320 ("Let z take back a sent message or reaction"). #5320 made two changes they didn't account for. The user's newest comment or reply became a gesture z takes back, and the menu's Undo row names it by its words. Also, a gesture the agent has picked up no longer makes z show it first. All three tests expected the behavior #5320 replaced, so this updates the tests and leaves the code alone.

  • test_z_takes_back_the_thread_the_user_just_resolved asserted that z was offered nothing before and after the undo. The page's fixture comments are the user's own, so the newest of them is now an undoable gesture. The two offer checks go. The test still checks that z writes an undo naming the user's resolve and no unresolve, and that the agent's resolve stays closed (the open count is 2).
  • test_another_key_or_a_scroll_away_puts_the_shown_gesture_back_to_showing wrote a pickup so that, after j, a press on the choice in view would show it again. Under Let z take back a sent message or reaction, whatever the agent has done with it #5320 that press takes it, so the pickup and the key steps go, and the test becomes test_a_scroll_away_puts_the_shown_gesture_back_to_showing. Another key ending the arm is still covered by test_a_key_between_ends_what_the_shown_gesture_promised, where the difference is visible: the newer gesture is taken, not the shown one.
  • test_the_menu_s_search_finds_rows_threads_and_commands searched for "window long". The first row found was now Undo: commented “Is the window long enough?”, so Enter took the comment back instead of opening the thread, and the Back button read "Back to Threads". The thread is now the agent's, so the search finds the thread row first and Enter opens it. This also clears the teardown's unchanged write: hidden on div.lf-fp-quick, which came from that path.
  • test_a_modifier_between_keeps_what_the_shown_gesture_promised is new. The scroll test's Shift press was the only check that a modifier alone keeps the arm (KEYS_HELD in browser/runtime/undo.js), and with the choice in view it could no longer show that. The new test uses the setup of test_a_key_between_ends_what_the_shown_gesture_promised and presses Shift where that test presses ArrowRight, so the next z takes the shown old resolve and not the newer one. It fails with Shift removed from KEYS_HELD.

All three fail on 479914c4b (main when this branch was cut) and pass with this change: uv run pytest --run-main on the three node ids, plus test_a_key_between_ends_what_the_shown_gesture_promised. The new test passes.

Closes #5484 — automated triage

…ages

#5320 made the user's newest comment or reply a gesture `z` takes back, and
dropped the rule that `z` first shows a gesture the agent picked up. Three
browser tests still expected the old behavior:

- test_z_takes_back_the_thread_the_user_just_resolved asserted `z` was offered
  nothing on a page whose fixture comments are the user's own, which is now
  their newest undoable gesture. The test drops those two offer checks; it
  still checks that `z` writes an undo naming the resolve, no unresolve, and
  leaves the agent's resolve in place.
- test_another_key_or_a_scroll_away_puts_the_shown_gesture_back_to_showing
  relied on a pickup to make an in-view press show the choice after another
  key. With the choice in view the press now takes it, so the key steps and
  the pickup go, and the test is renamed for the scroll case it still checks.
  test_a_key_between_ends_what_the_shown_gesture_promised covers another key
  ending the arm.
- test_the_menu_s_search_finds_rows_threads_and_commands searched for a user's
  thread, and the menu's Undo row, naming that comment's words, came first, so
  Enter took the comment back. The thread is now the agent's.

Closes #5484

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dropping the Shift press leaves the modifier exemption untested. onUserInput in browser/runtime/undo.js keeps the arm through a keydown in KEYS_HELD ("Shift", "Control", "Alt", "Meta", "CapsLock", "Fn"), and the old step in this test was the only one that exercised it; no other test in tests/browser/ presses a bare modifier between two zs. If that exemption were removed, a user reaching for Shift after the first z would end the arm and the second z would take the newest gesture rather than the one just shown, and the suite would stay green.

The setup in test_a_key_between_ends_what_the_shown_gesture_promised, an old resolve shown with a newer one behind it, makes the difference visible: press Shift where that test presses ArrowRight, and the next z takes the shown resolve. I'll push that as a sibling test.

The scroll test's Shift step was the only check of undo.js's KEYS_HELD
exemption; with the choice in view it could no longer tell the arm held,
so it was dropped. This sibling of the key-between test shows the
difference: after Shift, z takes the shown old Resolve, not the newer one.
It fails with Shift removed from KEYS_HELD.
@max-sixty
max-sixty merged commit 86e3c10 into main Nov 5, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/issue-5484 branch November 5, 2026 20:29
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.

Three undo and panel-search tests fail on main since #5320 let z take back a sent message

2 participants