Skip to content

feat: space import/export as ZIP archives#24

Draft
nsheaps wants to merge 9 commits intomainfrom
claude/space-import-export-zip-r4x6V
Draft

feat: space import/export as ZIP archives#24
nsheaps wants to merge 9 commits intomainfrom
claude/space-import-export-zip-r4x6V

Conversation

@nsheaps
Copy link
Copy Markdown
Owner

@nsheaps nsheaps commented Mar 8, 2026

Summary

  • Add space export (download as ZIP) and import (upload ZIP) with full conflict resolution UI
  • Export includes all pages, space metadata, and database schemas
  • Import supports creating new spaces or merging into existing ones with skip/overwrite/rename options
  • Import/export buttons surfaced in three locations for discoverability: Settings tab, Spaces tab, and sidebar More menu
  • Command palette also includes Export Space as ZIP and Import Space from ZIP commands
  • Fix stale space name in sidebar when creating or switching spaces (useEffect sync)
  • Fix permanent loading screen when navigating between pages (null content to empty string fallback)
  • Auto-switch to imported space after import completes
  • Compatible with combined Spaces/Data tab (Combine Spaces and Data & Cache settings tabs #53), full-page mobile settings (feat: full-page settings modal on mobile #54), and space management fixes (Fix space management: /g/ URLs, auto-setup, sync, and wizard #52)

Test plan

  • Unit tests for space archive export/import logic (space-archive.test.ts)
  • Unit tests for SettingsModal import/export buttons on both Settings and Spaces tabs
  • Unit tests for Sidebar import/export menu items
  • Unit test for space name sync on prop change (rerender)
  • TypeScript strict mode passes
  • All 1763 tests pass
  • Lint passes

Closes #42

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM

@nsheaps nsheaps self-assigned this Mar 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

Release Version Check

🟡 MINOR version bump

Version
Current 0.5.1
Next 0.6.0

This version will be released automatically when this PR is merged to main.

Changelog preview

0.6.0 (2026-03-23)

Features

  • add clickable UI for space export/import (discoverability) (df0beb4)
  • add space import/export as ZIP archives with conflict resolution (6e0313d)

Bug Fixes

  • prevent permanent loading screen when navigating between pages (71f1083)
  • remove unused variable to fix lint error (c06f60b)
  • switch to imported space after ZIP import completes (3a07c6f)
  • sync space name on switch and add import/export to Settings tab (2d8532d)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 8, 2026

Preview Deployment

The web app for this PR has been deployed:

Open Preview

Use this to verify the app works correctly, especially for dependency updates.

github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 8, 2026
github-actions Bot added a commit that referenced this pull request Mar 10, 2026
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 4ad81de to 253df1d Compare March 11, 2026 01:19
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 253df1d to 57c033b Compare March 11, 2026 03:35
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
github-actions Bot added a commit that referenced this pull request Mar 11, 2026
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 5fe502d to 66f01cf Compare March 14, 2026 05:53
github-actions Bot added a commit that referenced this pull request Mar 14, 2026
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 66f01cf to 824cf75 Compare March 15, 2026 17:04
github-actions Bot added a commit that referenced this pull request Mar 15, 2026
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 824cf75 to 0ee85e3 Compare March 20, 2026 02:14
claude added 2 commits March 23, 2026 03:29
- Add @cept/core SpaceExporter: collects all files from a space (pages,
  workspace state, databases, assets) and produces archive manifest with
  SHA-256 integrity checking
- Add @cept/core SpaceImporter: reads ZIP archives and writes files into
  new or existing spaces with configurable conflict resolution (keep,
  replace, rename, skip) and per-file overrides
- Add previewImportConflicts() for scanning conflicts before committing
- Add SpaceExportDialog UI with options for databases/assets inclusion
- Add SpaceImportDialog UI with target space selection, conflict strategy
  picker, and workspace-state import toggle
- Wire both dialogs into App.tsx and command palette
- 55 unit tests covering export, import, all 4 conflict strategies,
  per-file overrides, error handling, progress callbacks, and full
  round-trip (export then import) verification

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
claude added 7 commits March 23, 2026 03:29
…quivalents

Every action available in the command palette must also be accessible via a
visible, clickable UI element that works across desktop, tablet, and mobile.
The command palette is a power-user accelerator, not the primary discovery
mechanism.

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
Add Export Space and Import Space buttons to:
- Sidebar "More" menu (always visible when sidebar is open)
- Settings > Spaces tab > Import/Export section

This ensures space export/import are discoverable without the command
palette, satisfying the new UI discoverability rule.

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
The cept-modal-* CSS classes used by both dialogs had no stylesheet
defined, causing them to render as unstyled raw HTML. Added
modal-styles.css with overlay, dialog container, header, body,
buttons, fieldsets, progress bar, and dark mode support. Replaced
inline styles in both components with proper CSS classes.

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
Two bugs in page content loading caused pages to show "Loading..." forever:

1. When readPageContent returned null (file doesn't exist on disk yet),
   pageContents[id] was never set, so contentLoaded stayed false forever.
   Fix: fall back to empty string when backend returns null.

2. The check `!pageContents[id]` treated empty string '' as falsy, causing
   re-reads from backend on every navigation to pages with empty content.
   Fix: use `!(id in pageContents)` for proper existence check.

Applied the fix in all three code paths: handlePageSelect, initial load,
and loadAndApplySpaceState (space switching).

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
The SpaceImportDialog's onImportComplete callback was ignoring the
spaceId and spaceName parameters, so after importing a space from ZIP
the app would only refresh the manifest but never actually switch to
the imported space — leaving the user on the old space with stale data.

Now properly saves current space state, updates the manifest, and
switches to the newly imported space.

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
- Fix stale space name in sidebar when creating or switching spaces by
  syncing editSpaceNameValue with the spaceName prop via useEffect
- Add import/export ZIP buttons to the Settings tab for discoverability
  (previously only on the Spaces tab)
- Add tests for both fixes

https://claude.ai/code/session_01WsFd9hPNmHcP9kJCj7fZHM
@nsheaps nsheaps force-pushed the claude/space-import-export-zip-r4x6V branch from 0ee85e3 to 2d8532d Compare March 23, 2026 03:33
github-actions Bot added a commit that referenced this pull request Mar 23, 2026
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.

Bug: Quick-add remote space doesn't appear in Settings UI

2 participants