Problem
Clipboard paste reads unknown text from the OS clipboard and tries to interpret it as Shift content, SVG, or another supported external format. The current native Shift payload path uses hand-written boolean validators.
That makes diagnostics weak: invalid JSON, schema mismatch, stale validator API drift, and unsupported external text can all collapse into similar paste failures.
Direction
Use Zod for the Shift clipboard envelope because this is an external boundary and not a hot path.
The parser should validate the full payload envelope, then return a typed ShiftContent or a structured unsupported result with a reason.
Acceptance criteria
- Add a Zod schema for the
shift/glyph-data clipboard payload.
- Validate the full envelope, not only
content.
- Reject unsupported future versions explicitly.
- Preserve arbitrary external plain text as
unsupported, not an exception.
- Return enough reason information for debugging without logging clipboard contents by default.
- Cover valid round-trip, invalid JSON, wrong format, future version, malformed contour/point content, and arbitrary plain text.
Obsidian context: Ticket - Clipboard Zod Validation.md.
Problem
Clipboard paste reads unknown text from the OS clipboard and tries to interpret it as Shift content, SVG, or another supported external format. The current native Shift payload path uses hand-written boolean validators.
That makes diagnostics weak: invalid JSON, schema mismatch, stale validator API drift, and unsupported external text can all collapse into similar paste failures.
Direction
Use Zod for the Shift clipboard envelope because this is an external boundary and not a hot path.
The parser should validate the full payload envelope, then return a typed
ShiftContentor a structured unsupported result with a reason.Acceptance criteria
shift/glyph-dataclipboard payload.content.unsupported, not an exception.Obsidian context:
Ticket - Clipboard Zod Validation.md.