Repository navigation
Cancel the iframe shim's pending leader tap when another key is pressed - #1372
Open
dormouse-bot wants to merge 1 commit into
Open
dormouse-bot wants to merge 1 commit into
dormouse-bot wants to merge 1 commit into
Conversation
The shim's dual-tap detector never reset between Shift or Meta taps, so typing a left-Shift capital, a word, then a right-Shift capital inside a proxied iframe posted 'leader' and dropped the pane out of passthrough. The Wall's own detector already resets on any other key.
Deploying mouseterm with
|
| Latest commit: |
5698be5
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://51771abd.mouseterm.pages.dev |
| Branch Preview URL: | https://fix-iframe-shim-leader-reset.mouseterm.pages.dev |
This branch has not been deployed
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.
Typing in a proxied iframe Surface could drop the pane out of passthrough. The injected shim posts
leaderon a left-then-right Shift (or Meta) tap within 500 ms, but its detector never cleared a pending tap when another key came in between. So typing "I Am" into a text field in the frame (left Shift for theI, right Shift for theA) read as the chord, and the Wall'sleaderhandler inuse-wall-keyboard.tscalledexitTerminalMode()mid-sentence. The Wall's own detector already resets on any other key.docs/specs/dor-browser.md→ "Iframe Shim" says a leader message "exits passthrough like an in-document dual-tap", so the shim now does the same reset.The same comment block in
iframe-proxy-rewrite.tssaid the shim posts four message kinds. It posts five, and the spec liststheme-requesttoo, so the comment now does as well.Verification: a new test in
lib/src/host/iframe-proxy-rewrite.test.tsdrives the shim'skeydownlistener through the existingshimFrameharness. It expectsleaderfor the bare Shift and Meta gestures and none when a letter or space falls between the taps. This sandbox has no pnpm, so I couldn't run vitest locally. Instead I ran the shim's source in anode:vmprobe built the same way as the harness: the gesture postsleadertwice before and after the fix, and the typing sequence posts it twice before the fix and zero times after. CI runs the vitest case.