feat: asset drag-into-viewport with ground-raycast drop point#35
Merged
Conversation
Custom pointer drag (Tauri dragDropEnabled=true suppresses HTML5 ondrop) → ghost follows cursor → drop on canvas raycasts y=0 ground plane → new node at hit x/z, keeping the library item's default y. Double-click add-at-default preserved. Pure fns screenToNdc/dropPositionFor/ findLibraryItem (lib layer so runtime adapter can reuse). Undoable via AddNodeCommand. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Automated verification on latest commit (
Roadmap updated: v0.4 "资源拖拽入视口 + 落点" marked done. |
Owner
Author
|
✅ Visual smoke ( |
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
Drag a library card into the viewport to add a node at the drop point (ground y=0 raycast x/z, keeping the item's default y). Existing double-click add-at-default is preserved.
screenToNdc+dropPositionFor(src/lib/drop-helpers.ts)catalog.findLibraryItem(id, uploads)adapter.raycastGroundPoint(x,y)→ y=0 plane hit | nullui-store.assetDragItemId+ start/end actionsasset-drag.tspointer controller (5px threshold → activate)AssetDragGhostcursor-following DOM ghostThreeViewportwindow pointerup → drop → AddNodeCommand (undoable)Why
Backlog item split from v0.2 library; user-ordered after v0.4 sub-stage B (#34). Tauri
dragDropEnabled=truesuppresses HTML5 ondrop → custom pointer drag.How to test
pnpm tauri dev: ⌘/Ctrl+J → drag a geometry/light/glb card into viewport → node lands at cursor's ground point; ghost follows; release outside canvas cancels; pure double-click still adds at default; Cmd+Z undoes. Pure fns:pnpm test(drop-helpers + findLibraryItem green).🤖 Generated with Claude Code