fix(editor): compass needle follows align-north in 3D-only view#487
Conversation
When the 2D panel is hidden, align-north publishes a single '2d' pose that the camera applies through the echo-suppressed pending-pose path, so no '3d' poses ever reach the compass subscription and the needle stayed frozen. Drive the needle with a local rAF exponential decay (same 90ms time constant as the 2D view animation and the camera's effective smoothTime); a live '3d' pose cancels it and takes back ownership. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3693db1 to
cbcc705
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit cbcc705. Configure here.
| } | ||
| return | ||
| } else { | ||
| animateHiddenCompassNeedle(nextDeg) |
There was a problem hiding this comment.
Orbit cannot cancel needle animation
Medium Severity
After align-north with the floorplan hidden, animateHiddenCompassNeedle runs on the '2d' pose, but yielding to the camera relies on later '3d' poses calling cancelHiddenCompassAnimation. While the camera is still damping toward that '2d' target, publishCurrentNavigationPose keeps pendingFloorplanNavigationPose set and returns without publishing '3d', so orbiting mid-transition never cancels the local animation and the needle can keep moving toward north while the live camera diverges.
Reviewed by Cursor Bugbot for commit cbcc705. Configure here.
| } | ||
| if (nextDeg !== targetDeg) { | ||
| hiddenCompassAnimationRef.current = requestAnimationFrame(tick) | ||
| } |
There was a problem hiding this comment.
Stale compass state after animation
Medium Severity
Hidden-panel align-north drives the compass via animateHiddenCompassNeedle, which updates latestFloorplanUserRotationDegRef and the DOM but never floorplanUserRotationDeg. After the animation finishes, reopening the floorplan copies stale state into the ref and the compass northRotationDeg prop, so the needle can jump away from the heading shown in 3D-only mode. The reopen catch-up effect still syncs only 3d poses, so a lingering 2d navigation pose after hidden align does not refresh the floorplan view.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit cbcc705. Configure here.


What does this PR do?
Fixes the compass needle staying frozen when clicking align-north while only the 3D view is visible (2D panel hidden). The hidden-panel align-north branch publishes a single
'2d'navigation pose that the camera applies through the echo-suppressed pending-pose path — no'3d'poses ever flow back, so the needle subscription (which only reacted to'3d'poses) never moved it. In 2D and split view the open floorplan animates its own rotation, which is why those worked.The fix drives the needle with a local rAF exponential-decay animation when a
'2d'pose arrives while the panel is hidden, using the same 90 ms time constant as the 2D view animation and the camera's effective smoothTime, so camera and needle stay visually in step. A live'3d'pose (e.g. the user grabs the camera mid-transition) cancels the local animation and hands the needle back to the camera stream.How to test
bun dev, open a scene, and close the 2D floorplan panel so only the 3D view is visible.Screenshots / screen recording
N/A — 15-second behavior fix; reviewer steps above reproduce it directly.
Checklist
bun devbun checkto verify)mainbranchNote
Low Risk
Localized floorplan/compass navigation-sync behavior with no security or data impact; split and 2D-only paths are unchanged when the panel is open.
Overview
When the floorplan panel is closed, align-north only publishes a
'2d'navigation pose (the camera moves without returning'3d'frames), so the compass needle no longer updates if the subscription only handled'3d'poses.The hidden-panel branch now reacts to both pose sources:
'3d'still drives the needle imperatively and cancels any in-flight local animation;'2d'triggers a requestAnimationFrame exponential-decay rotation on the needle (same 90 ms time constant as the 2D view animation). Subscription cleanup cancels that animation on unmount.Reviewed by Cursor Bugbot for commit cbcc705. Bugbot is set up for automated code reviews on this repo. Configure here.