Repository navigation
Drop the invitations first-run popup; auto-show only for a signed-in user with no access - #1776
Merged
Merged
Conversation
…user with no access (closes #1721) The invitations modal auto-opened on launch from a local-storage first-run flag, so it appeared for users who didn't need it — and could error (list_joinable 401) when the daemon wasn't signed in. Remove the localStorage-driven auto-open entirely and derive the auto-prompt from live store state: show it only when a signed-in user with sync active has, after collections have loaded, no collection access at all (the one case that needs to redeem or request an invite). A hasLoaded flag on the collections store keeps the prompt from flashing during the pre-load window for users who do have access. The account-menu Invitations path is unchanged. Adds 8 tests. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Summary
The invitations modal auto-opened on launch from a local-storage first-run flag, so it appeared for users who didn't need it — and could error (
list_joinable_collections401) when the daemon wasn't signed in.Change
FIRST_RUN_KEY,firstRunSeen/markFirstRunSeen,dismissedSignInEpisode, thefirstRunAutoOpenderived) frompro-sync-pill.svelte.signedInNoAccess = signedIn && syncEnabled && collectionsData.hasLoaded && collectionsData.collectionsTree.length === 0— i.e. a signed-in user (realtime identity) with sync active who, after collections have loaded, is a member of no collection (the one case that needs to redeem/request an invite). Dismiss suppresses it for the session; sign-out re-arms it.hasLoadedto the collections store so "no access" is only concluded after a real load resolves — prevents the prompt flashing during the pre-load window for users who do have access.proSync.signedInEpisodepreserved (still used by the consent slot); account-menu → Invitations path unchanged.Nothing queries the daemon on launch or while signed out (every open path now requires a signed-in session).
Tests
+8 tests (no auto-open with access; legacy localStorage key inert; auto-shows for signed-in + sync-active + no-access; no pre-load flash; no signed-out query/
list_joinable; dismiss stays closed; account-menu still opens it).bun run test= 4104 pass;svelte-check0 errors; lint clean.Closes #1721.