Skip to content

Add invite list UI showing registration link status and usage - #53

Merged
KallynGowdy merged 1 commit into
devfrom
claude/inspiring-sagan-koti97
Sep 25, 2026
Merged

KallynGowdy merged 1 commit into
devfrom
claude/inspiring-sagan-koti97

Conversation

@KallynGowdy

Copy link
Copy Markdown
Contributor

Description

Adds support for listing and displaying registration invite links generated by the bot, showing their status (unused, pending, used, expired, revoked) and usage details.

Changes:

  1. Backend API integration (registration-bot.ts):

    • Added types and parsing for the bot's /api/invites endpoint (PR Support jumping to events in notifications and inbox links #48)
    • New RegistrationInvite type with token hash, status, client ID, timestamps, and registration details
    • requestRegistrationInvites() function to fetch invites for the current user (or another user for admins)
    • Robust parsing that drops malformed entries while keeping valid ones
  2. UI components (InviteFlow.tsx):

    • New InviteList component displaying invites newest-first with status badges
    • Shows invite issuance date, status (color-coded), client, and token hash
    • Displays summary count ("3 invites · 1 used") above the list
    • Auto-refreshes list when a new link is generated
    • Sticky action buttons that stay visible while scrolling the invite list
  3. Styling (InviteFlow.css.ts):

    • New styles for invite list, cards, badges, and detail text
    • Color-coded badge tones: positive (used), neutral (unused/pending), muted (expired/revoked)
  4. Helper utilities (inviteList.ts):

    • describeInvite() — formats invite status with human-readable labels and details
    • summarizeInvites() — generates summary text like "2 invites · 1 used"
    • Handles all status types with appropriate tone and detail messaging
  5. React hook (useRegistrationInvites.ts):

    • useRegistrationInvites() hook that loads invites on mount and provides a refresh() callback
    • Keeps last-known list on screen while loading new data
  6. Tests:

    • Added inviteList.test.ts covering describeInvite() and summarizeInvites() with all status types
    • Added registration-bot.test.ts tests for URL building, response parsing, and HTTP request handling

Fixes the registration flow to show users the history and status of invitation links they've created.

Checklist:

https://claude.ai/code/session_018uEeWQpUstXyDM2hVAD2X8

Lists the links the registration bot generated for the current user,
with each one's status (not used yet / in progress / used by whom /
expired / revoked), using the bot's GET /api/invites from
HelloAOLab/matrix-bots#48. The list reloads after a new link is minted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018uEeWQpUstXyDM2hVAD2X8
@KallynGowdy
KallynGowdy merged commit 5dfa16b into dev Sep 25, 2026
4 checks passed
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.

2 participants