Implement Designed Import / Export Flow#411
Conversation
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the developer-only import/export panel with a user-facing import/export interface directly on the canvas controls. It introduces a new Import component with drag-and-drop support, integrates a full-canvas export option into the existing Export menu, and refactors state serialization to support version-mismatch checks and robust error handling. The review feedback suggests improving code robustness and type safety by using optional chaining for drag-and-drop file transfers, simplifying TypeScript type narrowing during JSON parsing, and adding stricter validation for the imported state's latestNodeId property.
Changes
in_front_of_canvas- a menu with file browse plus drag-and-drop upload (data-is-dragging-overstate, blocks canvas gestures leaking through to tldraw) that restores the workspace from an exported JSON file.EXPORT_OPTION_CANVAS) that's always offered regardless of selection and pairs with the new import menu.STATE_VERSIONand a typedImportError(malformed|version-mismatch+fileVersion), driving full error-toast messaging when an import fails.DevPaneland itsuse_dev_modehook, replaced by the import / export flow.Cardcomponent fromStatusEmpty- existing component was getting quite large as it was.importicon.control-dividertoken to use existing$surface-mutedfor consistency.Screenshots