Skip to content

hub-client: collections in project export/import + fix invisible import - #453

Open
icarusz wants to merge 3 commits into
mainfrom
feature/collections-export
Open

hub-client: collections in project export/import + fix invisible import#453
icarusz wants to merge 3 commits into
mainfrom
feature/collections-export

Conversation

@icarusz

@icarusz icarusz commented Aug 5, 2026

Copy link
Copy Markdown
Member

What

Two related fixes to the project-list export/import path, both found while testing the collections projects home against a fresh browser.

Bug: imported projects didn't appear

"Import project list (JSON)" reported "Imported 30 project(s)" but displayed none. importData writes only the legacy IDB projects store, which the set-mode UI never renders; the IDB→set reconciler only ran on page load, so imports were invisible until a manual reload.

Fix: new importProjectsAndReconcile() (projectSetReconciler.ts) runs the reconcile inline, exposed as the importProjects action on useCollectionSets and wired through ProjectsHome. Imported projects appear immediately; result messages are honest about offline / already-present cases.

Feature: collections in the export

Every export surface emitted a flat schemaVersion-4 list, so an export → import round trip restored projects but lost (a) collection groupings and (b) the collection doc pointers — no way to re-subscribe without hunting down invite links.

New services/projectListExport.ts defines the v5 format: projects plus collection pointers (docId, syncServer, display-only name/members/isRoot). Parse accepts v5, v4, and the pre-ExportData bare array; rejects newer-than-known versions. All three export surfaces (ProjectsHome, classic ProjectSelector, IDB-level exportData) include collections; import re-subscribes non-root collections via the existing subscribeCollection action. Import writes nothing into collection docs — membership and names arrive with sync.

Testing

  • 16 new tests (TDD, written failing-first) across projectSetReconciler, projectListExport, projectStorage
  • Full test:ci green (876 + 109 + 130); build:all clean
  • Verified end-to-end in local-prod twice (automated browser + manual Safari): export with a collection → fresh browser profile → import → "Imported N project(s), joined 1 collection(s)", collection restored with correct name and membership

Plan doc: claude-notes/plans/2026-08-04-collections-export.md

🤖 Generated with Claude Code

icarusz and others added 2 commits August 4, 2026 20:31
Two related fixes to the project-list export/import path (plan:
claude-notes/plans/2026-08-04-collections-export.md), both TDD:

Import visibility bug: "Import project list (JSON)" reported "Imported N
project(s)" but displayed none — importData writes only the legacy IDB
projects store, which the set-mode UI never renders, and the IDB→set
reconciler only ran on page load. New importProjectsAndReconcile()
(projectSetReconciler.ts) runs the reconcile inline; exposed as the
importProjects action on useCollectionSets and wired through ProjectsHome,
so imported projects appear immediately. Result messages are honest about
offline / already-present cases.

Collections in the export: every export surface emitted a flat
schemaVersion-4 list, so a restore lost collection groupings AND the
collection doc pointers (no way to re-subscribe without invite links).
New services/projectListExport.ts defines the v5 format — projects plus
collection pointers (docId, syncServer, display-only name/members/isRoot)
— with parse accepting v5, v4, and the pre-ExportData bare array, and
rejecting newer-than-known versions. Export surfaces (ProjectsHome,
classic ProjectSelector, IDB-level exportData) now include collections;
import re-subscribes non-root collections via the existing
subscribeCollection action (membership arrives with sync; import writes
nothing into collection docs).

Verified end-to-end in local-prod: export with a collection → fresh
browser profile → import → "Imported 3 project(s), joined 1
collection(s)", collection restored with correct name and membership.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documents 2c21233.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@posit-snyk-bot

posit-snyk-bot commented Aug 5, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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.

3 participants