Skip to content

Drop the invitations first-run popup; auto-show only for a signed-in user with no access - #1776

Merged
mstomar125 merged 1 commit into
mainfrom
issue-1721-invitations-popup
Jul 28, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-1721-invitations-popup

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

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_collections 401) when the daemon wasn't signed in.

Change

  • Removed the localStorage-driven auto-open (FIRST_RUN_KEY, firstRunSeen/markFirstRunSeen, dismissedSignInEpisode, the firstRunAutoOpen derived) from pro-sync-pill.svelte.
  • Auto-prompt derived from live store state: 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.
  • Added hasLoaded to 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.signedInEpisode preserved (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-check 0 errors; lint clean.

Closes #1721.

…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]>
@mstomar125
mstomar125 merged commit 8c4c091 into main Jul 28, 2026
2 checks passed
@mstomar125
mstomar125 deleted the issue-1721-invitations-popup branch July 28, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invitations: drop the local-storage first-run popup; show only for a signed-in user with no tenant access

1 participant