Skip to content

Let a read-only view search: Enter in a field is not a grid gesture - #22

Merged
ww-mw merged 1 commit into
mainfrom
fix/readonly-enter-swallows-search
Sep 18, 2026
Merged

ww-mw merged 1 commit into
mainfrom
fix/readonly-enter-swallows-search

Conversation

@ww-mw

@ww-mw ww-mw commented Sep 18, 2026

Copy link
Copy Markdown
Member

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, .mat and .prj the keystroke died one element above the search box and the filter did nothing at all. .sldd looked 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 isTypingInField and 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.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.

Verified: npm run typecheck clean, 2480 unit tests pass, and the shipped dist/webview/table.js was driven in Chromium against real .slx and .mat payloads — search commits, chips render, matches highlight, and the header popup applies on Enter.

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.
@ww-mw
ww-mw merged commit 6935d54 into main Sep 18, 2026
1 check passed
@ww-mw
ww-mw deleted the fix/readonly-enter-swallows-search branch September 18, 2026 14:57
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