Skip to content

Add ![[file.spd]] embed support - #139

Merged
philips merged 1 commit into
mainfrom
spd-embed-support-issue-138
Jul 28, 2026
Merged

Add ![[file.spd]] embed support#139
philips merged 1 commit into
mainfrom
spd-embed-support-issue-138

Conversation

@philips-clanker

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

Copy link
Copy Markdown
Collaborator

Summary

First slice of #138: ![[file.spd]] embed support, mirroring how ![[file.note]] embeds already work.

  • SupernoteAtelierEmbed (new, in src/atelierView.ts) registers spd with app.embedRegistry the same way SupernoteEmbed does for note (see SupernotePlugin.onload in src/main.ts).
  • Simpler than SupernoteEmbed: .spd has no page concept, just layered tiles flattened into one composite image via SupernoteAtelier.toCompositeImage(), so there's no page-nav toolbar to build — just the image (or an empty/error message).
  • Extracted the render logic (read file → SupernoteAtelier.open()toCompositeImage() → data URL) that SupernoteAtelierView (Prototype .spd (Supernote Atelier) file support #137) already had into a shared renderAtelierCompositeDataUrl() helper, so the view and the new embed don't duplicate it.

Scoped deliberately narrow: the other items in #138 (layer on/off toggle, export/conversion commands, viewport/zoom, device attach/upload) are separate follow-up work, not part of this PR.

Test plan

  • npm run build succeeds
  • npm test — all 95 existing tests still pass
  • npm run lint — no new warnings/errors
  • Not yet manually verified inside a running Obsidian vault (e.g. ![[somefile.spd]] in a note) — no automated Electron/GUI harness for this repo yet, same as Prototype .spd (Supernote Atelier) file support #137's manual verification step

Wires 'spd' up to Obsidian's internal app.embedRegistry the same way
'note' already is, so a .spd file can be embedded inline in a note.
SupernoteAtelierEmbed is simpler than SupernoteEmbed (.note's embed):
.spd has no page concept, just layered tiles flattened into one composite
image, so there's no page-nav toolbar to build.

Extracts the render logic (read file -> SupernoteAtelier.open() ->
toCompositeImage() -> data URL) that SupernoteAtelierView already had
into a shared helper so the view and the new embed don't duplicate it.

One item off #138.
@philips
philips merged commit 358ebbe 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