Skip to content

Embeds: option to stay in interactive mode (persist across re-renders) #225

Description

@kostyafarber

Problem

Embedded drawings (![[drawing.md]]) always render as a static image preview, and interactive mode is transient: entering it via the context menu only lasts until Obsidian re-renders the note. Switch tabs and come back, reopen the note, or scroll far enough for the block to unload, and the embed is back in snapshot mode.

For notes where a canvas is the main content — a diagram you're actively working on, a whiteboard section inside a larger note — re-entering interactive mode on every visit is enough friction that it's easier to keep the drawing open in a separate pane, which defeats the point of embedding.

Proposal

A per-embed opt-in flag in the alt-text options, alongside the existing showBg= / size= / pos= params:

![[my-drawing.md|interactive=true]]

An embed with this flag mounts directly in interactive mode and stays there across re-renders.

Making it per-embed (rather than a global setting) keeps the performance story intact: image mode remains the default, and a note only pays for a live editor instance where the author explicitly asked for one.

Alternatives considered

  • Global "default embed mode" setting — there's already an embeds settings group (padding / show background / background dots) it could slot into, but vault-wide it's a footgun: every embed in every note becomes a full tldraw instance.
  • Remembering last-used mode per embed — nicer UX but needs persistent state keyed by note + embed, and "why is this one embed live?" becomes invisible. The explicit flag is self-documenting in the markdown.

Implementation notes

  • The default is hardcoded in the embed render child: #viewMode: ViewMode = 'image' (src/obsidian/components/markdown-render-child/tldraw-markdown-render-child.ts), with toggleInteractive() already exposed on TldrawAppEmbedViewController.
  • Alt-text named props (pos, size, showBg) are parsed in src/obsidian/helpers/embeds.ts, so interactive would follow the same pattern and get threaded into the render child's initial mode.

🤖 Drafted with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions