Repository navigation
Description
Context (found during live validation, 2026-07-15)
Running the Pro dev build and driving the enable-sync → consent → sign-in path surfaced three UX problems in the first-Pro data-sharing flow. The underlying consent gate (public-workspace publish requires explicit, irreversible consent) is correct and must be preserved — this is about when and how it is presented, plus fixing a decline that silently no-ops.
Problems
-
Two confusing steps in the wrong order. A pill labeled "Enable sync" opens a modal whose real action is "publish every note into the shared public workspace where others can read them." The publish-consent is demanded before the user has even signed in. "Enable sync" does not read as "publish publicly," so the pill undersells an irreversible privacy decision.
-
"Keep this database local-only" can silently do nothing. The decline button is
disabled={pending}. If the user has already clicked Merge, both buttons are disabled while the sign-in call is in flight — and because the browser hand-off can hang, that window is long — so a click on Keep local is swallowed. (Confirmed by code trace: the only writers ofconsentPromptOpenare the two pills → true and the slot → false; there is no re-open$effect, so the handler is otherwise correct.) -
A clean decline gives zero feedback. Even when it works, Keep local just closes the modal and leaves the pill in place — no confirmation that the choice registered, so it reads as a no-op.
Proposed flow
Reorder so authentication comes first and the publish decision happens at the moment it matters:
- Pill relabeled to name the reality (e.g. "Set up sync" / on the modal, "publish to the public workspace"), not generic "Enable sync".
- Sign in first (OAuth). A user who bails at sign-in never sees a publish prompt, and nothing about their data is decided.
- After auth, present the merge/keep-local consent once, right before the first push — merge flips
sync_enabled+ binds tenant + pushes; keep-local leaves the user authenticated but sync off. - Decline registers visibly: keep-local is never disabled into a dead no-op, and a brief confirmation ("Kept local — sync stays off") acknowledges the choice.
This keeps the explicit-consent guarantee: the daemon still only pushes after sync_enabled, and consent still gates that flip. It only moves the prompt to after sign-in and makes decline unambiguous.
Touch points
lib/plugins/ui-extensions*— the two-axisresolveProSyncVariant(tier × sync_enabled × auth_status). New ordering needs an "authed + sync_enabled=false → show consent" state; todayauthedimplies past-consent.lib/components/enable-sync-pill.svelte,first-pro-consent-{slot,modal}.svelte,pro-sync-pill.svelte,collaboration/collaboration-locked.sveltelib/stores/pro-sync.svelte.ts(consentPromptOpen, sign-in episode signals)
Guardrail
The consent gate is security-relevant (the public-workspace publish guarantee). A reorder + relabel + decline-fix preserves the guarantee. If implementation ends up changing what the gate guarantees, flag to Anoop before merging.
Out of scope
The sign-in itself failing in the dev build (browser opens http://127.0.0.1:8787 — the local wrangler dev worker not running; release builds use pro.nodespace.ai) is expected and infra-gated, tracked separately with the live-OAuth work. Not part of this issue.
Acceptance criteria
- Pill + modal copy name the public-workspace publish explicitly
- Sign-in precedes the publish-consent; unauthenticated users never see it
- Consent still gates
sync_enabled(nothing pushes before an explicit merge) -
Keep localis never disabled into a no-op and shows a confirmation on decline - Variant-registry states + transitions covered by tests;
bun run test:allgreen
Activity
Reorder the first-Pro consent flow to sign-in-first (#1666)
mstomar125 commentedon Jul 15, 2026
Resolved by #1666 (squash-merged to
mainas3a0816cc), with the sync-side companion nodespace-sync#305.Frontend (this issue): the Pro-sync variant machine was reordered to sign-in-first —
teaser | sign-in | consent | relogin | connected. A fresh Pro database showssign-in(the pill drives OAuth); once authenticated it becomesconsent(the publish-consent modal, auto-opened once per sign-in episode); merge flipssync_enabled→connected. The pill/modal now name the public-workspace publish, "Keep local" is never disabled into a no-op (records the decline, persists it per-database so it doesn't re-pop on reload, and shows a confirmation).Consent guarantee preserved: the daemon still only pushes after
sync_enabled, which the merge flips — signing in first connects but publishes nothing (server-side push gate).Acceptance criteria:
sync_enabled(nothing pushes before an explicit merge)Keep localis never disabled into a no-op and shows a confirmation on declineIndependent adversarial re-review = APPROVE; one MINOR finding (reload re-pop) fixed before merge.
Live-validation follow-up: rebuild the desktop
nodespaced-prosidecar from syncmain(which now also kicks the post-enable push sweep, #305), then verify the sign-in → consent → connected round-trip on a billing-active tenant. Note: a declined ("Keep local") user stays signed in and the daemon's realtime pull remains active while push stays gated — gating pull too is a possible follow-up (flagging @ for Anoop), not in scope here.