Skip to content

fix: delete-area hit testing at non-default zoom (#10095)#10096

Merged
mikeharv merged 5 commits into
RaspberryPiFoundation:mainfrom
mikeharv:zoom-delete
Jul 2, 2026
Merged

fix: delete-area hit testing at non-default zoom (#10095)#10096
mikeharv merged 5 commits into
RaspberryPiFoundation:mainfrom
mikeharv:zoom-delete

Conversation

@mikeharv

@mikeharv mikeharv commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10095

Proposed Changes

Hit-test delete areas now us client/viewport coordinates (clientX/clientY) instead of a client-to-workspace-to-client round-trip

Reason for Changes

After #10078, delete styling would still appear at non-default zoom but blocks were not reliably deleted and the trashcan lid did not animate. The coordinate round-trip misaligned hit tests with getBoundingClientRect() at certain zoom levels, but using client coordinates fixes that.

Test Coverage

  • Extended dragger_test.js with generated trashcan/toolbox delete tests at zoom 0.7 and 1.5 (delete style, trashcan lid, disposal)
  • Generated extra mutator workspace tests with a zoomed parent workspace (delete on pointer-over-area; no false positive on origin-only overlap). Unrelated to bug report, but felt useful enough to add.

@mikeharv mikeharv requested a review from a team as a code owner July 2, 2026 16:23
@mikeharv mikeharv requested a review from lizschwab July 2, 2026 16:23
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jul 2, 2026
@mikeharv

mikeharv commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

CI on this PR is failing because main has a package.json / package-lock.json override mismatch (npm ci missing eslint@10.3.0 / prettier@3.8.3). That is unrelated to the delete-area fix.

I opened a separate chore PR to fix main for everyone: #10097

I rebased zoom-delete onto that fix so Node.js CI should pass here once the re-run completes.

@lizschwab lizschwab 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.

Looks good once we get CI happy again

@mikeharv mikeharv merged commit 9f4f1c1 into RaspberryPiFoundation:main Jul 2, 2026
4 checks passed
@mikeharv mikeharv deleted the zoom-delete branch July 2, 2026 18:41
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.

Deleting blocks via dragging does not work anymore when zoom isn't on default

2 participants