Repository navigation
test(ui-test): press again the keys the IDE discards - #152
Merged
Merged
Conversation
The markdown cell's Escape never reached either IDE's key dispatcher, with the cell's editor the focus owner, the frame focused, the robot holding the input focus, no popup, no drag, and the client's EDT idle. It was never delivered. While the IDE waits on a lock it draws a freeze overlay, and for as long as that is up `SuvorovProgress` installs an `EventStealer`, whose `IdeEventQueue` post listener takes every key press out of the queue and returns true, so the event is dropped before it is so much as counted. It never puts them back. That is deliberate: a freeze must not end in a burst of input the user has stopped meaning. The driver's robot posts into that same queue -- it fabricates events rather than driving the display -- so its keys are discarded with the user's. The stealer passes `KEY_TYPED` through, which is why the typing that goes in a second earlier lands and the readiness wait passes; Escape carries no character, only `KEY_PRESSED` and `KEY_RELEASED`, so it is taken whole and leaves no trace. Pressing once and waiting cannot work, because the key is gone rather than late. Press again until the cell renders, as a user does when the IDE has eaten one. A key that arrives and does nothing still fails at the timeout, so this hides nothing about what Escape is meant to do. Closes #113
The snippet test sent Tab and the body text in one block. When the Tab
was discarded -- the IDE was waiting on a lock, so the freeze overlay's
stealer took the key press out of the queue -- the typing that followed
went in where the placeholder ended: `PROBE Widgetbody {`, with the
body stop left empty.
Press it on its own and wait for the caret to reach the body stop,
pressing again if it never arrives, before typing into it. Typing is
not affected, since a character carries the `KEY_TYPED` the stealer
leaves alone; see [pressUntil].
This is not #130, where the Tab arrived and overtook the typing. Here
the typing was already confirmed on the backend and the Tab did
nothing at all.
Closes #153
This was referenced Nov 10, 2026
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
Closes #113, and closes #153. The markdown cell's Escape is not lost by anything in CodeBridge — it is never
delivered, because the platform throws it away on purpose.
While the IDE waits on a lock it draws a freeze overlay, and for as long as that is up
SuvorovProgressinstalls anEventStealerwhoseIdeEventQueuepost listener takes every keypress out of the queue and returns true.
doPostEventthen drops the event before it is so muchas counted, let alone dispatched.
SuvorovProgressnever callsdrainUndispatchedInputEvents, sowhat it takes is gone. That is deliberate: a freeze must not end in a burst of input the user has
stopped meaning. The defaults make it ordinary —
ide.suvorov.progress.kind=[None|Bar|Overlay|NiceOverlay*],ide.suvorov.progress.showing.delay.ms=1000.The driver's robot posts into that same queue rather than driving the display
(
driver.robot.use.input.events=true, which is also why the recorded pointer never moves off960,540), so its keys are discarded alongside a user's.That explains the one observation no other theory could. The stealer passes
KEY_TYPEDthroughand takes only
KEY_PRESSEDandKEY_RELEASED. A character carries all three and the editorinserts from the typed one, so
typeText("# Top")lands and the readiness wait passes. Escapecarries no character, so it is taken whole — and the previous round's diagnostic had already shown
it reaching neither IDE's dispatcher with the cell focused, the frame focused, the robot holding
the input focus, no popup, no drag, and the client's EDT idle.
So pressing once and waiting cannot work: the key is gone, not late.
pressUntilpresses againuntil the cell renders, which is what a user does when the IDE has eaten a keystroke. A key that
arrives and does nothing still fails at the timeout, having pressed rather than waited, so nothing
about what Escape is meant to do is hidden.
betweenis 15s, comfortably longer than rendering a cell, so a slow success is never pressedover — a second press after the first has been acted on would be a keystroke the test never meant
to send.
The same key, in the snippet test
The second commit fixes a second site, found while reading #149's twenty-job batch. In
run 42728115535,
Snippet selection (windows-2025, repeat 8/10)observed[first, PROBE Widgetbody {, , }]—bodytyped onto the end of the placeholder, the bodystop left empty. The Tab between them did nothing, after the step before had already confirmed
the typed placeholder on the backend.
Same signature, and the clearest confirmation of the mechanism outside the notebook: a
key(...)lost between two
typeText(...)calls that both landed.key(VK_TAB)posts onlyKEY_PRESSEDand
KEY_RELEASED, which is exactly what the stealer takes. Filed as #153.There the Tab is pressed on its own, and waited on by the caret reaching the body stop, before the
body text is typed. That is also why
pressUntilsuits it: a Tab that never arrived can bepressed again safely, whereas typing again would duplicate text.
Why a helper, and why it is not used everywhere
The hazard belongs to every synthetic keystroke in these tests, not to this one, so the reasoning
lives in one documented place rather than in a comment here. It is applied only at the site that
is known to fail; the rest are left alone rather than churned on a guess.
It may be worth re-reading some earlier fixes in this light —
989aec7 test(ui-test): choose switcher items without key input,3cd7194 test(ui-test): activate cell menus with the keyboard,740ddea test(ui-test): hand a page its undo keys on Windows— all worked around a key that didnot arrive. This is a mechanism that would produce exactly that, and
SplitModeSnippetsTest > a contributed snippet completes…is still failing intermittently. I havenot changed any of them: none has the evidence this one now has.
How it was tested
:ui-test:compileTestKotlinpasses for both commits.exit value 127under NixOS),and the failure has only ever appeared on CI.
Worth re-running the
ci-flake/escape-*branches on this to confirm, rather than reading onegreen run as proof.
or trimmed to whichever of its readings are worth keeping.
Checklist
A new feature has a UI test.A fix to an existing UI test.internals:
SuvorovProgressandEventStealerare named in the explanation only, and thetest presses a key through the driver as before.
No behaviour change.docs/is updated where behaviour changed,docs/status.mdespecially.Third-party material keeps its notice and is listed inNone added.NOTICE.md.