Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Codify component weights with toolbox in front of flyouts. #8432

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

johnnesky
Copy link
Member

The basics

The details

Resolves

Fixes #8417

Proposed Changes

I created an enum codifying the weights for the flyout, toolbox, trashcan, and zoom buttons, and provided weight values that give the toolbox higher precedence than the flyout.

Reason for Changes

When the pointer is dragging a block from the workspace to a toolbox or flyout, the drag target areas may overlap, in which case we should decide which should take precedence and handle the event. The flyout's drag area intentionally extends beyond its own bounds, but if the toolbox is also present, then the flyout's bounds include the toolbox. Currently, the flyout and the toolbox have the same weight but the flyout happens to be found first and effectively takes precedence. However, it would be more intuitive for the toolbox to take precedence when the pointer is over it, so I'm giving the toolbox a higher precedence.

Test Coverage

Existing tests pass. I manually tested that the CSS issue from #8417 is resolved.

Documentation

N/A

Additional Information

I did not mark this as a breaking change, but if anyone can think of a reason why users might be depending on the current weights assigned to the flyout, toolbox, trashcan, and zoom buttons, then this should be a breaking change. Previously, the weights were all 1 except the zoom buttons which were 2. I've now assigned different weights to all of them.

@johnnesky johnnesky requested a review from a team as a code owner July 27, 2024 00:53
@johnnesky johnnesky requested a review from gonfunko July 27, 2024 00:53
@github-actions github-actions bot added the PR: fix Fixes a bug label Jul 27, 2024
@gonfunko gonfunko merged commit e2310a4 into google:develop Jul 29, 2024
11 checks passed
@johnnesky johnnesky deleted the nesky_component_weight branch August 2, 2024 17:00
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.

Unable to trigger Toolbox's Block delete style
2 participants