Skip to content

feat(clients): four party tabs — Clients/Partners/Past clients/Prospective - #116

Open
itkujo wants to merge 1 commit into
mainfrom
feat/clients-four-categories
Open

feat(clients): four party tabs — Clients/Partners/Past clients/Prospective#116
itkujo wants to merge 1 commit into
mainfrom
feat/clients-four-categories

Conversation

@itkujo

@itkujo itkujo commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

What

Reworks the Clients roster to exactly four party tabs (Aug 11 review), in this order, alphabetical within each tab:

  1. Clientsclient
  2. Partnerspartner + unassigned (the worker's domain-named placeholder orgs default here instead of a separate "Unassigned" tab)
  3. Past clients — new type past_client
  4. Prospective clientsprospect + lead (leads == prospects; the lead enum value stays valid, just displays here)

Internal (the single GA workspace) stays separate, linked beside the tabs.

Changes

  • New enum past_client (additive): migration 0019, CLIENT_TYPES, hand-regen database.types.ts (union + runtime array), exhaustive Record<ClientType> maps (ClientDetailsCard TYPE_LABELS, contacts/shared ORG_TYPE_STYLE), and a past_client case in orgTypeLabel so calendar chips don't fall back to "Internal".
  • Tabs (clients/page.tsx): PARTY_TABS → four entries each carrying a types set; active tab fetches all its types in one request (?type=partner,unassigned). Removed the Leads tab and the party === 'unassigned' special-casing. List sorted name.localeCompare.
  • API (clients/route.ts): resolveTypes now also accepts a comma-separated ?type= list (split + filter against CLIENT_TYPES); all / single-value / absent cases unchanged. Backward compatible.
  • Add modal: options are now Client / Prospective client / Partner / Past client (dropped redundant "Lead").

Re-assignment is unchanged — the client-details type picker moves an org to any tab (except system-managed internal/unassigned), so demoting a live client → Past clients is the intended path.

Migration

⚠️ 0019_client_type_past_client.sql needs applying to the shared Supabase (coordinate with orchestrator). Additive only — add value if not exists, nothing destructive or renamed.

Verification

pnpm -r typecheck ✓ · pnpm -r lint ✓ · web tests 66/66 ✓ · worker tests 215/215 ✓. Live preview of the authenticated /clients page wasn't run (no launch.json; page behind Logto SSO). Change is presentational + additive-enum and fully type-checked.

Brief: docs/plan/clients-four-categories.md

🤖 Generated with Claude Code

…ctive

Rework the Clients roster to exactly four party tabs (Aug 11 review), in order,
alphabetical within each tab:

- Clients             → client
- Partners            → partner + unassigned (unassigned no longer a separate tab)
- Past clients        → new type past_client
- Prospective clients → prospect + lead (leads fold in; lead value stays valid)

Adds an additive `past_client` enum value (migration 0019, shared enums,
database.types, exhaustive Record<ClientType> maps, orgTypeLabel). Tabs now fetch a
type-set via a comma-separated `?type=` (resolveTypes extended, backward compatible).
Drops the Leads tab and the unassigned special-casing; Add modal offers
Client/Prospective/Partner/Past client. Re-assignment via the existing edit path.

Migration 0019_client_type_past_client.sql needs applying (shared Supabase, additive).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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