Repository navigation
fix(planning): keep focus on a choice across a state push - #11932
Conversation
focusKey() rebuilt the focused control's selector from its id or data-* attributes. The Decide radios carry neither, so a state push that rebuilt #choices dropped focus to the body. The journey's "Answer again moves focus to the first choice" check failed whenever a push landed between the click and the check (main run 41311427851, PR #11912 run 41290672576 attempt 2). Radios now key on name and value, and the journey checks that a state push keeps focus on the same radio. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: PR #11932I found no security issues. I read every hunk of all 3 changed files. None of them match a trusted path, none is a plugin manifest, and none changes a trust control, a merge hold or a standing instruction.
The PR description contains no embedded instructions aimed at the review lane. There was no settled-threads file. critical-findings: 0 |
|
claude-review reviewed Code review: no findingsI read every hunk of all 3 changed files. None of them match a trusted-path glob.
Other checks
|
No related issue: main-red flake in test-bash (4)
Summary
plugins/planning/surface/surface-journey.test.shfailed intermittently intest-bash (4)on one check,ui_journey.2: Answer again moves focus to the first choice:The cause is a product bug, not a slow wait. Answer again focuses the first Decide radio synchronously. When a state push lands before the check reads focus,
applyrebuilds#choiceswithinnerHTMLand callsrestoreFocus(focusKey()).focusKey()builds its selector from the focused control'sidordata-*attributes, and the radios have neither, so it returnsnulland focus drops to<body>. The check's 5 suntilcannot recover focus that is already gone.Fix
plugins/planning/surface/index.htmlfocusKey(): a focused radio is keyed by itsnameandvalue(#choices input[name="choice"][value="N"]), so a state push puts focus back on the same choice.plugins/planning/surface/tests/ui_journey.js: after Answer again, the journey posts a note, waits for the resulting state frame, and checks that focus is still on the same radio. Before the fix this check failed on every run (PASS=256 FAIL=1, focus onBODY), so the race is now covered deterministically rather than by luck of timing..changes/planning/.Verification
BODY. The original "Answer again" check passed in that run. The CI flake rate was not reproduced locally; what was reproduced, every time, is the mechanism.surface-journey.test.shpassed 10 of 10 runs locally, eachPASS=257 FAIL=0. 6 runs were sequential and 4 ran two at a time to load the host the way the shard does; each server binds a free port. The first sequential run usedsettle(300)on the new check, the other runssettle(2000).surface.test.sh, which holdsui_e.js's radio-focus checks, passed 1 run:PASS=164 FAIL=0 SKIP=1.Related
🤖 Generated with Claude Code