Let a read-only view search: Enter in a field is not a grid gesture - #22
Merged
Merged
Conversation
The read-only gate swallowed every Enter in the capture phase to keep the inline cell editor shut. Since v1.24.0 Enter is also how a search commits, so on .slx, .mdl, .mat and .prj the keystroke died one element above the search box and the filter did nothing at all. .sldd was fine because it is editable, which is exactly the shape the bug was reported in. The header column-filter popup, which applies on Enter, was the second victim. The sibling cut/copy/paste guard already exempted text fields — one rule on two paths, and only one path knew it. Extract that test as isTypingInField and read it from both guards, so a key a field owns is never the table's to claim. Enter on the grid is still swallowed on a read-only document. Tests drive the listener that ships, not a copy of it: table-main.ts is imported with acquireVsCodeApi stubbed, then a read-only and an editable payload each get a real Enter in the search box and on the grid.
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.
The read-only gate swallowed every Enter in the capture phase, to keep the inline cell editor shut on a view. Since v1.24.0 Enter is also how a search commits — so on
.slx,.mdl,.matand.prjthe keystroke died one element above the search box and the filter did nothing at all..slddlooked fine because it is editable, which is exactly the shape the bug was reported in. The header column-filter popup, which applies on Enter, was the second victim.The sibling cut/copy/paste guard already exempted text fields — one rule on two paths, and only one path knew it. This extracts that test as
isTypingInFieldand reads it from both guards, so a key a field owns is never the table’s to claim. Enter on the grid is still swallowed on a read-only document, which is the whole point of the gate.Tests drive the listener that ships rather than a copy of it:
table-main.tsis imported withacquireVsCodeApistubbed, then a read-only and an editable payload each get a real Enter in the search box and on the grid.Verified:
npm run typecheckclean, 2480 unit tests pass, and the shippeddist/webview/table.jswas driven in Chromium against real.slxand.matpayloads — search commits, chips render, matches highlight, and the header popup applies on Enter.