Skip to content

feat: expose and delete FigJam pen/ink (VectorPath) nodes via apply_patch #2

Description

@hugolytics

Observed

Handwritten ink/pencil drawings made with FigJam's pen tool are invisible to the bridge. They do not appear in canvas_read D2 output or id_map, and cannot be targeted by apply_patch delete ops.

Repro

  1. Draw something with FigJam's pen tool on a canvas the bridge is connected to.
  2. Call canvas_read — the ink strokes are absent from d2_view.diagram.d2 and id_map.
  3. Attempt to delete via apply_patch — no node ID available to target.

Expected

Ink/vector nodes should be surfaced in canvas_read (even as opaque entries with a type tag like type: ink) so they can be targeted for deletion via apply_patch { type: 'delete', node_id: '...' }.

Full round-trip read/write support for ink is not required — delete is the primary use case.

Root cause

The plugin's canvas serialization only handles SHAPE_WITH_TEXT, SECTION, and CONNECTOR node types. FigJam pen strokes are likely VectorNode or a similar type and are skipped during serialization.

Proposed implementation

  1. In the plugin's canvas read pass, collect nodes of type VECTOR / pen stroke and include them in the snapshot with type: 'ink' and their figmaId.
  2. In apply_patch, the existing delete handler already calls figma.getNodeById — no change needed there, as long as the ID is surfaced.
  3. canvas_write_d2 does not need to handle ink nodes — they can be omitted from D2 diffing (read-only in D2 view, delete-only via apply_patch).

Workaround today

User must manually select and delete ink strokes in FigJam.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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