fix(tables): cmd+a always selects all cells on the table page#4562
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The new handler selects the full cell range even when focus is outside the grid, while explicitly skipping events originating from form controls, contenteditable regions, dialogs, and when the grid is in Reviewed by Cursor Bugbot for commit 2309ee7. Configure here. |
Greptile SummaryThis PR fixes Cmd+A on the tables page by promoting the select-all keyboard handler from a container-scoped listener to a
Confidence Score: 5/5Safe to merge — a focused, well-guarded change that correctly widens the Cmd+A shortcut scope without breaking any existing keyboard behaviour. The change is a straightforward relocation of an existing handler from a container element to the document, with additional guards (contentEditable, dialog) that are strictly more defensive than before. The previously reported bug (preventDefault on an empty grid) is confirmed fixed. No other shortcuts or state paths are touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User presses Cmd+A] --> B{embedded mode?}
B -- Yes --> Z[Skip - no-op]
B -- No --> C{target is INPUT / TEXTAREA / SELECT?}
C -- Yes --> Z
C -- No --> D{target.isContentEditable?}
D -- Yes --> Z
D -- No --> E{inside open dialog?}
E -- Yes --> Z
E -- No --> F{containerRef exists?}
F -- No --> Z
F -- Yes --> G{rows and cols non-empty?}
G -- No --> Z2[Skip - grid empty, native Cmd+A preserved]
G -- Yes --> H[Suppress default]
H --> I[Clear editing cell and row selection]
I --> J[Set anchor to row 0 col 0]
J --> K[Set focus to last row and col]
K --> L[All cells selected]
Reviews (2): Last reviewed commit: "fix(tables): move preventDefault inside ..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 2309ee7. Configure here.
Summary
Type of Change
Testing
Tested manually
Checklist