Repository navigation
Hide only extension-contributed roots in the collections tree - #3406
Conversation
Pragmatic code review (medium), commit 1233c3eReview Type: Initial Review Requirements Check
Code Review Findings 🟡 Important: the public extension contract still documents the core root this PR removes📁
This is the doc the counterpart contribution is written against. ADR-083 §2 requires that contribution to fall back to the legacy id itself, and this sentence suggests core still does it. Recommendation: say that with no extension contributing, no collection is hidden as a root. This is comment-only, so there is no API version bump. Principle: docs change in the same atomic change as the behaviour they describe, especially on a versioned contract surface. 🟢 Suggestion: field docs still say the frontend falls back to the well-known root id📁 These fields belong to #3345, which deletes them. Either trim the TS doc's last two sentences here, since it's frontend-only, or note it on #3345. Leave the proto and Rust docs alone. 🟢 Nit: "nothing is hidden" overstates, because empty collections are still pruned📁 Use the getter's precise phrasing instead: "no collection is hidden as a root". Verified, no finding
Recommendation: REQUEST CHANGES. Only finding 1 blocks; the PR is otherwise correct, atomic and well tested. |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review of 1233c3e: REQUEST CHANGES (posted as a comment, because GitHub blocks self-review verdicts). One 🟡 contract-doc finding and two 🟢. Full findings in the review comment above.
Address review: changes in 0bfe8aaAll three findings are addressed. Every change is to a comment or doc string; no code changed.
Checks after the fix
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: every change since the reviewed commit is to a comment or doc string, with no logic touched. Each one applies the reviewer's own suggested wording. Tests and the push check are green. |
Pragmatic code review: re-review of 0bfe8aa (delta 1233c3e..0bfe8aa)Review Type: Re-Review Previous Review Summary: 3 recommendations. 3 addressed, 0 not addressed, 0 new issues found. Findings
Recommendation: APPROVE. |
mstomar125
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review re-review of 0bfe8aa: APPROVE (posted as a comment, because GitHub blocks self-approval). All 3 prior findings resolved, none new. Full report in the comment above.
|
Merge queue: #3406 was taken out of the queue — the merge gate failed on it, rebased onto main. Reproduce with |
…3330) collectionsTree passes uiExtensionRegistry.collectionTreeRoots() straight to buildCollectionsTree and no longer reads the active database's boundTenantCollection or falls back to ROOT_COLLECTION_ID. The constant and the databaseStore import are deleted, which also drops the collections <-> database store import cycle. buildCollectionsTree's roots default to an empty set, and its doc and filter comments describe a root neutrally: a container the tree does not show, whose members show at the top level. Tests: the bound-root describe becomes "buildCollectionsTree root filtering" with neutral fixtures; the no-roots and legacy-id cases assert nothing is hidden; a getter case checks that no container is hidden without an extension. The extension-roots describe drops the core-root and active database root cases and its legacy-root fixture. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…f its own - CollectionTreeRootsContribution's doc no longer says the host unions the extension lists with core's own root; with no extension contributing, no collection is hidden as a root. - DatabaseInfo.boundTenantCollection's doc drops the two sentences saying the collections store hides it and falls back to the well-known root id. - buildCollectionsTree's doc and top-level comment say no collection is hidden "as a root" rather than "nothing is hidden", since empty collections are still pruned. Co-Authored-By: Claude Opus 5.5 <[email protected]>
0bfe8aa to
2729a43
Compare
Closes #3330
Summary
The sidebar collections tree no longer reads the database's tenant binding. It hides only the roots that registered extensions contribute through
collectionTreeRoots()(ADR-082 §2.2, ADR-083 §2, both proposed). Core contributes none, so with no extension registered nothing is hidden as a root.Changes
packages/desktop-app/src/lib/stores/collections.svelte.tsimport { databaseStore }.database.svelte.tsimportscollections.svelte, so this also removes a store import cycle.collectionsTreepassesuiExtensionRegistry.collectionTreeRoots()straight tobuildCollectionsTree. TheboundTenantCollection || ROOT_COLLECTION_IDfallback root and its comment are gone.ROOT_COLLECTION_IDand its doc.buildCollectionsTree'srootCollectionIdsnow defaults to an empty set instead ofnew Set([ROOT_COLLECTION_ID]).buildCollectionsTreedoc, the parent-filter comment and the top-level-filter comment neutrally:Docs that described the removed root (review follow-up, 0bfe8aa)
packages/desktop-app/src/lib/plugins/ui-extensions.ts: theCollectionTreeRootsContributiondoc no longer says the host unions extension roots "with core's own root". The host has no root of its own, so with no extension contributing, no collection is hidden as a root.EXTENSION_API_VERSIONis unchanged.packages/desktop-app/src/lib/stores/database.svelte.ts:DatabaseInfo.boundTenantCollection's doc drops the two sentences saying the collections store hides it and falls back to the well-known root id.packages/desktop-app/src/tests/stores/collections.test.tsROOT_COLLECTION_IDimport and thedatabaseStore/DatabaseInfoimport.PER_INSTALL_ROOTis renamedROOTand the comments are neutral. Changes to its cases:'c0000000-0000-0000-0000-000000000001'id and members parented to it. With no roots, it renders at the top level with its members nested. It also asserts that a root set not naming that id leaves the tree unchanged.hrcollection, so every existing expectation is unchanged.{ id: 'bound-db', boundTenantCollection: … } as DatabaseInfofixture. Add the collectionTreeRoots extension point to the sidebar collection tree #3402's PR body said this issue removes them.collections-tree-roots.svelte.test.ts(the derivation test from #3314) never touched the bound root and is unchanged.Deviations from the issue
BASELINESnot lowered. The issue's acceptance criteria say to lowerBASELINESto the printed counts. The standing drain instruction overrides that: parallel PRs collide on those lines, and Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371 tightens everything at the end. Nothing rose, and the ratchet exits 0.tauri:devcheck done statically, not live. The dev machine is shared, so I kept builds narrow. The sidebar tree for a never-synced database is provably unchanged:bound_tenant_collectionis only ever set byDatabaseManager::set_bound_tenant, which is the sync-binding path. Every new registry entry starts asNone.ROOT_COLLECTION_ID.rg -i c0000000 packagesfinds that id nowhere outside this PR's test fixture. No core code path creates a collection with it, so main's hidden set matched no collection.rgabove). Nothing to leave for Move Pro-owned data out of core's data model (ADR-083) #3345 / Remove Pro, Supabase and nodespace-sync wording from core comments, docs and the skill #3372 here.Ratchet (
bun run scripts/check-pro-boundary.ts)Exits 0. Every count moved down or stayed the same, and none rose:
All other markers are unchanged.
--changedreports 0 hits incollections.svelte.ts,collections.test.tsandui-extensions.ts. Its hits indatabase.svelte.tsare pre-existing lines this PR doesn't add.Acceptance criteria
rg -n -i 'ROOT_COLLECTION_ID|boundTenant|databaseStore|tenant|per-install' packages/desktop-app/src/lib/stores/collections.svelte.tsfinds nothing.rg -n ROOT_COLLECTION_ID packages/desktop-app/srcfinds nothing.buildCollectionsTreehides exactly the roots it is given, and nothing by default.collectionsData.collectionsTreehides nothing, including a collection with the legacy id.EXTENSION_API_VERSIONis unchanged.: intentionally not done (see Deviations).BASELINESloweredbun run scripts/check-pro-boundary.tsexits 0.bun run testandbun run --cwd packages/desktop-app quality:fixpass.Tests
bun run --cwd packages/desktop-app test src/tests/stores/collections.test.ts src/tests/stores/daemon-reconnect-retry.test.ts src/tests/stores/collections-tree-roots.svelte.test.ts src/tests/plugins/ui-extensions.test.ts: 4 files, 128 tests passed.daemon-reconnect-retrystill passes without the store import.bun run test:changed(frontend tier, the full Happy-DOM suite): passed. Happy-DOM: 308 files, 5604 tests. Browser (Chromium): 11 files, 136 tests. The baseline at 066fac4 was 5606; the -2 is 3 deleted fallback-only tests and 1 added test.bun run --cwd packages/desktop-app quality:fix: eslint, design tokens and svelte-check all clean (0 errors, 0 warnings).Mutation checks (each change applied to the store, the test file run, then the store restored):
new Set(['c0000000-…0001', ...collectionTreeRoots()]). Fails "hides no container collection when no extension is registered".buildCollectionsTree's default goes back to the legacy id set. Fails "does not special-case the legacy workspace-root id".Risks and rollback
This is a deliberate behaviour change (ADR-083). Open a database that sync has bound in core without an extension contributing its root: the workspace root now shows as a top-level collection holding everything. That is accurate, because it is a real collection. A never-synced database is unaffected. Rollback: revert this PR.
🤖 Generated with Claude Code