fix: furniture pick tool duplicates items instead of moving them - #293
Open
Ralphive wants to merge 1 commit into
Open
fix: furniture pick tool duplicates items instead of moving them#293Ralphive wants to merge 1 commit into
Ralphive wants to merge 1 commit into
Conversation
Picking a placed furniture item armed the placement tool with the item's type while leaving the original on the map, so the next click stamped a copy — and the tool stayed armed, stamping another copy on every subsequent click. The pick tool now remembers the picked item's uid and placement performs a single undoable move of that item (color preserved) instead of placing a clone. After the drop the tool disarms. Escape, switching tools, or choosing a catalog item cancels the carry without touching the layout. The placement ghost excludes the carried item from its own collision check, so dropping onto a spot overlapping the item's old footprint is valid. Stamping copies of catalog items is unchanged: picking from the palette still places new items and stays armed. Adds unit tests for the layout operations the flow relies on (move preserves uid/color and never duplicates, self-overlap allowed, overlap with other items rejected, excludeUid semantics).
|
@Ralphive is attempting to deploy a commit to the pablodelucca's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
Picking a placed furniture item with the Pick tool arms the placement tool with the item's type while leaving the original on the map. The next click stamps a copy, and because the tool stays armed, every further click stamps another one. Picking up an item to reposition it — the natural reading of "Pick" — instead duplicates it every time.
This PR makes picking from the map carry the actual item:
excludeUidtocanPlaceFurniture, so dropping onto a spot that overlaps the item's old footprint shows valid (green) and works.Placing from the catalog palette is unchanged: it still stamps new items and stays armed for repeated placement.
Type of change
Related issues
None found.
Screenshots / GIFs
Pick the stool, drop it two tiles away — it moves (no duplicate), and the tool disarms (the last click on empty floor places nothing):
Test plan
mainnpm run lint,npm run build,npm testall passwebview-ui/test/editorActions.test.tscover the layout invariants the flow relies on: move never duplicates and preserves uid/color, self-overlap allowed viaexcludeUid, overlap with other items rejected, walls/void/bounds rejected