Skip to content

fix: Escape and hotkeys in test details, merge branch encoding, failing comment save - #436

Merged
pashidlos merged 10 commits into
masterfrom
claude/frosty-yalow-08cb06
Oct 24, 2026
Merged

pashidlos merged 10 commits into
masterfrom
claude/frosty-yalow-08cb06

Conversation

@pashidlos

@pashidlos pashidlos commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

While writing the tests in #434, we found four bugs and pinned the current behaviour with // NOTE: comments. This PR fixes them. Each fix starts by changing the pinned test to the expected behaviour and seeing it fail. The branch is rebased onto master after #434's squash merge.

  1. Escape closes the test details dialog. The MUI Dialog handled Escape itself and stopped the event, so the document-level useHotkeys("ESC") never saw it. The Dialog's onClose now acts on escapeKeyDown, using the same path as the close button, so unsaved ignore areas still ask first. Escape pressed in a text field stays with that field; _helpers/hotkeys.helper.ts#isTypingTarget checks for this.
  2. Hotkeys keep working after a click on "Toggle diff". react-hotkeys-hook skips keys in every form field, and the switch is a checkbox that keeps focus after a click. The dialog's hotkeys (arrows, D, A, X) now use a shared hotkeyOptions: they are enabled on form fields and ignored only in fields being typed into. A checkbox only takes Space, so it does not count.
  3. testVariationService.merge encodes branch names with encodeURIComponent, like builds.getList. There is a new e2e test with release/1.0&hotfix.
  4. A failing comment save keeps the box open. CommentsPopper had no rejection handler, and the dialog caught its own failure and resolved, so the box closed while the error showed. The dialog now rethrows after its error snackbar, and the popper keeps the box open with the draft. The e2e test now checks two animation frames after the error, instead of while the box was still fading out.

Follow-ups from review:

  • Escape inside the comment box closes only the box. This applies on Comments, Save and the editor. The draft is kept and the key goes no further. Without this, fix 1 would close the whole dialog and drop an unsaved comment from view.
  • Hotkeys while the variations review is open: this was not a regression. MatchingVariationsDialog already holds back a, x, d and the arrows with its own window listener. A new e2e test pins that with a checkbox in the review focused.

Also: the coverage floors in vitest.config.ts are raised to the current whole-number levels.

Checks (after the rebase onto master)

  • npm run lint: 0 errors. npm run typecheck: passes. npm test: 562 tests pass. npm run build: passes.
  • npm run test:pw:docker: 297/297 pass. No screenshot baselines changed.

🤖 Generated with Claude Code

Pavlo Strunkin and others added 9 commits October 24, 2026 15:08
The Escape hotkey listened on the document, but the MUI Dialog around the
details handles Escape itself and stops it, so a real key press never got
there. The Dialog's onClose now closes on escapeKeyDown, through the same
path as the close button, so unsaved ignore areas still ask first. Escape
typed into a text field, such as the comment, stays with the field, as the
other hotkeys do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… switch

The hotkey library skips keys pressed in any form field, and the "Toggle
diff" switch is a checkbox that keeps focus after a click, so D, the arrows,
A and X did nothing until focus moved elsewhere. The dialog's hotkeys now
take keys on form fields and leave out only the fields being typed into,
which a checkbox is not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
testVariationService.merge put both branch names into the query as they
were, so a "/" went raw and an "&" or "#" cut the name short and added a
stray parameter. They are now encoded, as builds.getList does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CommentsPopper chained no handler for a failing save, so a rejection went
unhandled, and the details dialog caught its own failure and resolved, so
the box closed and the draft was gone from view while the error showed. The
dialog now rethrows after its error snackbar and the popper keeps the box
open with the draft. The e2e test for this passed only while the box was
still fading out; it now checks after the fade.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SonarCloud flagged the 500 ms wait (S2925). A box that closes starts to fade
in the same update that shows the error, so its Paper's inline opacity
tells an open box from a closing one at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The details dialog's hotkeys now act on a focused checkbox, and the review
over it is full of them. Its own window listener already holds a, x, d and
the arrows back; this pins that, so the run behind cannot be approved,
rejected or stepped from inside the review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since Escape closes the details dialog, a press with focus on Comments,
Save or the editor went past the box and closed the whole dialog, so an
unsaved comment dropped out of view. The box now takes Escape while it is
open: it closes, keeps the draft, and the key goes no further.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The opacity check ran right after the error showed, so in principle it
could pass before a closing box had started to fade. It now waits two
animation frames first and checks Save is still there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pashidlos
pashidlos force-pushed the claude/frosty-yalow-08cb06 branch from a2a2839 to cf0f59f Compare October 24, 2026 12:13
The test for a branch name with / and & repeated the setup of the merge
test line for line, which SonarCloud counted as 5.7% duplicated new code
against a 3% gate. Both are now one test run over a table of branch
names, so the special name also gets the notice and redirect checked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@pashidlos
pashidlos merged commit f702493 into master Oct 24, 2026
3 checks passed
@pashidlos
pashidlos deleted the claude/frosty-yalow-08cb06 branch October 24, 2026 12:23
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.

1 participant