Skip to content

Prototype .spd (Supernote Atelier) file support - #137

Merged
philips merged 2 commits into
mainfrom
prototype-spd-support
Jul 28, 2026
Merged

Prototype .spd (Supernote Atelier) file support#137
philips merged 2 commits into
mainfrom
prototype-spd-support

Conversation

@philips-clanker

@philips-clanker philips-clanker commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prototype for #136: a minimal read-only viewer for .spd files (the
Supernote Atelier app's format), built on top of
supernote-typescript#33's
SupernoteAtelier parser.

  • Registers the spd extension to a new SupernoteAtelierView
    (src/atelierView.ts) — opens the file, calls toCompositeImage() to
    flatten every layer, and shows the result as one image.
  • Deliberately minimal compared to SupernoteView (the .note viewer):
    .spd has no page concept, just layered tiles on one canvas, so there's
    no zoom/find/thumbnail toolbar, no embed registration
    (![[file.spd]]), and no vault-writing commands yet.
  • sql.js's wasm binary is embedded directly into the bundle via
    esbuild's binary loader (esbuild.config.mjs) instead of being
    fetched/read at runtime, so it works the same on desktop and mobile
    without a locateFile() callback.
  • Points the supernote-typescript submodule at that repo's main
    (PR PNG easy - .Notes Direct into Obsidian from Supernote? #33 has since merged — published to npm as 0.5.2, though that repo
    doesn't have a corresponding git tag yet).

What's not here yet

  • No embed (![[file.spd]]) support.
  • No per-layer view/toggle — only the flattened composite.
  • No "attach/upload to device" integration for .spd.
  • SupernoteAtelier.viewport/canvasSize aren't used (no zoom/pan yet).

Test plan

  • npm run build succeeds
  • npm test — all 95 existing tests still pass
  • npm run lint — no new warnings/errors
  • Verified SupernoteAtelier.open() + toCompositeImage() against
    supernote-typescript/tests/input/real-device.spd outside the
    plugin (same code path the view uses) and visually confirmed the
    layered strokes composite correctly over the reference background
  • Manually verified inside a running Obsidian vault — .spd file renders correctly

Adds a minimal read-only viewer for .spd files (Supernote Atelier app),
built on supernote-typescript's SupernoteAtelier parser
(philips/supernote-typescript#33). Registers the 'spd' extension to a new
SupernoteAtelierView that flattens every layer with toCompositeImage() and
shows the result as a single image — no page concept, so none of
SupernoteView's zoom/find/thumbnail toolbar or embed support yet.

sql.js's wasm binary is embedded into the bundle via esbuild's binary
loader (esbuild.config.mjs) rather than fetched/read at runtime, so it
works the same on desktop and mobile without a locateFile() callback.

Points the supernote-typescript submodule at a local merge of PR #33
(worktree-spd-parser) onto main, pushed to spd-prototype-merge-main so the
pinned commit resolves for anyone cloning this branch.

Closes #136.
supernote-typescript#33 (SupernoteAtelier/.spd support) has since merged
into that repo's main branch (published to npm as 0.5.2, though that repo
doesn't have a corresponding git tag yet). Repoints the submodule at
upstream main directly, replacing the throwaway local merge of PR #33
onto main that was pushed to spd-prototype-merge-main as a workaround
while the PR was still open.
@philips
philips marked this pull request as ready for review July 28, 2026 18:22
@philips
philips merged commit db001bb into main Jul 28, 2026
7 checks passed
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.

2 participants