fix(user-input): atomic chip selection, modifier-key handling, and stale overlay ghost#4902
fix(user-input): atomic chip selection, modifier-key handling, and stale overlay ghost#4902waleedlatif1 wants to merge 13 commits into
Conversation
…ale overlay ghost
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Keyboard and deletion: Plain arrow chip-hop no longer intercepts Shift/Cmd/Alt/Ctrl arrows or IME composition; Cmd/Ctrl shortcuts pass through at chip edges; typing inside a chip is blocked without treating Space as insert text; Cmd+Backspace stays native. Chip delete in Mirror overlay / scroll: The textarea and highlight overlay share typography via Reviewed by Cursor Bugbot for commit e2dfe15. Configure here. |
… ranged selections
Greptile SummaryThis PR fixes three related UX bugs in the mention-chip textarea: selection edges now snap atomically to chip boundaries for every gesture (select-all, drag, Shift+arrows, double-click), modifier-key arrow/shortcut combos and IME composition are no longer intercepted by the chip-hop and type-block handlers, and the ghost-text overlay is eliminated by replacing the independently-scrolling mirror with a single native scroller that co-scrolls both the textarea and the overlay together.
Confidence Score: 5/5Safe to merge — the changes are well-scoped UI bug fixes with no data-path or API-route impact, and the core snap logic is covered by new unit tests. The chip-selection math is pure and fully unit-tested. The layout refactor replaces fragile JS scroll-sync with a single CSS scroller, which is simpler and harder to regress. Modifier-key guards are additive conditions on existing event handlers with no side-effects when the new guard is false. No state-management, persistence, or network paths are touched. No files require special attention. The copilot use-mention-tokens.ts switch to execCommand is the most novel change, but the behavior is equivalent to the prior string-manipulation approach and the deprecation trade-off is acknowledged in comments. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant SCL as selectionchange listener
participant prevRef as prevSelectionRef
participant HSA as handleSelectAdjust
participant snap as snapSelectionToChips
participant DOM as textarea DOM
User->>Browser: gesture
Browser->>DOM: update selectionStart and selectionEnd
Browser->>SCL: fire selectionchange
SCL->>prevRef: store previous last into prevRef then capture current
Browser->>HSA: fire onSelect or onMouseUp
HSA->>DOM: read start and end
HSA->>prevRef: read prev
HSA->>snap: snapSelectionToChips with sel prev startChip endChip
alt edge inside chip
snap-->>HSA: snapped differs from sel
HSA->>DOM: setTimeout setSelectionRange with snapped and dir
DOM->>SCL: fire selectionchange on snap write
SCL->>prevRef: update prevRef to pre-snap value
DOM->>HSA: fire onSelect again
HSA->>snap: already snapped noop
HSA->>DOM: syncMentionState and syncSlashState
else no chip hit
snap-->>HSA: snapped equals sel noop
HSA->>DOM: syncMentionState and syncSlashState
end
Reviews (7): Last reviewed commit: "docs(user-input): trim verbose comments ..." | Re-trigger Greptile |
|
@greptile review |
|
@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 1a2e63f. Configure here.
|
@greptile review |
|
@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 6997d3e. Configure here.
|
@cursor review |
|
@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 7c3e298. Configure here.
|
@cursor review |
|
@greptile |
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 5b02798. Configure here.
|
@cursor review |
|
@greptile review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 31c66fa. Configure here.
…deletion undoable
|
@cursor review |
|
@greptile 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 d505023. Configure here.
|
@cursor review |
|
@greptile review |
… unsupported (Firefox)
|
@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 e2dfe15. Configure here.

Summary
Type of Change
Testing
Tested manually (selection matrix: select-all, drag grow/shrink, shift-arrow grow/shrink across chips, cmd+shift jumps, double-click, click-in-chip caret snap). Typecheck and lint pass.
Checklist