Repository navigation
Description
Summary
Delete the "Add synced database…" wizard and the remaining tenant badge from core's Database settings.
The Pro package contributes both instead, through ADR-082's settings slots, which #3312 mounts in this file:
- the button, which owns its dialog, goes to
database.actions; - the per-database sync badge goes to
database.row.
After this PR, database-settings.svelte imports nothing Pro and reads no tenant binding.
Context
The wizard. add-synced-database-dialog.svelte (452 lines) runs these steps:
- Sign in, using
pro_current_person,pro_initiate_oauthand a listener on the rawsync:statusevent. - List tenants with
pro_list_tenant_memberships. - Name and create a local database with
databaseStore.create, thenswitchTo. - Mint a restricted landing collection with
backendAdapter.createNodeandcollectionsData.loadCollections(). - Call
pro_bind_tenant.
Its only importer is database-settings.svelte: the import at af8ddb6 line 7, and the mount at 205.
The button. It checks proSync.isPro && labsFlags.syncEnabled directly (af8ddb6: 110-114), bypassing the variant chokepoint.
The badge. After #3324, the row badge renders only for a bound database. It shows "Syncs to tenant · {tenantLabel(schema)}" plus the raw schema name.
The slots. ADR-082 §2.2 (proposed) defines both:
database.actionssits beside "New" and "Open existing…" and takes no props;database.rowrenders once per database row, with{ databaseId }.
#3312 already mounts both outlets in this file: the actions outlet after the header buttons, and the row outlet in each row after the badge block. With nothing registered they render nothing. This PR removes only the hard-coded Pro markup beside them.
Binding readers. The badge is core's last Settings reader of DatabaseInfo.boundTenantSchema. ADR-083 §7 requires such readers to leave core before #3341 changes DatabaseInfo.
Line numbers. They are at af8ddb6, before #3324 and #3312 touch this file. Locate code by symbol.
Scope
Delete:
packages/desktop-app/src/lib/components/settings/sections/add-synced-database-dialog.svelte(1-452)packages/desktop-app/src/tests/components/add-synced-database-dialog.test.ts(1-455, 14 cases)
Edit packages/desktop-app/src/lib/components/settings/sections/database-settings.svelte:
import AddSyncedDatabaseDialog(7)import { proSync }(10) andimport { labsFlags }(11). Both are used only by the button.let addSyncedDialogOpen(20)tenantLabel()and its doc comment (43-47)- the
{#if proSync.isPro && labsFlags.syncEnabled}"Add synced database…" button block (110-114) - the
{#if db.boundTenantSchema}badge block, as Remove tenant and sync wording shown to free users in Database settings #3324 left it (was 160-171) <AddSyncedDatabaseDialog bind:open={addSyncedDialogOpen} />(205)
Keep #3312's database.actions and database.row outlets.
Rewrite packages/desktop-app/src/tests/components/settings/database-settings.test.ts: all of it, meaning lines 1-78 plus the test #3324 added.
scripts/check-pro-boundary.ts: lower BASELINES.
Out of scope
DatabaseInfo.boundTenantSchemaandboundTenantCollection, andIMPLICIT_BROWSER_DATABASEindatabase.svelte.ts(Move Pro-owned data out of core's data model (ADR-083) #3345).- The "Share / Sync this database" action (Add the "Share / Sync this database" entry point that opens nodespace.ai #3362).
- The "Add synced database…" mentions in files Move the Pro sync and collaboration UI out of core #3333 owns:
collaboration-locked.svelte,pro-relogin-slot.svelteandpro-plugin.ts. They stay accurate for the Pro app and are deleted with Move the Pro sync and collaboration UI out of core #3333. - Add settings-section and database settings-slot extension points #3312's outlets and their tests.
- The explainer copy (Remove tenant and sync wording shown to free users in Database settings #3324).
Steps
- Startup sequence (CLAUDE.md), with the worktree named
issue-<N>-remove-add-synced-db:- On the primary checkout:
git status, thengit fetch origin && git pull origin main. - Create the worktree with
EnterWorktree. - Inside it:
bun install,bun run testfor the baseline, thenbun run gh:comment. Self-assign withbun run gh:assign <N> "@me", thenbun run gh:status <N> "In Progress".
- On the primary checkout:
- Check the gates:
- Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317 is on main: the
database.actionsanddatabase.rowoutlets are in this file, Add settings-section and database settings-slot extension points #3312'sdatabase-settings-extensions.test.tsexists, the Pro build can injectvirtual:nodespace-extensions(Add the virtual:nodespace-extensions build entry and the extension-api import alias #3311, Stop importing the Pro extension in core; register it only through the build entry #3316), and the host API exists (Publish the extension host API: services, ui and testing entries, version policy #3315). - Remove tenant and sync wording shown to free users in Database settings #3324 and Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 are merged.
- The pin gate is met.
- sync's replacement is an open PR and has been built against this branch's head. Link it in the PR description.
- Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317 is on main: the
- Delete the two files.
- Edit
database-settings.svelteas listed under Scope. - Verify the slot outlets. No code change.
- The
database.actionsoutlet is still inside the header button group, after "Open existing…". - The
database.rowoutlet is still in each row's left column. With the badge gone, it now sits directly under the status line. - Run Add settings-section and database settings-slot extension points #3312's
database-settings-extensions.test.tsunchanged. It covers the nothing-registered case and the per-rowdatabaseIdprop.
- The
- Rewrite
database-settings.test.tsas described under Tests. - Check for leftovers:
Expect no matches, except in
git grep -n -E "add-synced-database-dialog|AddSyncedDatabaseDialog|addSyncedDialogOpen|tenantLabel|Syncs to tenant|boundTenantSchema" -- packages/desktop-app/src/lib/components/settings packages/desktop-app/src/tests/components/settingsaccount-settings.svelteand its test if Delete the Pro Account section, workspace-members card and tenant-admission calls #3325 has not merged yet. Delete the Pro Account section, workspace-members card and tenant-admission calls #3325 deletes both. - Lower the ratchet. Run
bun run scripts/check-pro-boundary.tsand paste the printedBASELINESblock intoscripts/check-pro-boundary.ts. Every change must be a decrease. - Finish as in CLAUDE.md:
bun run test:changed;bun run quality:fix, then commit;git push origin HEAD:issue-<N>-remove-add-synced-db;gh pr create --repo NodeSpaceAI/nodespace-core --base main --head issue-<N>-remove-add-synced-db, thenbun run gh:status <N> "In Review";/pragmatic-code-review, then/address-review;- merge only after the user approves, with
bun run merge <PR#>in the background, thenExitWorktree({action: "remove", discard_changes: true}).
Standards:
- No GitHub issue numbers in code comments.
- Use
createLogger, neverconsole.*. - Use
bun run test, neverbun test. - No lint suppression.
Acceptance criteria
-
add-synced-database-dialog.svelteand its test are deleted, and nothing imports them. -
database-settings.svelteimports neither$lib/stores/pro-sync.sveltenor$lib/stores/labs-flags.svelte, and doesn't referenceboundTenantSchema,tenantLabeloraddSyncedDialogOpen. - With nothing registered:
- the header shows exactly "New" and "Open existing…";
- each row shows only the name, the default and active badges, the path and the status;
- the page has no "tenant" or "synced" wording.
- Add settings-section and database settings-slot extension points #3312's
database-settings-extensions.test.tspasses unchanged. - New, Open existing…, Rename, Remove and Set as default behave as before.
-
bun run --cwd packages/desktop-app quality:design-tokenspasses with no re-record. The deleted files have no baseline entries. -
bun run scripts/check-pro-boundary.tsexits 0,BASELINESis lowered in this PR, and no marker count rose. -
bun run quality:fixis clean andbun run test:changedpasses. - The PR links sync's replacement PR, built against this branch.
Tests and verification
Rewrite database-settings.test.ts:
- Header comment, with no Pro wording: "DatabaseSettings — Settings → Database. Core renders only its own database controls; anything else arrives through the
database.actionsanddatabase.rowextension slots, whichdatabase-settings-extensions.test.tscovers." Keep the existing note about running without a Tauri bridge. - Keep the
$lib/utils/loggerand@tauri-apps/plugin-dialogmocks. Drop theproSyncandlabsFlagsimports and thebeforeEachandafterEachthat reset them. it('renders only core database controls without an extension'): render, thenawait findByText('Default'). Assert that no button has the text "Add synced database…", and that the removed wording is absent:This replaces Remove tenant and sync wording shown to free users in Database settings #3324's test and follows Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299's absence-test convention.// Built from fragments so this absence check adds no line to the boundary ratchet. const removedWording = new RegExp([['ten', 'ant'].join(''), 'synced', 'local only'].join('|'), 'i'); expect(container.textContent).not.toMatch(removedWording);
it('shows exactly the core header actions'): take the parent element ofgetByRole('heading', { name: 'Databases' }), and assert that its buttons' trimmed labels equal['New', 'Open existing…']. Add the "Share / Sync this database" entry point that opens nodespace.ai #3362 later adds its action here and updates this test.- Delete the three
proSync.tier × labsFlags.syncEnabledtests. - Mutation checks:
- re-add the button unconditionally, and confirm both tests fail;
- re-add the "Local only · not synced" badge, and confirm the first test fails.
Commands:
bun run --cwd packages/desktop-app test src/tests/components/settings/
bun run --cwd packages/desktop-app quality:design-tokens
bun run scripts/check-pro-boundary.ts
bun run test:changed
bun run quality:fix
Manual check: run bun run dev:browser and open Settings → Database. The header and row layout should match a screenshot taken before the change, minus the Pro markup.
Notes for sync's replacement (what the SYNC gate must cover)
These use the ADR-082 (proposed) contract.
database.actionscontribution.settingsSlots: [{ id: 'add-synced-database', slot: 'database.actions', when: …, load }].- The component renders the "Add synced database…" button and owns the dialog's
openstate. - Its
when()replacesproSync.isPro && labsFlags.syncEnabled.labsFlagsis not in the host API (ADR-082 §2.3).
- The component renders the "Add synced database…" button and owns the dialog's
- What the dialog uses from core, and where each comes from:
databaseStore.create,switchToanderrorcome from the host API'sdatabases. Gap: ADR-082 §2.6 lists only the active id, the active database, the list andrefreshDatabaseSettings()fordatabases. Publish the extension host API: services, ui and testing entries, version policy #3315 must addcreate(),switchTo()and the last error, or ADR-082 must list them, before this gate can be met.backendAdapter.createNodecomes fromnodes.createNode.collectionsData.loadCollections()comes fromcollections.reload().Dialog,ButtonandInputcome from theuientry.createLoggerandtoErrorcome from the host API.invokeandlistencome from@tauri-apps/api.
database.rowcontribution.{ id: 'sync-badge', slot: 'database.row', load }.- It receives
{ databaseId }and looks the row up in the host API'sdatabaseslist. - It reads
boundTenantSchemauntil Carry opaque registry extensions through DatabaseInfo and drop the tray's synced label #3341 moves the binding into theDatabaseInfoextensions map (ADR-083 §2). - It renders "Syncs to tenant · X", and "Local only · not synced" if sync wants that label. It carries its own
tenantLabel.
- It receives
- Explainer. If the Pro app wants the paragraph Remove tenant and sync wording shown to free users in Database settings #3324 removed, it renders it in one of these contributions (ADR-082 §2.2).
- Tests. Carry over the 14 dialog cases, on the host API's
testingentry.
Dependencies
- Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299: the ratchet this PR lowers.
- Remove tenant and sync wording shown to free users in Database settings #3324: edits the same file, removing the explainer and the unbound branch.
- Turn the UI-extension registry into ADR-082's build-time frontend extension API #3317: Add settings-section and database settings-slot extension points #3312's
database.actionsanddatabase.rowoutlets, plus Add the virtual:nodespace-extensions build entry and the extension-api import alias #3311, Stop importing the Pro extension in core; register it only through the build entry #3316 and Publish the extension host API: services, ui and testing entries, version policy #3315, which sync's replacement needs before it can be built against this branch. - SYNC: the canonical pin gate.
- SYNC: the database-settings replacement, built and reviewed against this branch.
Risks and rollback
- Pro regression if the gate is skipped. A Pro app built from a core revision that contains this PR, but without sync's replacement, can no longer add a synced database or see which database syncs. Do not merge until the pin gate is met.
- Host API gap. If Publish the extension host API: services, ui and testing entries, version policy #3315 does not expose
databases.create()andswitchTo(), sync's dialog cannot be written against the host API, and the gate stays unmet. This blocks the merge, not the core code. - Layout shift. Add settings-section and database settings-slot extension points #3312's outlets render nothing when nothing is registered, and Add settings-section and database settings-slot extension points #3312's tests assert it.
- Rollback: revert the PR, including its
BASELINESchange. sync stays on its previous pin.
Plan key: C5.3 (pro-boundary DAG).
🤖 Generated with Claude Code
Activity
mstomar125 commentedon Oct 1, 2026
Superseded by #3412 (umbrella against the final ADR-081–085)