Repository navigation
editor: a placed item stays selected through the click after its drop - #1054
Merged
Merged
Conversation
…ows its drop A surface `:click` is synthesized on pointer-up (use-node-events), so a placement that commits there (a floor drop whose ray lands on the site, a wall, an item host) still has the browser's own click to come. Since #1024 the editor is back in select mode by then, and the grid takes that click for one on empty ground: the new item is placed and immediately deselected, and its inspector never opens. The coordinator now eats that click when a non-repeating drop lands between a pointer-up and its click, as the press-drag release already did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Hosted pin for CI: pascalorg/private-editor#948 (re-pin to the merge commit once this merges). The sky spec's separate stale step is pascalorg/private-editor#947. |
…later click is not eaten The 300 ms timer that unregisters the swallow fired after the test file ended, where window is gone, and failed the run between tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A catalog item dropped on the ground of a new project is placed but left unselected, so its inspector never opens (hosted E2E
preset-capture-transparencyandproject-snapshot-skyfail on it since the #1024 pin).Why: a surface
:clickis synthesized on pointer-up (use-node-events). A placement that commits there (a floor drop whose ray lands on the site mesh, a wall, an item host) still has the browser's ownclickto come. Since #1024 the editor is back in select mode by the time that click arrives, anduseGridEvents→SelectionManager.onGridClicktakes it for a click on empty ground and callshandleDeselect. Traced in a local probe:finishCommittedPlacementselectsitem_…fromcommitFloorOnSurfaceClick(node:click), then the same press's DOM click deselects it fromSelectionManager.onGridClick. Bisected on the hosted pins: editorf88b020ekeeps the selection,18eb6392(#1024) and every pin since drop it.The coordinator now eats that click when a non-repeating drop lands between a pointer-up and its click, the way the press-drag release already did (
swallowNextClick, hoisted so both paths share it). A drop made by the click itself (grid:click) leaves the next click alone.How to test
bun test packages/editor/src/components/tools/item/placement-history.test.tsx(from the repo root here): the new "item placement selection" case fails without the coordinator change and passes with it.Screenshots / screen recording
N/A — the visible result is the inspector opening after a drop; verified through the hosted E2E below.
Checklist
bun dev(hosted Community dev server on this branch:preset-capture-transparency.spec.tspasses; it failed on the same step before)bun checkto verify) (biome check on the two files)mainbranchChecks run: biome on both files,
turbo check-typesfor@pascal-app/editor, the test file above (12 pass). Not run: the editor repo's full test suite.🤖 Generated with Claude Code
Note
Low Risk
Targeted input-event handling in the item placement coordinator with a new unit test; no auth, data, or broad selection refactors.
Overview
Fixes newly placed floor items losing selection (and the inspector not opening) when the drop commits on pointer-up via a synthesized surface
node:click, while the editor has already switched back to select mode.The placement coordinator hoists the existing
swallowNextClickhelper (previously only used for press-drag release) and tracks areleasingwindow between capture-phasepointerupand the browser’s followingclick.finishCommittedPlacementnow swallows that next DOM click when the commit happened in that window, so it cannot hit the grid as “empty ground” and deselect the item. Commits that are the click itself (grid:click) are unchanged.Adds a regression test in
placement-history.test.tsxthat simulates pointer-up placement and asserts selection is kept and the follow-up click is prevented (then allowed again after the swallow timeout).Reviewed by Cursor Bugbot for commit d960aa4. Bugbot is set up for automated code reviews on this repo. Configure here.