PR: #424: feat(team): add expired invitations tab [Story-1750] by @ayush-pramaan
View PR →
Story 1750 · pramaan-app · Team page invitations

Expired invitations now have a visible home without changing pending counts

The Team page now fetches Clerk expired organization invitations and gives them a dedicated tab between Pending and Deactivated. Pending invitations still drive the Pending badge and seat usage; expired rows are display-only in this story.

Problem

Before this story, listTeamInvitations() asked Clerk only for pending and accepted. Once an invitation lapsed, Clerk moved it to expired and the firm admin lost visibility on the Team page.

What changed

AreaChangeWhy
src/lib/team-invitations/server.ts Fetches Clerk pending, accepted, and expired invitations. Clerk is the source of truth for expiry; the app should display that state instead of recomputing it.
presentation.ts Adds an expired tab model, row filter, and count. Expired rows stay separate from live pending invitations and deactivated members.
TeamListToolbar Extends the existing SegmentedFilter order to Members · Pending · Expired · Deactivated. Uses the established list toolbar primitive and avoids a bespoke filter control.
PendingInvitesTable / PendingInviteRow Reuses the existing invitation table and row names; expired rows hide actions. The row already knows how to render expired status, but Story-1750 is display-only and must not expose resend.

User-facing tab order

Members 3 Pending 1 Expired 1 Deactivated 1

The Expired tab renders the existing invitation row shape: invitee identity, capability, Expired status, and invited date. It does not render the resend/revoke action menu.

Count boundary

MetricIncludes expired?Evidence
Pending tab countNoteamRowsForTab("pending") filters to status === "pending".
Expired tab countYes, separatelyteamRowsForTab("expired") filters to status === "expired".
Seat usageNoseats.active + pendingInvitations.length is unchanged.
Server totalCountNoThe server response still computes pending-only totalCount for Bug-1354.

Acceptance evidence

Verification

Files changed

18 file(s), +310 / -28 lines

Path Role + -
messages/en.jsonConfig+6-0
messages/hi.jsonConfig+6-0
src/components/settings/team/pending-invite-row.tsxComponent+1-1
src/components/settings/team/pending-invites-table.tsxComponent+3-1
src/components/settings/team/presentation.test.tsComponent+42-0
src/components/settings/team/presentation.tsComponent+10-2
src/components/settings/team/team-list-content.stories.tsxComponent+47-7
src/components/settings/team/team-list-content.tsxComponent+5-1
src/components/settings/team/team-list-page.stories.tsxComponent+7-0
src/components/settings/team/team-list-page.test.tsxComponent+142-0
src/components/settings/team/team-list-page.tsxComponent+4-4
src/components/settings/team/team-list-toolbar.stories.tsxComponent+6-1
src/components/settings/team/team-list-toolbar.tsxComponent+6-0
src/components/settings/team/team-storybook-helpers.tsxComponent+3-1
src/components/settings/team/use-team-tab-state.tsComponent+2-0
src/lib/team-invitations/server.test.tsLibrary+4-3
src/lib/team-invitations/server.tsLibrary+9-7
tests/unit/team-presentation.test.tsTest+7-0