Skip to content

Invite: offer Add a seat when every paid seat is taken - #2135

Merged
davidmckayv merged 1 commit into
mainfrom
seat-required-screens
Nov 24, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
seat-required-screens

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

On OpenBot Cloud's per-member plan an organization holds only the seats it paid for. Once it has paid, inviting one more person needs another seat, and the Invite dialog said "That couldn't be done just now. Try again." for good. This is the screen side.

Built on #2133 (the spec: SEAT_REQUIRED and addSeatUrl), whose commit this branch carries until it merges.

What changed

  • Invite dialog (Settings > Organization > Invite). A 402 SEAT_REQUIRED refusal shows the server's sentence ("Each member is $5 a month. Add a seat to invite someone.") in the body's text colour, and for an owner or an admin one Add a seat button to addSeatUrl in place of Invite. The address and role stay typed. Editing the address clears the refusal and brings Invite back. With no addSeatUrl (someone who can't add a seat), the sentence shows and Invite stays.
  • Coming back. Pressing Add a seat keeps the invitation being written in this tab. Back on the organization's settings, the Invite dialog opens again by itself with the address and role as they were, so Invite sends it. It is read once and only for that organization. Where addSeatUrl is OpenBot's own address, it is given returnTo pointing at the organization's settings, as the add-a-card address takes it.
  • Built from the dialog's own Dialog, Button and buttonVariants link, the same way the plan dialog's Add a card is drawn. No new package.
  • Organizations that don't pay per member are unchanged: their invitations never get this refusal.

New: app/src/lib/organizations/seat.ts (reading the refusal, the Add a seat address, keeping and taking the draft invitation).

Test

app/tests/organization-invitations.test.tsx, "with every paid seat taken, the invitation says what a member costs and offers Add a seat, and back from adding it, Invite sends it": the fake server answers the invite call with the spec's 402 SEAT_REQUIRED problem. The test checks the sentence, no "try again", the Add a seat link (to addSeatUrl, coming back to the organization's settings), no Invite button, nothing invited; then, with a seat added, coming back opens the dialog with the address kept, and Invite sends it.

  • Red on the component before this change: fails at the Add a seat link (Unable to find an accessible element with the role "link" and name "Add a seat").
  • Green with it. The whole file passes (39 tests).

Checked

  • Screenshots in headless Chromium, light and dark, 1440 and 390 wide: the plain Invite dialog, the seat refusal and the reopened dialog. The refusal adds one line of text and swaps the primary button; spacing, type and buttons match the dialog as it was.
  • App typecheck, Biome, and the user-copy tests (no-intelligence, no-reload-the-page, plain-setup-words, no-composio, no-retired-page-names) and the client boundary pass.

An organization that pays for each member holds only the seats it bought, so inviting one more person needs another seat. The Invite dialog read that refusal as an ordinary failure. Now a SEAT_REQUIRED refusal shows the server's sentence and, for an owner or an admin, one Add a seat button to addSeatUrl in place of Invite. The invitation being written is kept in the tab, and back on the organization's settings the dialog opens again with the address and role as they were, ready to send.
@davidmckayv
davidmckayv force-pushed the seat-required-screens branch from 655bd32 to f4b6fcc Compare November 24, 2026 20:35
@davidmckayv
davidmckayv merged commit 6ab211f into main Nov 24, 2026
23 checks passed
@davidmckayv
davidmckayv deleted the seat-required-screens branch November 24, 2026 20:58
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