Skip to content

Add invites & join-requests admin sections to the Collaboration view (#241)#1475

Merged
mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:feature/issue-241-invites-requests
Jul 2, 2026
Merged

Add invites & join-requests admin sections to the Collaboration view (#241)#1475
mstomar125 merged 1 commit into
NodeSpaceAI:mainfrom
mstomar125:feature/issue-241-invites-requests

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Slice S4 of the collection-membership-UI epic (NodeSpaceAI/nodespace-sync#237) — invite & request management in the Collaboration view.

Stacked on #1474 (S3) → #1473 (S1). Cross-fork PRs base on main, so the diff includes the S1+S3 commits until they merge — review the top commit (Add invites & join-requests…). I'll rebase as the parents land.

What

Extends the S3 Collaboration view with two admin-only sections (gated on the caller's own admin role; consumes the invites/requests the S1 store already loads for admins):

Invites

  • Create an invite with a role, optional email binding, and a TTL preset (1 day / 7 days / never) → pro_create_invite.
  • A bearer (no-email) invite surfaces its share code with a copy button; an email-bound invite is delivered to that address (no code shown).
  • Pending-invites list with per-invite copy-code and revokepro_revoke_invite.

Join requests

  • List pending requests; approve with a selectable role → pro_approve_request, or rejectpro_revoke_invite (via the store's rejectRequest).

Tests

  • 4 new component tests (admin-only section gating; bearer-invite create with default role/TTL + code surfaced; revoke; approve-with-selected-role + reject). 9 total in collaboration-view.test.ts.
  • bun run quality:fix — ESLint 0/0, svelte-check 0 errors.

Depends on S1 (#238) + S2 (#239). Part of #241.

@mstomar125

Copy link
Copy Markdown
Contributor Author

APPROVE — S4 admin sections (invites + join-requests) are well-implemented and correctly gated; one load-bearing merge-order requirement below.

Verified against code at head 2a6d4d08:

Free-user mandate — intact. collaboration-view.svelte is only ever mounted from the collection-node-viewer's {#if proSync.isPro} branch (the S3/#1474 tab strip I verified earlier is +49/-0 with an {:else} preserving the original .collection-content). The new Invites/Join-requests sections render only when amAdmin is true, so a Pro non-admin sees the roster only. All service calls hit pro_* commands. Error handling + busy-state guards on all actions; approve passes the selected role through; reject correctly reuses revoke_invite. Tests pin the admin-vs-non-admin gating and the action flows.

⚠️ Merge-order (blocking on ordering, not on code): this branch is stacked on the pre-fix S1 commit 90efb7c3, not #1473's fixed head dd8ec94e. So its stores/membership.svelte.ts is still the un-guarded version — requirePro() absent, acceptInvite/requestJoin (:191/:196) and the other mutations lack the !isPro guard that #1473 added. This branch must rebase onto #1473 (dd8ec94e) / main-after-#1473 before merging — do not merge the raw branch ahead of #1473 or it regresses the community-inert store fix.

Good news: this is rebase-safe. #1475's own commit (2a6d4d08) changes only collaboration-view.svelte + its test — it does not touch the store. So the rebase drops the stale S1/S3 base and replays just the S4 UI on top of the guarded store; no hand-fix needed.

Epic order: #1473 (S1) → #1474 (S3) → #1475 (S4), rebasing each onto main as parents land. (CI: no checks reported yet.)

…odeSpaceAI#241)

Slice S4 — extends the S3 Collaboration view with the admin-only invite and
request management (all gated on the caller's own admin role):

- Invites: create an invite with a role, optional email binding, and a TTL
  preset (1 day / 7 days / never) via pro_create_invite. A bearer (no-email)
  invite surfaces its share code with a copy button; an email-bound invite is
  delivered to that address. Pending invites list with per-invite copy-code and
  revoke (pro_revoke_invite).
- Join requests: list pending requests, approve with a selectable role
  (pro_approve_request) or reject (pro_revoke_invite via the store's
  rejectRequest). The store already loads invites/requests for admins.

Tests: 4 new component tests (admin-only section gating, bearer-invite create +
code surfaced, revoke, approve-with-role + reject). 9 total in the file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mstomar125
mstomar125 force-pushed the feature/issue-241-invites-requests branch from 2a6d4d0 to 3b4f6ec Compare July 2, 2026 08:50
@mstomar125
mstomar125 merged commit 5ac0f1a 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