Skip to content

Rework the first-Pro sync consent flow: sign-in-first, one publish-consent, clearer labels, and a decline that registers #1665

Closed

Description

@mstomar125

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

  1. 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.

  2. "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 of consentPromptOpen are the two pills → true and the slot → false; there is no re-open $effect, so the handler is otherwise correct.)

  3. 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:

  1. Pill relabeled to name the reality (e.g. "Set up sync" / on the modal, "publish to the public workspace"), not generic "Enable sync".
  2. Sign in first (OAuth). A user who bails at sign-in never sees a publish prompt, and nothing about their data is decided.
  3. 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.
  4. 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-axis resolveProSyncVariant (tier × sync_enabled × auth_status). New ordering needs an "authed + sync_enabled=false → show consent" state; today authed implies past-consent.
  • lib/components/enable-sync-pill.svelte, first-pro-consent-{slot,modal}.svelte, pro-sync-pill.svelte, collaboration/collaboration-locked.svelte
  • lib/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 local is never disabled into a no-op and shows a confirmation on decline
  • Variant-registry states + transitions covered by tests; bun run test:all green

Activity

  1. self-assigned this
    on Jul 15, 2026
  2. mstomar125 commented on Jul 15, 2026

    @mstomar125
    ContributorAuthor

    Resolved by #1666 (squash-merged to main as 3a0816cc), 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 shows sign-in (the pill drives OAuth); once authenticated it becomes consent (the publish-consent modal, auto-opened once per sign-in episode); merge flips sync_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:

    • 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 local is never disabled into a no-op and shows a confirmation on decline
    • Variant-registry states + transitions covered by tests; full frontend suite green (4060)

    Independent adversarial re-review = APPROVE; one MINOR finding (reload re-pop) fixed before merge.

    Live-validation follow-up: rebuild the desktop nodespaced-pro sidecar from sync main (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions