Skip to content

Cancel selection gestures across foreground layers and focus loss - #3012

Closed
Tryanks wants to merge 1 commit into
longbridge:mainfrom
Tryanks:fix/selection-gesture-cancellation
Closed

Tryanks wants to merge 1 commit into
longbridge:mainfrom
Tryanks:fix/selection-gesture-cancellation

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

A foreground notification can consume mouse release while the window selection layer retains an active gesture. Moving the pointer afterward can unexpectedly extend text selection underneath it. Prevent gestures from starting through an occluding surface, and end an active gesture on captured left release, button-up movement, or window deactivation.

The change stays in the window selection owner. Proxy endpoints remain usable to extend a legitimate drag but cannot start one outside a hit participant. Activation observation is retained once per window selection state.

Validation:

  • Actual GPUI dispatch regression failed before the fix both for a consumed release leaving the gesture active and an occluder press arming selection underneath.
  • cargo test -p gpui-base --lib text_selection:: --locked: 46 passed.
  • Downstream real sidebar/dialog/popover/notification regression reproduced selection extending after focus loss; fixed downstream markdown suite: 56 passed, including link, copy, jitter and mixed-block behavior.
  • Native isolated signed Tcode app on macOS 26.6.2 arm64: Export as Markdown -> Copy -> close notification -> move pointer without buttons. Baseline selects chat text unexpectedly in both light/dark themes; fixed app does not. Legitimate cross-paragraph drag/release and native clipboard copy still work.
  • Native Story gallery and mid-drag OS focus-loss verification remain pending; activation cancellation is covered by dispatched tests. Retained final screenshots and lint checks will be added before readiness.

AI assistance: implementation and tests were AI-generated and refined against failing dispatched-event regressions, with independent agent review. Human review/testing required by CONTRIBUTING remains pending; this PR is a draft.

Downstream issue: Tryanks/tcode#360

@Tryanks

Tryanks commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, this PR was opened accidentally. Astra made this decision automatically while I was using the loop workflow to work on my own project. This PR has not been reviewed, so I am closing it. I will submit a new PR later with a complete root-cause analysis and after review.

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