hub-client: collections in project export/import + fix invisible import - #453
Open
icarusz wants to merge 3 commits into
Open
hub-client: collections in project export/import + fix invisible import#453icarusz wants to merge 3 commits into
icarusz wants to merge 3 commits into
Conversation
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>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
importDatawrites only the legacy IDBprojectsstore, 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 theimportProjectsaction onuseCollectionSetsand wired throughProjectsHome. 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.tsdefines 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-levelexportData) include collections; import re-subscribes non-root collections via the existingsubscribeCollectionaction. Import writes nothing into collection docs — membership and names arrive with sync.Testing
projectSetReconciler,projectListExport,projectStoragetest:cigreen (876 + 109 + 130);build:allcleanPlan doc:
claude-notes/plans/2026-08-04-collections-export.md🤖 Generated with Claude Code