Skip to content

feat(companies): the Company page is one searchable table, and invites take a pasted list - #661

Merged
allisonmahmood merged 2 commits into
mainfrom
t3/redesign-company-user-management
Oct 13, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
t3/redesign-company-user-management

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

The Company page was hard to use. Three people and three invites filled a whole screen: each person was a block of prose with their own row of Promote and Deactivate buttons, invites sat in a separate list, and the invite form took one address at the bottom of the page. You couldn't search or scan for admins, and an invite whose email failed looked almost the same as one still waiting.

It's now one table, built from concept A of these four concepts:

  • One row per person or invite: initials, name and email, role, how many live patches they own, and status. Invites that need an admin (email didn't go out, or expired) come first with Resend beside them, then waiting invites, then people A to Z, then deactivated users.
  • Tabs (All, Admins, Invited, Deactivated) with counts, and a search over names and emails. Both are plain links and a GET form, so the page still runs no script.
  • One menu per row for make admin or member, deactivate or reactivate (the same pick pages as before), resend and revoke. It's a native popover, like the What's new panel.
  • Invite a pasted list. The invite box takes up to invites.batch (50) addresses, split on commas, semicolons or new lines, with repeats counted once. If any address is bad or the list is too long, nothing is sent, the list stays in the field and the problem shows under it. Otherwise each address is its own invitation, and the page names any that were skipped because they're already in a company or already invited. An address whose save fails stays in the box while the rest go out.

Members see the same page without the invite box or menus, as before.

The patch counts come from Patches, which Companies can't depend on. CompanyPage.OwnedPatches is a Context.Reference that the server fills from Patches.read, counting live patches the viewer can open, the same pattern as Patches.Openability. Without it the page leaves the column out.

The shell gains avatar, tag, tabs with count, btn-icon, menu and field-grow, written into the ui-consistency spec. docs/product.md describes the new page. The new contract limit is in docs/limits.md and kept out of the patchy-server skill's table, like the rate. and look. limits.

Screenshots, before and after as an admin and a member, the open menu, a refused list and a phone: https://post.patchyhq.com/d/8pmqccykookh (public but unlisted; local dev data only).

How it was verified

  • pnpm verify passes: format, lint, typecheck, synth, test, postgres-concurrency, cli-smoke, tier2-smoke and browser.
  • Added tests. CompanyPage.test.ts: a pasted list with repeats, a member and an existing invite (one invitation and one event per new address, 409 naming the rest); bad, empty and oversized lists refused with 422 before any mail, with the text and role kept and escaped; tabs and search, including links that keep both; the Patches column from a supplied OwnedPatches. Server.test.ts checks the booted server's count against the database.
  • GPT 6.1 Sol reviewed it at xhigh; the findings and fixes are in the comments.

Release impact

  • Breaking
  • Not breaking: the routes and the invite form's email field are unchanged (the field may now hold a list), with no schema or API change.

Made by Claude Opus 5.5 via Claude Code in T3 Code

… and invite a list into

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added area:server Touches the server area area:core Touches the core area area:docs Touches the docs area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines labels Oct 13, 2026
…ady in a company"

An address whose save fails no longer drops the rest: the others go out, the
page names what was saved, and the failed addresses stay in the box (503).
Someone in another company is "already in a company", not in this one.
Typography stays with the shell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

GPT 6.1 Sol review (xhigh), round 1

Three findings, all fixed in 8c763ac.

  1. Major: a failed save partway through a list lost the outcome. With a b c, if saving b hit a SqlError, a had already gone out but the page answered with a generic 503, c was never tried, and the pasted list was gone. Retrying was safe, because a would come back as "already has an invite", but the admin had to paste the list again. Fixed: a failed save now stops only that address. The rest go out, the page names what was saved, and the failed addresses stay in the box with a 503. New test: keeps going past an address it cannot save and leaves that one in the box, which injects the SqlError through a Companies service that fails one address.
  2. Minor: "already in Acme Co" was wrong for someone in another company. AlreadyInCompany comes from a global user lookup. Fixed: the notice now says "already in a company", as the old message did, without naming which one.
  3. Minor: page CSS set line-height on .company-person. Typography belongs to the shell. Fixed: the declaration is removed.

Sol also ran the 19 CompanyPage and 12 Server tests and found no leak in the patch counts: they come from Patches.read under the viewer's own access, and the OwnedPatches wiring reaches the routes.

@allisonmahmood
allisonmahmood merged commit 593479a into main Oct 13, 2026
13 checks passed
@allisonmahmood
allisonmahmood deleted the t3/redesign-company-user-management branch October 13, 2026 19:11
allisonmahmood added a commit that referenced this pull request Oct 13, 2026
…s and Company pages are easier to use (#667)

Release 11's What's new entry, written through `a253cb2`. It ships as
`patchy` `0.11.0`.

**Changes**
- New: Tools can show your PostHog data (#662, #664)
- Improved: The Connections page stays clear with one connection or
thirty (#657)
- Improved: Find anyone on the Company page (#661)
- New: Invite many people at once (#661)
- Fixed: Browser tabs show Patchy's icon and your tool's name (#660)

**Behind the scenes**
- Each version of Patchy now skips kinds of connection it doesn't know,
so going back to an earlier version stays safe (#657)

**Deploying in two steps.** `c1e7de9` (#657 and everything before it) is
released first, with no entry of its own. Then main is released with
this entry. A rollback from the PostHog release therefore lands on a
release that hides PostHog connections and dev-read calls instead of
failing on them. Global CLIs and patch repos on `0.10.0` are told to
upgrade, as on any release.

Made by Claude Opus 5.5 via Claude Code in T3 Code

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Touches the core area area:docs Touches the docs area area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant