Repository navigation
Reorder the first-Pro consent flow to sign-in-first - #1666
Merged
Merged
Conversation
The Pro-sync surface demanded the public-workspace publish consent before the user had even signed in, behind a pill labelled "Enable sync" that didn't read as "publish publicly" — and its "Keep local" decline could be a silent no-op (disabled mid-call) with no confirmation. Rework the variant machine so authentication comes first and the publish decision happens where it matters: - Split the axis-2 states into five variants: teaser | sign-in | consent | relogin | connected. A signed-out, un-enabled database is `sign-in` (the sync pill drives OAuth); once authenticated it becomes `consent` (publish decision); merge flips sync_enabled → `connected`; `relogin` is the re-auth state for an already-enabled database whose session lapsed. - The consent modal auto-opens once per fresh sign-in episode and no longer starts OAuth on merge (the user is already signed in) — merge only records the consent (pro_enable_sync). isProSyncActive stays "sync enabled" (relogin | connected). - Relabel the pill to "Turn on sync" and name the public-workspace publish. - "Keep local" is never disabled into a no-op, records the declined sign-in episode so the prompt doesn't immediately reopen, and shows a brief confirmation. - collaboration-locked branches: reopen the consent modal when signed in, else point the user at the toolbar to sign in first. The consent gate is preserved: the daemon still only pushes after sync_enabled, which the merge flips. Registry states + the sign-in → consent → connected transition are covered by tests; full frontend suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The auto-open of the publish-consent modal was gated only by the in-memory consentDeclinedEpisode. On a webview reload / app restart the store re-instantiates and the resumed session re-bumps signedInEpisode, so a user who chose "Keep local" got the irreversible-publish dialog re-popped on every launch — training them to click through a consent gate. Persist the decline per database id in localStorage and gate the auto-open on it, so the modal is a one-time nudge that survives reload while a different database is unaffected. The enable-sync pill remains available to reopen the consent deliberately. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
Author
|
Adversarial re-review: APPROVE (independent pass, per core merge policy). Traced all five variant combinations, the registry mappings, the auto-open derivation, timer lifecycle, and every consumer of the renamed variants. Verified: the consent guarantee holds (merge calls only Two items surfaced:
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1665.
Problem (found in live validation, 2026-07-15)
The Pro-sync surface demanded the public-workspace publish consent before the user had signed in, behind a pill labelled "Enable sync" that didn't read as "publish publicly" — and its "Keep local" decline could be a silent no-op (
disabledmid-call) with no confirmation.What changed (frontend variant machine)
Reordered to sign-in-first, splitting the two-signal state machine into five variants:
consentvariant.pro_enable_sync).collaboration-lockedbranches: reopen the consent modal when signed in, else point the user to the toolbar to sign in first.isProSyncActivestays "sync enabled" (relogin | connected) — the truth set (enabled databases) is unchanged, so membership/recovered-items consumers are unaffected.Guarantee preserved
The consent gate is intact: the daemon still only pushes after
sync_enabled, which the merge flips. Signing in first connects and setsauth_status=connectedbut publishes nothing (the push sweep is server-side gated). The sync-side companion that makes enabling-after-connect actually upload the existing graph is nodespace-sync#305 (merged).Behavioral notes (transparency)
pro-sync-pill) now surfaces after enabling sync (connected) rather than in the consent window — consistent with sync being opt-in.Tests
eslint --fix+svelte-checkclean. Pre-push gate (test:all +cargo build --bin nodespaced+ test:e2e) green.