Skip to content

Conversation

@gonfunko
Copy link
Contributor

The basics

The details

Resolves

Fixes #9180

Proposed Changes

This PR fixes a bug that could cause shadow blocks to temporarily or permanently become selected when clicked on. Clicking on a block triggers a block start gesture, which correctly handles shadow blocks when determining what to select (their parent block). Click events bubble up to the workspace and trigger a workspace start gesture as well though, and that was focusing the start block, which is sometimes different than the target block that the block gesture start handler resolves. I updated the check for "nothing else should be focused" to check targetBlock rather than startBlock, and removed the explicit call focus the target/start block, since that would have already happened in the block start gesture handler.

I verified that shadow blocks still become selected via keyboard navigation, that clicking a shadow block focuses its parent block, that workspace comments and bubbles are still selectable, and that clicking the workspace focuses the workspace.

@gonfunko gonfunko requested a review from a team as a code owner December 22, 2025 17:14
@gonfunko gonfunko requested a review from BenHenning December 22, 2025 17:14
@github-actions github-actions bot added the PR: fix Fixes a bug label Dec 22, 2025
@rachel-fenichel
Copy link
Collaborator

I verified that shadow blocks still become selected via keyboard navigation, that clicking a shadow block focuses its parent block, that workspace comments and bubbles are still selectable, and that clicking the workspace focuses the workspace.

Please add automated tests for these cases.

Copy link
Collaborator

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Nice find. Is it possible to test the specific scenarios that were breaking?

Edit: Asked this 8 minutes after Rachel did. :)

@BenHenning BenHenning assigned gonfunko and unassigned BenHenning Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shadow block selection is inconsistent

4 participants