-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Goal
Add Quick Look Preview and Thumbnail extensions so Finder (and other system surfaces) can show previews and thumbnails for the app's supported 3D document types (e.g. .3mf or other project file types used by Cadova Viewer).
Background
Users expect file previews and thumbnails in Finder and Quick Look for 3D assets. The app already renders models with SceneKit; reusing rendering/parsing code in a small extension will provide high‑quality previews and thumbnails.
Scope
- Create two macOS app extensions:
- Quick Look Preview extension (NSExtensionPointIdentifier = com.apple.quicklook.preview)
- Quick Look Thumbnailing extension (NSExtensionPointIdentifier = com.apple.quicklook.thumbnail)
- Export and register UTIs for the app's document types in the main app and extensions.
- Share model parsing and scene setup code (move common code to a framework target or a shared source folder).
- Implement:
- Preview: present an interactive (or static) SceneKit snapshot for the document.
- Thumbnail: render a small SceneKit snapshot suitable for QLThumbnailing API.
- Add automated tests where feasible (unit tests for parsing/shared logic).
Tasks
- Add new targets in Xcode:
- File > New > Target > macOS > App Extension > Quick Look Preview
- Add another target for Quick Look Thumbnailing (or both if desired)
- Export UTIs:
- In the main app target, add "Exported Type UTIs" entries for each file extension (.3mf, etc.)
- In each extension's Info.plist add the same UTI(s) to indicate supported content
- Share code:
- Move SceneKit model loading + snapshot code into a shared framework or a copyable source folder included by the extension targets
- Implement preview/thumbnail:
- Preview extension: implement QLPreviewProvider (or the modern Quick Look extension entry point) to load the file and return a view or image
- Thumbnail extension: implement QLThumbnailProvider (QuickLookThumbnailing) to synchronously/async render a small image and call the completion handler
- Use offscreen SceneKit/Metal rendering to make crisp images
- Entitlements / Signing:
- Ensure the extension targets are signed and have matching provisioning profiles
- Test:
- Build & install, verify Finder Quick Look (spacebar) shows preview, and Finder shows thumbnails
- Test with large/complex files and fallback behavior
Acceptance criteria
- Finder shows thumbnails for supported file types.
- Quick Look preview displays a correct preview for supported documents.
- No duplicate parsing logic; shared code compiles into both app and extension targets.
- Extension passes code signing and notarization requirements.
Implementation notes
- Keep the extension binary small; load minimal resources.
- For SceneKit heavy rendering, use an offscreen SCNRenderer to render scene into an image for the thumbnail provider.
- Respect sandboxing: the extension receives a file URL; open read-only.
- Time limits: thumbnailing has tight time/budget; render a single static snapshot, not a fully interactive scene.
References
- Quick Look (API overview): https://developer.apple.com/documentation/quicklookui
- Quick Look Thumbnailing framework: https://developer.apple.com/documentation/quicklookthumbnailing
- Sample patterns for offscreen SceneKit rendering: Apple docs and WWDC sessions on Metal/SceneKit rendering
Metadata
Metadata
Assignees
Labels
No labels