Move frame plugin UX improvements - #886
Conversation
🦋 Changeset detectedLatest commit: 05daa7d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
Claude (@claude) review |
|
Claude finished Micheal Parks (@micheal-parks)'s task in 4m 32s —— View job PR Review
Overall this is a high-quality rewrite. The architectural choices are sound — gizmo ownership via a module singleton, Issues to addressFragile module-level scratch in Ghost colour duplicated (inline comment on NitsGC pressure at drag-frame rates (inline comments on Misleading function name (inline comment on
Map semantics in Looks good ✓
|
| import { RefreshRates, useSettings } from '$lib/hooks/useSettings.svelte' | ||
| import { Pose } from '$lib/math' | ||
|
|
||
| const tempPose = new Pose() |
There was a problem hiding this comment.
Module-level scratch variable shared across all instances of useMovedFrameMatrix. If two panels are open simultaneously, their $derived computations run sequentially (Svelte 5 is single-threaded), so there's no actual corruption — but it's fragile coupling. Move tempPose inside the function body to make each call site fully independent:
| const tempPose = new Pose() | |
| export const useMovedFrameMatrix = ( | |
| partID: () => string, | |
| frameName: () => string, | |
| enabled: () => boolean | |
| ): MovedFrameMatrix => { | |
| const settings = useSettings() | |
| const client = useRobotClient(partID) | |
| const tempPose = new Pose() |
| interface Props { | ||
| /** Where the frame is right now — world space, metres. */ | ||
| currentWorldMatrix: Matrix4 | ||
| /** Where the gizmo has staged it — world space, metres. */ |
There was a problem hiding this comment.
The ghost colour '#37a06f' is also hardcoded verbatim in moveGhosts.ts:31. They'll drift apart on the first colour tweak. Extract to a shared constant (e.g. in a moveGhostColor.ts or at the top of moveGhosts.ts and re-exported).
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Overview
Updates the move frame plugin to allow much more flexibility. Users can now drag around the moved frame to translate and rotate it in world / local space. Additionally, users can tweak final values in the floating pane for fine grained edits.
A ghost image of the destination of the the frame and all of its children now shows as the user chooses the desired destination spot. This will be a very useful first step ux-wise for users who want to avoid collisions during movement.