Skip to content

Add Invitations inbox + first-run onboarding to the Pro account menu (#242) - #1476

Merged
mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:feature/issue-242-onboarding-inbox
Jul 2, 2026
Merged

mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:feature/issue-242-onboarding-inbox

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Slice S5 of the collection-membership-UI epic (NodeSpaceAI/nodespace-sync#237) — the onboarding entry point.

Stacked on #1473 (S1). Cross-fork PRs base on main; the diff includes the S1 commit until #1473 merges — review the top commit. Independent of S3/S4 (touches pro-sync-pill.svelte, not the Collaboration view). I'll rebase onto main once #1473 lands.

What

  • invitations-inbox.svelte — a modal (house overlay + focusTrap) with:
    • Redeem an invite code → pro_accept_invite
    • Request to join a collection (by id) → pro_request_join
    • copy noting email invites apply automatically on sign-in (redeem_my_invites runs server-side on reconnect).
  • pro-sync-pill.svelte — an Invitations item in the account menu opens the inbox; a first-run effect opens it once per device on the first sign-in (localStorage-gated). Sign-out now also clears the membership store so the next user doesn't inherit the previous session's cached roster/identity.

Deferred (flagged in code)

Listing one's own pending invites / join-request statuses and discovering joinable collections have no client-facing backend yet (only admins can list a collection's invites/requests; there's no "my invites" RPC and no collection-discovery). The inbox works from a shared code / known collection id; surfacing auto-redeemed invites ("You were added to X") needs a daemon event or a my_collection_ids command — a follow-up.

Tests

  • 5 component tests (redeem success/failure, request-to-join, close, closed-render).
  • bun run quality:fix — ESLint 0/0, svelte-check 0 errors.

Depends on S1 (#238). Part of #242.

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE — S5 (Invitations inbox + first-run onboarding) is cleanly Pro-gated; one load-bearing merge-order requirement below.

Verified against code at head d7c27c4e:

Free-user mandate — intact. pro-sync-pill.svelte's new entry points live entirely inside {#if proSync.isPro}; the "Invitations" menu item is further behind menuOpen && signedIn, and invitations-inbox.svelte is mounted only in that Pro block — so a community user can never reach the inbox or the acceptInvite/requestJoin calls. First-run onboarding fires only when signedIn (daemon identity resolved) and is persisted once-per-device via the ns:invitations-firstrun-seen localStorage flag (not cleared on sign-out — correct: once per device, not per user). reset() on sign-out clears identity + roster cache so the next user doesn't inherit state. redeem()/requestJoin() have try/catch/finally with loading + friendly-error handling. Good.

⚠️ Merge-order (blocking on ordering, not on code): like #1475, this branch is stacked on the pre-fix S1 commit 90efb7c3 (its direct parent), not #1473's fixed head dd8ec94e. So stores/membership.svelte.ts here is the un-guarded version — acceptInvite/requestJoin (:191/:196) call the service with no !isPro guard. This is the slice whose entry points are community-reachable by design, so the store-level guard from #1473 matters most here: rebase onto #1473 (dd8ec94e) / main-after-#1473 before merging. Today the inbox's Pro-gated mount already prevents a community call path, so it's latent — but the defense-in-depth guard is exactly why #1473's fix exists; don't ship S5 on the pre-fix store.

Rebase-safe: #1476's own commit (d7c27c4e) touches only invitations-inbox.svelte, pro-sync-pill.svelte, and the inbox test — not the store. Rebasing onto main-after-#1473 replaces the store with the guarded version automatically; no hand-fix.

Nit (non-blocking): consider a membership.test.ts case asserting a mutation is inert in community mode (the query-method inert test exists; #1473 already added the mutation-inert test, which you'll inherit on rebase). Epic order: #1473 (S1) → #1476 (S5) — S5 is independent of S3/S4. (CI: no checks reported yet.)

…242)

Slice S5 — the onboarding entry point, on top of S1's store.

- invitations-inbox.svelte: a modal (house overlay + focusTrap) with a "Redeem
  an invite code" input (pro_accept_invite) and a "Request to join a collection"
  input (pro_request_join), plus copy noting email invites auto-apply on
  sign-in. Listing one's own pending invites / request statuses and discovering
  joinable collections have no client-facing backend yet (only admins can list a
  collection's invites/requests), so those are deferred with a comment.
- pro-sync-pill.svelte: an "Invitations" item in the account menu opens the
  inbox; a first-run effect opens it once per device on the first sign-in
  (localStorage-gated). Sign-out now also clears the membership store so the next
  user doesn't inherit the previous session's cached roster/identity.

Tests: 5 component tests (redeem success/failure, request-to-join, close,
closed-render). ESLint 0/0, svelte-check clean.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mstomar125
mstomar125 merged commit c2cf062 into NodeSpaceAI:main Jul 2, 2026
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.

1 participant