Skip to content

fix(editor): store scans locally without host uploads - #726

Open
anisayakmitra-in wants to merge 1 commit into
pascalorg:mainfrom
anisayakmitra-in:fix/local-scan-upload
Open

fix(editor): store scans locally without host uploads#726
anisayakmitra-in wants to merge 1 commit into
pascalorg:mainfrom
anisayakmitra-in:fix/local-scan-upload

Conversation

@anisayakmitra-in

@anisayakmitra-in anisayakmitra-in commented Aug 28, 2026

Copy link
Copy Markdown

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

  • Stores local GLB and glTF uploads through the existing IndexedDB asset storage.
  • Creates and selects the corresponding ScanNode on the active level.
  • Retains the existing host upload flow when a callback is supplied.
  • Adds coverage for local scan asset creation.

Fixes #645

Validation

  • bun test packages/editor/src/lib/local-guide-image.test.ts
  • bun run --filter @pascal-app/editor check-types
  • bun run --filter @pascal-app/editor test (760 pass)
  • biome check on the changed implementation files

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 onUploadAsset callback (e.g. self-hosted editor). GLB/glTF files now follow the same local path as guide images: persist via saveAsset (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) in local-guide-image.ts, with a unit test. When a host callback is present, behavior is unchanged except the scan handoff calls onUploadAsset directly 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0a6549d. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Self-hosted editor: scan upload button is a silent no-op (onUploadAsset never wired locally)

1 participant