Skip to content

Clear the browser selection when Cmd/Ctrl + Click or Shift + Click starts a multiselection - #5466

Merged
raineorshine merged 3 commits into
mainfrom
copilot/fix-faux-caret-define-term
Sep 9, 2026
Merged

Clear the browser selection when Cmd/Ctrl + Click or Shift + Click starts a multiselection#5466
raineorshine merged 3 commits into
mainfrom
copilot/fix-faux-caret-define-term

Conversation

Copilot AI commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Running Define Term from the Command Universe on a Cmd + Click multiselection rendered a faux caret on every selected thought.

Cmd/Ctrl + Click and Shift + Click were the only multiselect entry points that left the caret in the clicked thought. isMultiEditing reads that stale caret as an edited multiselection (Clear Thought), so when the Command Universe restored the selection it saved on open, it re-focused the editable and the faux carets appeared. Define Term is incidental — dismissing the palette with Escape produces the same result, and executing the command directly produces none.

Changes

  • Thought.tsxhandleMultiselect clears the browser selection before toggling or extending the multicursors, as selectAll and cursorUp/cursorDown already do. The check runs before the dispatch, since afterwards the clicked thought is itself a multicursor and a caret still in it would read as multi edit mode. It is skipped while the multiselection is being edited, where clearing the caret would blur the thought and exit the cleared state.
  • multiselect.ts — Puppeteer regression test asserting no faux-caret-multicursor after Define Term runs on a Cmd + Click multiselection, plus an arrange-only acknowledgeAiDisclosure helper (the disclosure modal otherwise takes focus and masks the bug).
  • docs/cursor-and-caret.md — the click entry points now appear in the list that upholds the caret invariant, and the Command Universe is named alongside Copy Cursor as a surface that restores a saved selection.
dispatch((dispatch, getState) => {
  if (!isMultiEditing(getState())) selection.clear()
  dispatch(mouseEvent.shiftKey ? selectBetween({ path }) : toggleMulticursor({ path }))
})

Side effect worth noting in review: Backspace and Escape on a Cmd + Click multiselection previously deferred to the browser because isMultiEditing was wrongly true, and now take the multiselect path.

…ction

Co-Authored-By: GitHub Copilot CLI unknown <223556219+Copilot@users.noreply.github.com>

Co-authored-by: BayuAri <8419585+BayuAri@users.noreply.github.com>
…ck starts a multiselection

Co-Authored-By: GitHub Copilot CLI unknown <223556219+Copilot@users.noreply.github.com>

Co-authored-by: BayuAri <8419585+BayuAri@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix faux caret activation on Define Term command Clear the browser selection when Cmd/Ctrl + Click or Shift + Click starts a multiselection Sep 9, 2026
Copilot AI requested a review from BayuAri September 9, 2026 11:26

@BayuAri BayuAri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed fixed.
Faux caret does not activate on Define Term after manual selection.
This also fixes #5468

@BayuAri
BayuAri marked this pull request as ready for review September 9, 2026 12:15

@raineorshine raineorshine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@raineorshine
raineorshine merged commit f324781 into main Sep 9, 2026
12 checks passed
@raineorshine
raineorshine deleted the copilot/fix-faux-caret-define-term branch September 9, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants