Add 3MF export support (UI, exporter, and tests)#521
Add 3MF export support (UI, exporter, and tests)#521tracygardner wants to merge 2 commits intomainfrom
Conversation
Deploying flockxr with
|
| Latest commit: |
ed0d829
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://14454f68.flockxr.pages.dev |
| Branch Preview URL: | https://codex-add-3mf-export.flockxr.pages.dev |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds 3MF export support to flockXR.exportMesh: constructs a ThreeMfSerializer, calls SerializeToMemoryAsync on the mesh list, and downloads a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ExportMesh as flockXR.exportMesh
participant Serializer as ThreeMfSerializer
participant Serialize as SerializeToMemoryAsync
participant Download as flock.download
User->>ExportMesh: exportMesh(treeId, "3MF")
ExportMesh->>Serializer: new ThreeMfSerializer()
ExportMesh->>Serialize: SerializeToMemoryAsync(serializer, ...meshList)
Serialize-->>ExportMesh: Uint8Array output
alt Output present
ExportMesh->>Download: download(filename: `${mesh.name}.3mf`, data, "model/3mf")
Download-->>User: .3mf file
else No output
ExportMesh-->>ExportMesh: log "no output data produced"
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/xr-export.test.js`:
- Around line 121-132: The changed test file tests/xr-export.test.js is failing
Prettier; run the project's formatter on the modified files (e.g., npx prettier
--write or npm run format) to reformat the test and any related files so the CI
Prettier check passes, then re-stage the formatted changes — pay attention to
formatting around the mocked symbols like
flock.EXPORT.ThreeMf.SerializeToMemoryAsync, flock.EXPORT.ThreeMfSerializer,
flock.download, and the variables serializerInstance/serializeMeshes so no
lint/format differences remain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1a781241-c4a4-4453-af70-c5a689bfa391
📒 Files selected for processing (3)
api/xr.jsblocks/connect.jstests/xr-export.test.js
| const originalSerializeToMemoryAsync = flock.EXPORT.ThreeMf.SerializeToMemoryAsync; | ||
| const originalDownload = flock.download; | ||
|
|
||
| let serializerInstance; | ||
| let serializeMeshes; | ||
| let downloadedFile = null; | ||
|
|
||
| flock.EXPORT.ThreeMfSerializer = function MockThreeMfSerializer() { | ||
| serializerInstance = this; | ||
| }; | ||
| flock.EXPORT.ThreeMf.SerializeToMemoryAsync = async (serializer, ...meshes) => { | ||
| serializeMeshes = meshes; |
There was a problem hiding this comment.
Run Prettier on changed files to unblock CI.
The PR currently fails the Prettier check; please run formatting before merge.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@tests/xr-export.test.js` around lines 121 - 132, The changed test file
tests/xr-export.test.js is failing Prettier; run the project's formatter on the
modified files (e.g., npx prettier --write or npm run format) to reformat the
test and any related files so the CI Prettier check passes, then re-stage the
formatted changes — pay attention to formatting around the mocked symbols like
flock.EXPORT.ThreeMf.SerializeToMemoryAsync, flock.EXPORT.ThreeMfSerializer,
flock.download, and the variables serializerInstance/serializeMeshes so no
lint/format differences remain.
Deploying flockdev with
|
| Latest commit: |
ed0d829
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://825e3ae7.flockdev.pages.dev |
| Branch Preview URL: | https://codex-add-3mf-export.flockdev.pages.dev |
Motivation
Description
Codex Task
Summary by CodeRabbit
New Features
Tests