Skip to content

fix: Ensure flyout remains open after creating a variable with mouse - #8982

Merged
BenHenning merged 1 commit into
RaspberryPiFoundation:rc/v12.0.0from
BenHenning:ensure-flyout-remains-open-after-creating-a-variable-with-mouse
May 5, 2025
Merged

fix: Ensure flyout remains open after creating a variable with mouse#8982
BenHenning merged 1 commit into
RaspberryPiFoundation:rc/v12.0.0from
BenHenning:ensure-flyout-remains-open-after-creating-a-variable-with-mouse

Conversation

@BenHenning

@BenHenningBenHenning commented May 3, 2025

Copy link
Copy Markdown
Collaborator

The basics

The details

Resolves

Fixes#8976

Proposed Changes

Only auto-close the flyout if focus is being lost to a known tree.

Reason for Changes

I noticed from testing that the system does attempt to restore focus back to the flyout after creating a variable but the auto-closing logic was kicking in due to focus being lost with the variable creation prompt open. Even though an attempt was made to restore focus, this doesn't automatically reopen the flyout (since it is primarily governed by the toolbox selection state).

One alternative might be to try and save the previously selected toolbox category and restore it, but that's tricky. This seems simpler, and also seems to largely maintain parity with pre-focus manager Blockly. Clicking outside of the toolbox with the flyout open only closes it if the click is within the toolbox itself or within the workspace.

Test Coverage

No new tests were added. However, it may be worth considering this specific case for future tests added with #8915.

Documentation

No new documentation seems necessary here.

Additional Information

None.

@BenHenning
BenHenning requested a review from a team as a code ownerMay 3, 2025 00:07
@BenHenning
BenHenning requested a review from RoboErikGMay 3, 2025 00:07
@BenHenningBenHenning added the PR: fix Fixes a bug label May 3, 2025
@BenHenningBenHenning linked an issue May 3, 2025 that may be closed by this pull request
1 task
@BenHenning

Copy link
Copy Markdown
CollaboratorAuthor

Enabling auto-merge. Please only approve if you're happy with this being merged.

@BenHenning
BenHenning enabled auto-merge (squash) May 3, 2025 00:42
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fixFixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After creating a variable by mouse, the flyout closes.

2 participants

@BenHenning@RoboErikG