Repository navigation
Add UI-extension registry for two-axis Pro-sync surfaces (ADR-053) - #1607
Conversation
|
APPROVE — well-structured, community-safe two-axis Pro-UI registry. The failing Community-safety verified at the source, not just the testThe one invariant that matters for a Pro-UI PR — a community build must never render a daemon-backed Pro surface — holds by construction. if (proSync.tier !== 'pro') return 'teaser'; // non-Pro (and pre-probe 'unknown') → teaser, unconditionally
const settings = activeDatabaseSettings();
if (settings?.sync_enabled !== true) return 'enable-prompt';
if (settings.auth_status === 'connected') return 'connected';
return 'sign-in';So the per-database axis-2 ( The state machine + gating change are correct
|
Introduce a declarative UI-extension registry that resolves the active Pro-sync surface from two independent signals: the daemon build tier (app-global) and the active database's DatabaseSettingsNode (sync_enabled / auth_status, per-database). A reactive resolver maps the signals to one of four variants — teaser, enable-prompt, sign-in, connected — and returns only the chrome contributions and viewer extensions matching it. App-shell overlay/modal slots and the collection-node viewer now render registry contributions through an ExtensionOutlet instead of hard-coded pill/modal wiring; the re-login orchestration moves into a registry slot component, and its dismissal state is held on the sync store so it survives the slot remounting on a variant flip. The membership store gates on the two-axis isProSyncActive() rather than the tier-only proSync.isPro; the recovered-items log stays tier-gated (its trigger is the one-shot tier confirmation and the log is per-user, not per-database). database.svelte.ts hydrates the DatabaseSettingsNode on load and after a database switch so the variant re-resolves for the active database. The community build resolves to the static upgrade teaser only; every daemon-backed Pro surface stays gated, leaving the free experience unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
APPROVE Reviewed as an independent correctness pass over the full diff (registry data class, reactive resolver, variant↔component↔slot mapping, app-shell rewire, per-database settings hydration, and the two-axis store gates). Two issues surfaced and were fixed before this approval:
What checked out: complete/correct variant→component→slot mapping (all four variants; app-shell requests exactly the two slots pro-plugin registers); reactive Verification after fixes: |
Summary
Adds a declarative UI-extension registry that resolves the active Pro-sync surface from two independent signals and renders it through generic extension slots, replacing the hard-coded pill/modal wiring in the app shell.
Part of the ADR-053 multi-database epic (#1537): the Pro-sync surface must react per active database, not just per daemon build.
Two-axis variant resolution
proSync.tier, app-global): a non-Pro daemon resolves to the static upgradeteaser.DatabaseSettingsNode.sync_enabled/auth_status, per-database): a Pro daemon resolves toenable-prompt→sign-in→connected.The resolver (
lib/plugins/ui-extensions.svelte.ts) maps the two signals to one variant and returns only the chrome contributions / viewer extensions matching it. Both reads are reactive, so a tier change or aDatabaseSettingsNodeupdate (including a database switch) re-resolves the surface.What changed
UiExtensionRegistry(lib/plugins/ui-extensions.ts) + reactive resolver + built-in Pro extension definition (pro-plugin.ts) +ExtensionOutlet.ExtensionOutletinstead of importing pill/modal components directly.pro-relogin-slot.svelte); the presentationalProReloginModalis unchanged.membership,recovered-items) gate on the two-axisisProSyncActive()instead of the tier-onlyproSync.isPro.database.svelte.tshydrates theDatabaseSettingsNodeon load and after a database switch so the variant re-resolves for the active database.Community build unchanged
Non-Pro builds resolve to the static teaser only; every daemon-backed Pro surface stays gated. The
test:free-usersguardrail covers this.Testing
bun run test— 3989 passedbun run test:free-users— 11 passedbun run quality:check(eslint + svelte-check) — 0 errors, 0 warningsFollow-up
enable-sync-pillopts a database into sync via the existing interactive sign-in (pro_initiate_oauth), which flipssync_enabled/auth_statuson bind. A dedicated set-sync_enabledcommand is a backend follow-up.Co-Authored-By: Claude Opus 4.8 [email protected]