Skip to content

[DRAFT] feat: canvas state export/import via Base64#112

Draft
davidsoncabista wants to merge 4 commits intoPouzor:mainfrom
davidsoncabista:feat/export-canvas-image
Draft

[DRAFT] feat: canvas state export/import via Base64#112
davidsoncabista wants to merge 4 commits intoPouzor:mainfrom
davidsoncabista:feat/export-canvas-image

Conversation

@davidsoncabista
Copy link
Copy Markdown

Overview

This is a work-in-progress PR to implement canvas state export/import functionality.
I'm opening this as a Draft to share the proposed architecture and core utilities.

Changes

  • Architecture Doc: Created docs/CANVAS_EXPORT_BASE64_ARCHITECTURE.md outlining the serialization process.
  • Utility Functions: Created frontend/src/utils/exportCanvas.ts with:
    • exportCanvasToBase64: Handles Unicode-safe serialization.
    • importCanvasFromBase64: Handles decoding and type-safe restoration.
    • SSR Support: Included globalThis fallback for environments where Buffer or btoa might vary.

What's done:

  • Architecture specification (docs/CANVAS_EXPORT_BASE64_ARCHITECTURE.md).
  • Core utility functions with Unicode and SSR support (frontend/src/utils/exportCanvas.ts).

To-do:

  • Add unit tests for the utilities.
  • Implement Export/Import UI components.

Feel free to comment on the architecture/serialization logic!

@Pouzor, this is a foundational step for the portable canvas feature. Feedback on the schema versioning is welcome!

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.

1 participant