Repository navigation
ritmo-devtools keyboard: faster walk, waitFor steps, and no hang on a frozen page - #236
Merged
Merged
Conversation
…s, and a guard for a page that stops answering - focus-dropped presses on up to four pages at once; a press that did not keep focus is run again alone, and that result is the one reported. - A loaded screen is walked once it stops changing (no request in flight, same menu, focus, and controls for 400 ms), 1.5 s at the latest. - A route step waitFor waits up to 15 s for a named control to show. - A page that stops answering for 20 s is closed and reported as a page-error, so the walk fails instead of hanging. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
ritmo-devtools keyboard(merged in #234, not released yet) was slow becausefocus-droppedreloads the screen for every control it presses, one at a time, with fixed waits. This makes it faster without changing what it reports, and stops it from hanging.waitForroute step.{ "waitFor": { "role": "button", "name": "Play" } }waits up to 15 s for that control to show. It replaces a fixedwait, which is paid again for every control pressed.page-error, with that screen's checks not checked. The merged walk hung once on tabletop-grand-prix for over seven minutes with no output. I could not reproduce it in six more runs, so the cause is not confirmed; a frozen page is the likeliest one, and the new test freezes a page on purpose.There is no new flag. The changeset of #234 is amended, since the command is not released.
Acceptance: same report as the merged walk
Each game was walked with the merged walk once and with this one repeatedly, on clones, same route. Reports were compared byte for byte (port removed).
ui-sdk(6 screens)wait 2500towaitFor "Got it"tabletop-grand-prix gains nothing: none of its controls can be reached, so nothing is pressed, and its page keeps loading past the 1.5 s limit.
Limits
waitForstep. Before this change the same screen needed awaitwhenever the quiet moment passed 1.5 s.setTimeoutin the guard, with its reason on the line. A page that no longer answers cannot be timed by its own timers.Tests
test/KeyboardWalk.test.tsgains: the same report with one page and with three; a control shown 300 ms after load is seen, one shown after 2.5 s is reached only withwaitFor; a frozen page is reported and the next screen is walked;waitForin route parsing.pnpm run check(2,003 tests, Chromium ones included) andpnpm pack:checkpass locally.🤖 Generated with Claude Code