Skip to content

Remove the frontend Pro code, render the contact card in the collaboration.entry slot, and bump the extension API to 2.0 - #3425

Merged
mstomar125 merged 3 commits into
mainfrom
issue-3412-strip-pro-frontend
Oct 1, 2026
Merged

mstomar125 merged 3 commits into
mainfrom
issue-3412-strip-pro-frontend

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Part of #3412
Part of #3413

Slice S4 of the one-pass strip: removes the frontend Pro code, turns the Labs "Team synchronization" card into core's contact entry point, renders it as the default of the new replaceable slot collaboration.entry, and makes the single extension API bump, 1.0 → 2.0.

Acceptance

  1. Deleted: the Pro stores and services (pro-sync.svelte.ts, membership.svelte.ts, membership-service.ts), pro-sync-variant.svelte.ts, the Pro plugin and its import, components/collaboration/*, and the first-Pro-consent and Pro-re-login modals. Done.
  2. Deleted: the Account section including the "NodeSpace Pro" card, workspace-members-card.svelte, add-synced-database-dialog.svelte, and the Account gating in settings-sidebar.svelte / settings-pane.svelte. The Pro residue is gone from app-shell.svelte, database.svelte.ts and debug-channel.ts. Done. The Account gating lived in settings-categories.ts, which the sidebar renders; the category is removed there and the pane loses its Account branch.
  3. The Labs syncEnabled flag and the disabled switch on the "Team synchronization" card are removed. The card text is reworded in the step-3 issue (you do the rewording here, see 5). Done.
  4. The free-user guardrail suite and the Pro tests are deleted. Done, along with the test:free-users script and the deleted files' design-token baseline entries (50 → 43).
  5. ([Core release blocker] Refuse Pro databases on every surface and add the contact entry point (ADR-081 step 3) #3413) The Labs "Team synchronization" card reads "Want team collaboration? Contact us", with the mailto:[email protected] link opened through openUrl. Core sends nothing else and makes no network request for it. Done. openUrl now accepts mailto: as well as http(s); Tauri's opener:default already allows mailto:*.
  6. ([Core release blocker] Refuse Pro databases on every surface and add the contact entry point (ADR-081 step 3) #3413) Core renders the card as the default content of the replaceable slot collaboration.entry. The default renders only while no contribution is registered for the slot, and stays suppressed even if a registered contribution is hidden, throws or fails to load. Done.
  7. ADR: remove the Settings→Databases tenant badge ('Syncs to tenant · … / Local only', database-settings.svelte), the 'Add synced database…' action, the settings-node pin and refresh (refreshDatabaseSettings, DATABASE_SETTINGS_PIN_OWNER, the pin calls), and boundTenantSchema/boundTenantCollection from the TS DatabaseInfo and IMPLICIT_BROWSER_DATABASE (database.svelte.ts ~41-46, 83-84). Done.
  8. ADR: EXTENSION_API_VERSION goes from {major:1,minor:0} to {major:2,minor:0}, in four places: (a) packages/desktop-app/src/lib/plugins/ui-extensions.ts:55; (b) the snapshot re-recorded with UPDATE_EXTENSION_API_SURFACE=1 bun run --cwd packages/desktop-app test src/tests/extension-api; (c) packages/desktop-app/app-lib/src/extensions/mod.rs:48 → (2, 0); (d) the assert at app-lib/src/extensions/fixture_tests.rs:117. In the same change: remove databases.refreshDatabaseSettings and DATABASE_SETTINGS_NODE_ID from src/lib/extension-api/index.ts; add type ReplaceableSlot = 'collaboration.entry', type ReplaceableSlotContribution = Contribution & { slot: ReplaceableSlot } and replaceableSlots?: ReplaceableSlotContribution[] on NodespaceExtension, keyed and validated like the other kinds, and export both types from index.ts; change the TS DatabaseInfo.status doc to '"closed" | "open" | "missing" | "requires_extension" | "unknown"'; move every apiVersion: 1 fixture to 2; change ui-extensions.test.ts's 'unsupported apiVersion' case to EXTENSION_API_VERSION.major + 1; add a frontend test that reads app-lib/src/extensions/mod.rs and asserts its (major, minor) equals the TS EXTENSION_API_VERSION. Done. lib/constants/database-settings.ts and its barrel export are deleted (nothing uses them). The Rust constant and its assert are the last commit, made after S1 merged.
  9. ADR: the mailto link is a compile-time constant (e.g. src/lib/constants/contact.ts) pinned by a unit test. The slot default and its suppression are covered with a fixture contribution: hidden, when() throws, load() rejects, component throws, and single-render ordering. Done.
  10. ADR (Remove Pro and cloud-sync wording from frontend comments, tests and the fly-out tooltip #3366 sites; ADR-081 §2b): the collection sub-panel title is "Open collection"; the dead hasLoaded field and its assertion are deleted; the RBAC / signed-in-user comment is a plain local reason; no "Collaboration tab"; cloud-sync wording is removed from the structure tree, logger, sync listener and remote-update policy and from their tests; the legacy workspace-root test is deleted. Done. The sync listener also loses its "(all tiers)" / "tier-independent" wording.
  11. ADR: in extension-api/index.ts, ui-extensions.ts and extension-outlet.svelte, update the draft citations ADR-082 §2.1/§2.4/§2.6/§7 to §3.1/§3.4/§3.6/§8. Done, in every frontend file that cited the draft numbering (draft §2.N → §3.N, §7 → §8).

Design: the collaboration.entry slot

  • UiExtensionRegistry.replaceableSlotFor(slot) returns every contribution registered for the slot, in descending priority with ties in registration order. It never evaluates when().
  • getReplaceableSlot(slot) (ui-extensions.svelte.ts) returns { registered, active }. registered depends on registration only. active is the first contribution whose when() holds, and a throwing when() counts as false and is logged once.
  • ReplaceableSlotOutlet renders its defaultContent snippet only while registered is false. Otherwise it renders active through ExtensionOutlet (keyed by contribution key, whose {:catch} and <svelte:boundary> isolate a failed load or a throwing component), or nothing.
  • labs-settings.svelte hosts collaboration.entry with TeamCollaborationCard as the default. The card imports only its card UI, the contact constant, openUrl and the logger.
  • The test-extension fixture contributes five collaboration.entry contributions, each gated by a flag that defaults to off: plain, higher priority, when() throws, load() rejects, component throws.

Extension API

  • Version 2.0 (major).
  • Removed: databases.refreshDatabaseSettings, DATABASE_SETTINGS_NODE_ID, DatabaseInfo.boundTenantSchema and DatabaseInfo.boundTenantCollection.
  • Added: NodespaceExtension.replaceableSlots, ReplaceableSlotContribution and ReplaceableSlot ('collaboration.entry').
  • DatabaseInfo.status may be 'requires_extension'.
  • From earlier PRs in this bump:
  • DB reset: none.

Tests

New:

  • components/settings/labs-collaboration-entry.test.ts: the slot on the real Labs page. Covers the default with nothing registered, and suppression while the contribution is visible, hidden, shown then hidden, when() throws, load() rejects and the component throws. Also covers single render by priority, fallback to the next visible contribution, and the first-registered tie-break.
  • components/settings/labs-settings.test.ts (rewritten): the constant is pinned to mailto:[email protected]; the body reads exactly "Want team collaboration? Contact us"; the card has no switch; a click calls openUrl once with the constant, prevents navigation and makes no invoke or fetch; the card's import list is pinned; no team-sync flag appears in the source.
  • plugins/ui-extensions.test.ts: registry keying, ordering, shared id and key reservation, malformed input, unregistering and no when() evaluation for replaceable slots, plus getReplaceableSlot.
  • extension-api/extension-api-version-agreement.test.ts: the Rust (major, minor) in app-lib/src/extensions/mod.rs equals the TS constant.
  • extension-api/extension-api-facades.svelte.test.ts: databases has exactly its six members, and the API has no settings-node id.
  • stores/database.test.ts: load() and switchTo() send exactly their registry, routing and window-pin commands.
  • components/settings/database-settings.test.ts (rewritten): the header actions are exactly New and Open existing…, no sync wording appears, and nothing renders from a database's extensions keys.
  • stores/labs-flags.test.ts: the store holds exactly aiChatEnabled and playbooksEnabled.
  • collection-sub-panel.test.ts: the title is "Open collection". utils/external-links.test.ts: openUrl accepts mailto:.

Mutation checks (each applied alone, the named test file run, the source restored). All 30 were killed:

Mutation Killed by
contact constant changed labs-settings: pins the constant
card text changed labs-settings: reads exactly
card href hard-coded labs-settings: links to the constant
card opens another URL / drops preventDefault / also calls fetch labs-settings: click test
card gains a switch labs-settings: has no switch
card imports a store labs-settings: import list
Labs page names the team-sync flag labs-settings: source absence
outlet never renders the default slot: default with nothing registered (2 tests)
registered decided by visibility (some(isContributionActive)) slot: hidden, shown-then-hidden, when() throws; ui-extensions: getReplaceableSlot
outlet renders the default when nothing is active slot: hidden, shown-then-hidden, when() throws
outlet never renders the contribution slot: visible, shown-then-hidden, load() rejects
find → findLast slot: priority, fallback, tie-break; ui-extensions
only the first contribution considered slot: visible, fallback; ui-extensions
replaceableSlotFor ignores priority slot: priority, fallback; ui-extensions: ordering
replaceable keys not reserved ui-extensions: key collision
replaceableSlots not registered slot and ui-extensions
ExtensionOutlet boundary removed slot: component throws (the page stops rendering)
ExtensionOutlet load failure not logged slot: load() rejects
host API re-adds the settings refresh facades: absence
switchTo / load send an extra command database: exact command lists
Databases page re-adds a synced action / shows extension keys database-settings
labs flags gain a third flag labs-flags: exact keys
settings regain an Account category settings-categories
sub-panel title reverted collection-sub-panel
openUrl refuses mailto: external-links
TS version 2.1 against Rust 2.0 / Rust 2.1 against TS 2.0 version agreement

Ratchet (bun run scripts/check-pro-boundary.ts)

Marker main (4ca90c2) this PR
proCommands 165 0
proSyncModule 367 1
proProtocol 12 0
proEvents 61 0
membershipService 54 0
editionBranching 6 3
cloudBindState 151 0
cloudSyncHooks 0 0
cloudWording 13 1
tenantWording 232 4
proWording 137 7
proNamedFiles 13 0

--changed lists no hit in any changed file. BASELINES is untouched; S5 tightens it.

Left for later slices

Verification

Run on the head of this branch, rebased on main 4ca90c2:

  • The slice grep (proSync|pro-sync|…|\bPro\b over packages/desktop-app/src, package.json and design-tokens-baseline.json, excluding src/tests/stores/conflicts.test.ts): 0 hits.
  • No Pro-named files under packages/desktop-app/src (git ls-files … | grep -P '(^|/|-)pro[-_.]'): 0.
  • jq -c .version extension-api-surface.json: {"major":2,"minor":0}. app-lib/src/extensions/mod.rs: EXTENSION_API_VERSION: (u32, u32) = (2, 0).
  • Card text: the rendered body is exactly "Want team collaboration? Contact us", pinned by labs-settings.test.ts. In the source, "Contact us" is the link text inside the <a>, so a literal grep for the whole sentence finds nothing. git grep 'Want team collaboration?' finds team-collaboration-card.svelte.
  • bun run --cwd packages/desktop-app test src/tests/extension-api src/tests/plugins src/tests/components/settings src/tests/build: 28 files, 523 tests passed.
  • bun run scripts/check-pro-boundary.ts: passes; --changed lists no hit in any changed file.
  • bun run quality:fix (desktop-app): eslint clean, no new design-token violations (43 known), svelte-check 0 errors and 0 warnings.
  • bun run test:changed: passed: frontend Happy-DOM, test:scripts, test:browser (Chromium) and rust:test (nextest, 156s).

Review: the pragmatic review (round 1) found one real defect: the slot outlet remounted its contribution whenever state read by a when() changed. It is fixed in a separate commit with two regression tests. The re-review (round 2) approves. Both rounds and the address-review notes are posted as comments.

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Pragmatic code review (round 1): independent review subagent at medium depth, on the local branch before the PR was opened

Code Review Summary

This is a clean slice. It deletes about 9k lines of Pro frontend code, and the slice grep finds nothing left behind. The new collaboration.entry slot follows the ADR on the main points. The default renders only while nothing is registered. It stays suppressed when the registered contribution is hidden, when when() throws, when load() rejects and when the component throws. At most one contribution renders, chosen by priority and then by registration order.

What the reviewer checked:

  • Slice grep: 0 hits.
  • File names: no Pro-named files remain.
  • Ratchet: passes.
  • eslint: clean.
  • Targeted tests: 673 passed, 1 failed. The failure is the TS/Rust version-agreement test, which fails by design until the Rust commit lands.

It found one real defect, in the new slot outlet: the rendered contribution remounts on every recompute.

Requirements Validation

  • Items 1 to 7 and 9 to 11: met.
  • Item 8: met on the TypeScript side. The Rust constant and its assert were pending as planned, and the final commit adds them.

Findings

Critical Issues

  • replaceable-slot-outlet.svelte: the rendered contribution remounts whenever state its when() reads changes.
    • Cause: getReplaceableSlot() returns a new { registered, active } object on every pass. The outlet's load={slot.active.load} prop therefore makes ExtensionOutlet re-run load() and remount.
    • Reproduced: with a when() that reads changing state but keeps returning true, the mount count went from 1 to 3. The same remount happens when a hidden, higher-priority contribution's when() re-evaluates.
    • Impact: a stateful contribution, such as a dialog or a half-filled form, would lose its state and flicker. Mount semantics are part of the versioned extension API (ADR-082 §8).
    • Fix: derive active separately so it keeps a stable reference, and add a regression test.

Suggested Improvements

  • None beyond the critical fix.

Nitpicks

  • Nit: labs-settings.test.ts, the "a failing openUrl is caught" test, should assert the logged error.
  • Nit: the ui-extensions.svelte.ts header should mention that registered does not depend on when().

Verdict

REQUEST CHANGES. The fix is two lines plus a regression test.

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Address review (round 1)

All three findings are fixed in 7bbea9b8 ("Keep a replaceable slot's contribution mounted while its when() inputs change").

Finding Action
Critical: the slot outlet remounts its contribution whenever state a when() reads changes Fixed. ReplaceableSlotOutlet now derives registered and active separately. active is the registry's own entry, so it compares equal until the chosen contribution changes. Two regression tests were added to labs-collaboration-entry.test.ts: a visible contribution whose when() reads changing state, and a hidden higher-priority contribution that re-evaluates. On the old outlet they saw 3 and 2 mounts; now they see 1. Mutation check: reverting the outlet to read slot.* directly fails both tests.
Nit: assert the logged error in the failed-openUrl test Fixed. The logger is mocked and the test asserts log.error('Failed to open the contact link', { error }). Mutation check: removing that call fails the test.
Nit: the ui-extensions.svelte.ts header Fixed. It now says a replaceable slot also reports registered, which does not depend on when().

The fix changes logic, so a re-review was run (round 2, below).

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Pragmatic code review (round 2): re-review of 7bbea9b8

Code Review Summary

Commit 7bbea9b8 fixes the critical finding and both nits from round 1:

  • replaceable-slot-outlet.svelte now derives registered and active separately, and its template reads only those two values.
  • active is the registry's own entry object, so it stays equal from one pass to the next. ExtensionOutlet's load input no longer depends on the new object that getReplaceableSlot builds on every pass.

Checks:

  • On the new HEAD, src/tests/components/settings and src/tests/plugins pass: 448 tests in 22 files.
  • Both regression tests fail against a copy of the old outlet (3 and 2 mounts) and pass on the new one.

Requirements Validation

  • Item 6 is now fully met: the chosen contribution stays mounted while what its when() reads changes.
  • Item 9 is strengthened by the two regression tests.
  • Item 8: the Rust constant and its assert were pending as planned, and the final commit adds them.

Findings

  • Critical: none.
  • Suggested improvements: none.
  • Nit: labs-collaboration-entry.test.ts uses testExtensionFlags.section as a general reactive input. This is safe; a dedicated flag would read more clearly. Optional.

Verdict

APPROVE

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Address review (round 2)

Finding Action
Nit: use a dedicated fixture flag as the reactive input in the two remount tests Declined. The tests read testExtensionFlags.section only as reactive state whose changes never change the predicate's result, and their comment says so. The fixture's own settings section is not registered in either test, and resetTestExtension() clears the flag. A new fixture flag would exist only to rename that input.

No logic changed, so no re-review is needed.

🤖 Generated with Claude Code

mstomar125 and others added 3 commits October 1, 2026 12:43
…tion.entry slot

Deletes the Pro stores and services (pro-sync, membership, membership-service),
the Pro plugin and its variant machine, the collaboration components, the
first-Pro-consent and re-login modals, the Account settings section, the
workspace-members card and the add-synced-database dialog, with their tests and
the free-user guardrail suite.

app-shell no longer starts a proSync listener; debug-channel no longer dumps it.
database.svelte.ts drops the sync re-target chain, the settings-node pin and
refresh, the membership cache invalidation, and boundTenantSchema /
boundTenantCollection from DatabaseInfo. Settings loses the Account category,
and the Databases page its tenant badge and "Add synced database…" action. The
Labs syncEnabled flag is gone.

The Labs "Team synchronization" card now reads "Want team collaboration?
Contact us" and opens TEAM_COLLABORATION_CONTACT_URL (mailto:) through openUrl,
which now accepts mailto: URLs. It renders as the default content of the new
replaceable slot collaboration.entry: ReplaceableSlotOutlet shows the default
only while no contribution is registered for the slot, and otherwise the
visible contribution with the highest priority (ties by registration order)
through ExtensionOutlet, or nothing.

Extension API 2.0 (TypeScript side): EXTENSION_API_VERSION is { major: 2,
minor: 0 }; NodespaceExtension gains replaceableSlots, and the host API exports
ReplaceableSlot and ReplaceableSlotContribution; databases.refreshDatabaseSettings
and DATABASE_SETTINGS_NODE_ID are removed; DatabaseInfo.status documents
"requires_extension". The surface snapshot is re-recorded and a test asserts the
TypeScript and Rust constants agree. ADR-082 citations move to the accepted
section numbers.

Comments and tests describe event bursts, echoes and in-process writers
without sync, tenant or nodespace-sync wording; the dead collections hasLoaded
field is deleted.

Part of #3412
Part of #3413

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s change

ReplaceableSlotOutlet passed `slot.active.load` from a derivation that
getReplaceableSlot rebuilds on every pass, so any change to state a when()
read re-ran ExtensionOutlet's load() and remounted the contribution, even
when the chosen contribution was unchanged. The outlet now derives
`registered` and `active` separately; `active` is the registry's own entry and
compares equal until the choice changes. Two tests pin it: a visible
contribution whose when() reads changing state, and a hidden higher-priority
one that re-evaluates.

The card's failed-open test now asserts the logged error.

Part of #3412
Part of #3413

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The app library's constant matches the TypeScript host API's 2.0, which the
frontend test extension-api-version-agreement checks. The fixture test asserts
the new value.

Part of #3412
Part of #3413

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant