fix(editor): store scans locally without host uploads - #726
fix(editor): store scans locally without host uploads#726anisayakmitra-in wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0a6549d. Configure here.
| setSelectedReferenceId(scan.id) | ||
| setSelection({ selectedIds: [], zoneId: null }) | ||
| useUploadStore.getState().setResult(levelId, url) | ||
| window.setTimeout(() => useUploadStore.getState().clearUpload(levelId), 600) |
There was a problem hiding this comment.
Uploaded scan can stay hidden
Low Severity
The new local scan success path selects the created ScanNode but never calls setShowScans(true). The guide-image path in the same handler does call setShowGuides(true). If showScans is off (a persisted per-project preference), the scan appears in the tree while ScanRenderer keeps the mesh unmounted, so the upload can look like it failed.
Reviewed by Cursor Bugbot for commit 0a6549d. Configure here.


Summary
Fixes the self-hosted scan upload path, which currently accepts a file and then silently does nothing when a host upload callback is absent.
Details
Fixes #645
Validation
Note
Low Risk
Scoped editor upload branching and local asset creation; host upload path is preserved when a callback is supplied.
Overview
Fixes scan uploads doing nothing in setups that do not provide a host
onUploadAssetcallback (e.g. self-hosted editor). GLB/glTF files now follow the same local path as guide images: persist viasaveAsset(IndexedDB), create a ScanNode on the level, select it, and drive the existing upload UI through success/error states.Adds
createLocalScan(plus shared filename helpers) inlocal-guide-image.ts, with a unit test. When a host callback is present, behavior is unchanged except the scan handoff callsonUploadAssetdirectly after the project-id guard.Reviewed by Cursor Bugbot for commit 0a6549d. Bugbot is set up for automated code reviews on this repo. Configure here.