Skip to content

feat: offline export/import and QR/link sharing#5

Merged
RohitRajendran merged 1 commit intomainfrom
export-import-qr-sharing
Mar 20, 2026
Merged

feat: offline export/import and QR/link sharing#5
RohitRajendran merged 1 commit intomainfrom
export-import-qr-sharing

Conversation

@RohitRajendran
Copy link
Copy Markdown
Owner

Summary

  • Adds a Share button per plan in the Floor Plans panel that opens a unified modal with three options: scan a QR code, copy a shareable link, or download the plan as a .snapdraft.json file
  • Adds an Import Plan button in the panel footer to load a previously exported file
  • Navigating to a ?plan=… URL (e.g. from a shared link) auto-imports the plan on load and strips the param from the address bar
  • QR code is shown when the compressed URL fits within QR data limits; otherwise the modal still shows Copy link and Download file

Technical details

  • lz-string compresses plan JSON ~3–4× for URL-safe sharing
  • qrcode renders the QR canvas client-side
  • importPlan store action assigns a fresh ID and timestamps so imported plans never collide with originals
  • All new helpers in storage.ts are validated with unit tests; importPlan is covered in the store tests; full workflow is covered in E2E

Test plan

  • Open Floor Plans panel — each plan has Rename, Share, and Delete buttons
  • Share button opens modal with QR code, Copy link, and Download file
  • Copy link → paste in new tab → plan auto-imports and URL cleans up
  • Download file → re-import via Import Plan button → plan appears with a new ID
  • Import malformed JSON → error message shown in footer
  • Plan with many elements → Share modal shows "Plan is too large for a QR code" but Copy link and Download still work

Adds three ways to move plans between devices without a backend:
- Export plan as a .snapdraft.json file (download)
- Import plan from a .snapdraft.json file
- Share via a compressed URL (?plan=…) with QR code or copy-link

A single Share button per plan opens a unified modal with QR code
(when the plan fits within QR data limits), Copy link, and Download file.
Navigating to a shared URL auto-imports the plan on load and strips
the param from the address bar.

Includes unit tests for all new storage helpers and the importPlan store
action, plus E2E coverage for the full import/export/share workflow.
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 20, 2026

Deploy Preview for snapdraftfloorplans ready!

Name Link
🔨 Latest commit 1636e8c
🔍 Latest deploy log https://app.netlify.com/projects/snapdraftfloorplans/deploys/69bdbb9f3b8e980008b90e34
😎 Deploy Preview https://deploy-preview-5--snapdraftfloorplans.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@RohitRajendran RohitRajendran merged commit 64df94f into main Mar 20, 2026
6 checks passed
@RohitRajendran RohitRajendran deleted the export-import-qr-sharing branch March 20, 2026 21:30
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