Skip to content

Add Quick Look Preview & Thumbnail extensions #1

@bossly

Description

@bossly

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

  1. 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)
  2. 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
  3. Share code:
    • Move SceneKit model loading + snapshot code into a shared framework or a copyable source folder included by the extension targets
  4. 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
  5. Entitlements / Signing:
    • Ensure the extension targets are signed and have matching provisioning profiles
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions