feat: add invite members modal with copy to clipboard#202
Closed
dotmantissa wants to merge 1 commit into
Closed
Conversation
Adds an Invite button to the chat header (next to Audit and Members) that opens a modal for sharing group invite codes. When the modal opens it immediately calls POST /api/groups/[id]/invite to generate a fresh UUID invite code, displays it in a monospace block, and provides a one-click copy button. A success toast confirms the copy. Users can also regenerate a new code without closing the modal. Error states (failed generation, clipboard denied) surface as toast notifications with a retry option so the flow never silently fails.
|
@dotmantissa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Collaborator
|
@dotmantissa please resolve conflicts |
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.
📌 Pull Request
🔗 Related Issue
Closes #181
📝 Description
POST /api/groups/[id]/invite) already existed. This PR wires the frontend to that endpoint and delivers the copy-to-clipboard experience described in the issue.🚀 Changes Made
New files:
components/invite-members-modal.tsx— self-contained Radix Dialog component with a trigger button, invite code generation, copy button, success/error feedback, and a regenerate optionModified files:
app/chat/page.tsx— importsInviteMembersModaland renders it in the chat room header alongside the existing Audit and Members buttons🧪 Testing & Validation
Validated:
POST /api/groups/[id]/invite"Invite code copied to clipboard!")pnpm exec tsc --noEmit) passes with zero errorsmx-4on small screens📸 Screenshots (REQUIRED for UI changes)
📋 Contributor Checklist (MANDATORY)
Closes #181)💡 Notes for Reviewer
components/invite-members-modal.tsx— the modal calls the API on every open (not cached) so each open yields a fresh invite code. This is intentional: it avoids stale/expired codes being presented to the user.expires_inbut we omit it here for simplicity). If time-limited codes are required, that can be added as a follow-up option in the modal.