Skip to content

feat(console): the organization console for organization administrators - #1841

Open
guanzheh wants to merge 38 commits into
HarvardMadSys:devfrom
guanzheh:guanzheh/claude/org-console
Open

guanzheh wants to merge 38 commits into
HarvardMadSys:devfrom
guanzheh:guanzheh/claude/org-console

Conversation

@guanzheh

@guanzheh guanzheh commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

This PR adds the console part of the organization console of #1829. #1840 has the gateway part. The two pull requests change no file in common.

  • Entry. The navigation gets a group Organization with one entry, which has the name of the organization. Only an account that is an administrator of its organization sees the entry.
  • Area. /dashboard/organization has the frame of the Admin area and five pages:
    • Overview: spend, requests, tokens and members with requests for the last 1, 7 or 30 days, and the month against the limit of the organization. Two series, by day or by hour. The spend and the tokens for each model, and the top members.
    • Members: two cards, for the members near or over their limit and for the top spenders of today. A second press on a card puts the list back. One row for each member, with the spend of today, of the last 7 days, of this month and of all time. A search, a status filter, a limit filter, two spend filters, and a control that clears them. A click on a row opens a panel at the right side of the window.
    • Member panel: the figures of the member, and whether the account has an API key, a second factor and a verified email. Below them: the spend for each of the last 30 days, the models, the projects and the API keys by name, and the last requests.
    • Usage: four request volume cards, the requests of the members, and the totals for each model and each member.
    • Audit log: the management actions of the organization. An entry opens to show each changed field. A click on a member narrows the log to that member.
    • Settings: the record, the SSO connections and the administrators, which are read-only, and the default monthly limit for a member.
  • Member actions. In the panel, an organization administrator sets the monthly limit, disables models for the member and revokes one API key. The administrator also removes the member or restores a removed member. Each dialog says what changes. The panel of an administrator, of the organization or of the platform, has no action.
  • Shared components. The parts that the Admin console and the organization console both show are now one copy in components/features/console-shared/. The first five commits move them and add no feature. The Admin pages look and work as before. Three parts of the organization console have a look of their own: the two cards on Members, the 7-day column, which is an amount, and the request volume cards on Usage.
  • Admin → Users. An Organization column, an organization filter, and the organization with the role in the details of a user.
  • Settings of an account. An account that signs in through single sign-on only gets no password section. It confirms a sensitive action at its identity provider.
  • Notice of single sign-on only. A person can register with a password and connect the account of the organization later. Three places tell this person about the rule. After a failed password sign-in, the sign-in page shows a line and an SSO button when the gateway names the connection. The step that confirms a link says that the link removes the password. The form that connects an SSO account in Settings says the same.
  • Language and currency. The area follows the language of the reader, with 303 new entries in zh-CN.json. It shows amounts in the ledger currency.
  • Phone. The tables scroll sideways. The panel of a member has the width of the screen.
  • Documentation. console-translations.md says that this area is translated. The operator guide of feat(orgs): organizations with their own administrators and a monthly limit, gateway #1840 names the pages.

The Admin pages that make an organization are not in this PR. They are in #1830.

Why

#1840 gives an organization administrator the routes below /user/organization. Without these pages, the administrator must call the routes with a script.

Compatibility and upgrade notes

How it was verified

Tests on this branch alone:

Check Result
npm run format:check, npm run lint, npm run type-check, npm run i18n:check passed
npm run test 3,374 passed
next build passed
make docs-verify passed

Manual test with the gateway of #1840 from source, Keycloak 26 in Docker and the console from source. The organization had 14 synthetic members, two organization administrators and approximately 15,000 synthetic requests of the last 30 days:

  • Each page showed the seeded figures. These include the two cards, the four spend columns, the request volume, the token table, the top members and the hourly series of 7 days.
  • The Models dialog listed the four models of the deployment. A model that the dialog disabled appeared in the panel and in the audit log.
  • An audit entry opened and showed the old list and the new list of models.
  • The Settings page of a member had no password section. This was also true immediately after a link on the sign-in page, without a reload.
  • A password sign-in with an address of the organization failed. The sign-in page showed the line, and its button opened the sign-in page of Keycloak with that address. The link step and the connect form in Settings showed the sentence about the password. These three were correct in English with the dark theme and in Simplified Chinese with the light theme.
  • Admin → Users showed the Organization column, and its filter listed the members of the organization.
  • The Members page and the member panel were correct in English and in Simplified Chinese, and in the dark and the light theme. The Members page was correct at a width of 390 px.

The tests of the limit dialog, the remove dialog and the default limit are from an earlier revision of this branch.

Screenshots

The organization and its members in the screenshots are synthetic.

Overview. The totals of the last 7 days and the month against the limit of the organization. Below them: two series, the spend and the tokens for each model, and the top members.

en-dark-overview

Members. The two cards, the filters, and one row for each member.

en-dark-members

Member panel. The facts and the figures of the member, its projects and API keys by name, the disabled models, and the last requests.

en-dark-member

Member actions. The dialog that disables models for a member, and the dialog that revokes one API key. The dialogs for the monthly limit and for the removal are as before.

en-dark-models-dialog en-dark-revoke-dialog 05-set-monthly-limit 06-remove-member

Usage. The request volume, and the requests of the members, newest first.

en-dark-usage-top

Audit log. The management actions of the organization, with one entry open.

en-dark-audit-open

Settings. The record, the SSO connection, the administrators and the limits.

11-settings

Admin → Users. The Organization column and the organization filter.

admin-dark-admin-users

Notice of single sign-on only. The sign-in page after a failed password sign-in, the step that confirms a link, and the connect form in Settings.

en-dark-login-notice en-dark-link-confirm en-dark-settings-connect

Language and theme. The Members page and the member panel in Simplified Chinese and in the light theme.

zh-light-members zh-light-member
  • Targets dev, not main
  • make format and make test pass
  • Docs updated in the same change, if behaviour or configuration changed

🤖 Generated with Claude Code

guanzheh and others added 13 commits November 18, 2026 21:57
The gateway has routes for the administrators of an organization
(`/user/organization/*`) and returns the organization of an account in
`GET /user/me`. The console did not read them.

- `lib/api/organization.ts` has one function for each route. A monthly
  limit goes out in the USD field on a USD ledger and as a native amount
  with its currency on another ledger.
- `useOrganization.ts` has one query hook for each read. The ledger
  currency is part of each key. A write reads every cached answer of the
  organization again before it reports success.
- The session keeps `organization {id, name, role}` from the profile.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An administrator of an organization had no page to see the members of the
organization or to manage them. The gateway routes existed without a
console.

The console now has an organization area at `/dashboard/organization`,
with five pages:

- Overview: spend, requests, tokens and active members of a period, the
  month against the organization limit, two series and spend by model.
- Members: one row for each member with its usage and its month against
  its limit. A row opens in place with the details of the member. From
  there the administrator sets the monthly limit, removes the member or
  restores a removed member.
- Usage: the requests of the members, and the totals by model and by
  member. The gateway sends no request content, and the page shows none.
- Audit log: the management actions of the organization.
- Settings: the record, the SSO connections and the administrators, which
  the platform administrator controls, and the default monthly limit of a
  member, which the organization administrator sets.

The navigation shows one entry, named after the organization, to an
account that is an administrator of its organization. The area is
translated (zh-CN), follows the ledger currency, and works at phone width.
The gateway decides who can read each page; the console only selects what
to show.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The translation guide says that administration pages stay in English. The
organization console looks like the Admin area, but its readers are the
staff of an organization. The guide now says that it is translated.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Usage page keeps the rows of the page before on screen while the next
page loads. A second click on "Older" in that time asked for the same
page again and put its cursor on the way back twice. "Older" and "Newer"
now wait for the page.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The details of a member opened in the row of the member. The prototype of
the organization console shows them in a panel at the right side of the
window, with the list behind it.

A click on a row now opens that panel. It has the status of the member,
the actions, the figures, the spend for each of the last 30 days, the
models and the last requests. The panel is a modal layer: focus moves into
it and back to the row, Tab stays inside, and Escape, Close and a click on
the dimmed list close it. A confirmation that opens over the panel has the
keys while it is open. On a phone the panel has the width of the screen.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The list of members showed a limit of a member and the default limit of
the organization in the same way. After a change of the default, the list
did not show which rows the change moved.

- A row whose limit is the default now has the word "default" under the
  figure. The word hangs below the line, so it moves no bar and no figure.
- The bar of a limit draws its whole track in a color that shows in the
  light and in the dark theme. Thus every bar of the list has one length,
  and only the filled part differs.
- The bar and the figure have fixed places, so they line up down the list.
- An amount that rounds to 0% still shows a filled part. No spend shows
  none.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The two charts of spend, in the overview and in the panel of a member,
read their amounts from the answer but took the currency from the site
configuration of the page. A page that stayed open while the ledger
changed from USD to CNY wrote 70 yuan as $70, under the title "Spend per
day (USD)", beside cards that showed yuan.

The title and each amount of a chart now use the currency that the
gateway sent with the points of the series.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The list of requests and the list by member kept their position together
with the filters it was reached with, and only hid it when the filters
changed. Older, then Errors, then All statuses showed the older page
again and not the newest requests. The second page of the members came
back after 7d, 30d, 7d.

The position is now dropped when the filters change. The two lists share
one hook for it, useListPosition.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… models

- The axis of a spend chart wrote each amount in full, and an amount of
  1,000 or more was cut at the edge of the chart. The axis now has the
  short form, 1.35K. The tooltip and the table keep the amount in full.
- A line of one point drew nothing. One point is now a dot.
- Each row of the spend by model was a grid of its own. The bars ended at
  different edges, and they were not on one scale. The list is now one
  grid.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- The organization routes were read with jsonOrThrow, which reads each
  409 as "This email is already registered". A dialog showed that text
  for a removal, a restore or a limit that the gateway refused. The
  routes are now read with readJson, which keeps the sentence of the
  gateway.
- The panel offered a limit and a removal for a member that is an
  administrator of the platform, and the gateway refused both. The panel
  now has no action for a member that the gateway marks as protected.
- A typed limit is now plain digits with at most four decimal places.
  Number() read 0x10 as 16 and 1e3 as 1000.
- The same amount typed another way, 40.0 for 40, is no change. The
  default limit kept Save active for it and sent it again on each click.
- The limit dialog opens with the cursor in the amount.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- The member list and the audit log went back to the first page on each
  change of the search text, also when the search itself did not change,
  and 300 ms after the page opened. The page now starts again only when
  a filter changes.
- On a later page that had become empty, the usage by member and the
  audit log said that there was nothing, with no pager. They now go to
  the last page that has rows, as the member list does.
- While the total of a new period loaded, the usage by member gave each
  member a share of the total of the period before. It now gives none.
  A total that cannot be read shows its error with a retry.
- A click on the header "Monthly limit" ordered the members by the spend
  of the month. It now orders by the share of the limit, which is what
  the column shows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…organization

- A press that began in the panel of a member and ended on the dimmed
  list closed the panel, as the end of a selection of text does. Only a
  press on the dimmed list itself now closes it.
- After a rename of the organization, the header, the navigation entry
  and the audit log kept the old name until a reload. The area now reads
  the organization, shows its name, and reads the profile again when the
  name differs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Upstream dev gained six commits after this branch was cut: MCP tools in
the playground chat, a retry of the failed requests of a batch, the
effective concurrency cap in GET /v1/key, and three dependency and deploy
changes. The merge has no conflict, and no file of the console changed
on both sides.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-20T20:47:32.398754Z
We couldn’t complete this review. Comment @codex review to try again.
974e5cf Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@1a1a11a 1a1a11a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console side looks solid to me. The guard only picks what to show (the gateway enforces access), the query cache is cleared on account change in AuthProvider so org data doesn't leak between accounts, writes invalidate the whole ['organization'] prefix, and memberActions matches the gateway's protected/removed rules. Test coverage of the views and the API client is good.

Most of my feedback depends on how the limit-ownership questions on #1840 are resolved:

  1. The limit dialog edits the account quota, which can be a platform-set quota. monthly_limit_source === 'member' covers any account_quotas value, including one a platform admin set in Admin → Users (MemberDialogs.tsx:49-50). An org admin then sees it as "the member's own limit" and can clear or raise it. If #1840 keeps that behaviour, the dialog should at least say so. If #1840 separates the two, this needs to follow.
  2. The default-limit hint is incomplete. "Applies at once to each member that has no monthly limit of its own" (SettingsView.tsx:183). In #1840 the default also binds org admins and platform admins who are members, whose limits this console otherwise says it can't set. Either the gateway excludes them (my preference), or the copy should say it.
  3. The ceiling check is skipped silently before the organization loads. ceiling = moneyAmount(organization, 'monthly_limit') is null while organization is undefined (MemberDialogs.tsx:57), so readLimit skips the above-limit check. The gateway still returns 400, so this is only UX, but disabling Save until the organization has loaded would be cleaner. Relatedly, the typed currency comes from the member row while the ceiling is read from the organization; a mismatch there would compare amounts in different currencies.

CI: no check runs or statuses are reported on 974e5cf.

Comment on lines +49 to +50
const own =
member.monthly_limit_source === 'member' ? moneyAmount(member, 'monthly_limit') : null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'member' here includes a monthly quota the platform admin set in Admin → Users (the gateway writes the same account_quotas row). So this dialog lets an org admin clear or raise it. Depending on the outcome in #1840, either surface where the limit came from, or block editing a platform-set quota.

// The dialog is for one amount: the field has the cursor when it opens.
const fieldRef = useRef<HTMLInputElement>(null);

const ceiling = moneyAmount(organization, 'monthly_limit');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While organization is still undefined this is null, so readLimit skips the above-limit check, and the user gets the gateway's 400 instead. Consider disabling Save until the organization has loaded. Also, currency comes from the member row while the ceiling comes from the organization, so it may be worth asserting they match.

<p id={noteId} className={FIELD_HINT}>
{t(
'organization.settings.default_hint',
'Applies at once to each member that has no monthly limit of its own. Leave empty for no default.',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #1840 the default also applies to org admins and platform admins who are members (_ACCOUNT_MONTHLY_QUOTA has no role check). Elsewhere this console says the org sets no limit for those. Either the gateway excludes them, or this hint should say it covers administrators too.

…istrator's

The gateway now keeps two limits for a member: the one its organization
sets, and the monthly quota that the platform administrator sets for
the account. The lower one applies.

- The limit dialog edits the limit of the organization only. It opens
  with that limit, and says what the platform administrator set when
  there is such a quota.
- A limit that is the platform administrator's has the word "platform"
  under it in the member list, as a default has "default", and the
  member panel names it.
- The hint of the default limit says that it does not apply to
  administrators.
- Save is off until the organization is read, because its limit is the
  ceiling. An organization read in another currency gives no ceiling:
  the gateway then decides.
- An organization has no status field.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@guanzheh

Copy link
Copy Markdown
Contributor Author

All three points are addressed in e9c7a3c, after the changes in #1840.

  1. Changed. The dialog edits the limit of the organization only. It opens with that limit, and shows the quota of the platform administrator when there is one. The list and the panel name a limit that is the platform administrator's.
  2. The gateway now excludes administrators from the default (feat(orgs): organizations with their own administrators and a monthly limit, gateway #1840), and the hint says so.
  3. Changed. Save is disabled until the organization has loaded. The ceiling is used only when the organization was read in the currency of the amount. If not, the gateway decides. Tested.

@1a1a11a 1a1a11a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed e9c7a3c against the backend change in #1840 (a20e46e). It lines up:

  • The limit dialog now edits only own_monthly_limit (the org's own limit, on the membership row) and shows the platform admin's quota read-only. That's the fix for my earlier point about this dialog editing the platform quota.
  • Save waits for the organization, so the above-limit check can't be skipped while it's loading. The ceiling is dropped when the org was read in a different currency, and the gateway's 400 covers that case.
  • The 'platform' source is handled in LimitMeter, MemberDetailPanel and the type, and matches the backend Literal. The default-limit hint now says it doesn't apply to administrators.

One small UX point inline. Nothing blocking from me on this delta.

No CI check runs are reported on this head commit.

cancelLabel={t('common.cancel', 'Cancel')}
busyLabel={t('common.loading', 'Loading...')}
busy={save.isPending}
confirmDisabled={!organization}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With confirmDisabled={!organization}, if the organization query fails (rather than just loading), Save stays disabled with no explanation in the dialog. A short "couldn't read the organization" line when organization is undefined and the query has errored (or passing the error down) would avoid a silently dead button. Minor.

The limit dialog keeps Save off until the organization is read, because
its limit is the ceiling. When that read failed, the button stayed off
with no reason. The dialog now says that the organization could not be
read, and has a Retry that reads it again. A read in progress shows
nothing more, and an organization that was read before stays in use.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@guanzheh

Copy link
Copy Markdown
Contributor Author

Addressed in 5c35136.

Changed. When the read of the organization failed, the dialog now says that the organization could not be read, with a Retry that reads it again. Save stays disabled until the organization is read. Tested in the component tests, and on the page with the request failed in the browser.

@1a1a11a 1a1a11a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at 5c35136 (full head 5c35136c102be9119d04726f2e4ab2e10743e65a), since my review at e9c7a3c.

One commit since then. It addresses my inline point about Save staying disabled with no explanation:

  • When the organization read has failed, MembersView passes onRetryOrganization (MembersView.tsx:316, gated on organization.isError). The limit dialog then shows an alert that the organization couldn't be read, plus a Retry (MemberDialogs.tsx:187-203). Save stays disabled through confirmDisabled={!organization}.
  • The notice only appears when there's no data and the read errored. So a load in progress, or a background refetch that failed while an earlier read is still in hand, shows nothing and keeps Save enabled. The second component test pins that down, and the MembersView test covers the wiring end to end. The organization.retry key already exists in zh-CN.json, and the new string is translated.

One small UX point inline, about what Retry looks like while it runs. Nothing blocking from me.

CI: no check runs or statuses are reported on 5c35136 (combined status is pending with 0 statuses).

</form>
{/* Save is off without the organization. A read that failed gives the
reason and the way to try again; a read in progress needs neither. */}
{!organization && onRetryOrganization ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: with @tanstack/react-query v5 (^5.17.0 here), a query that errored keeps status: 'error', so isError stays true while the refetch from Retry runs (only fetchStatus goes to 'fetching'). As written, clicking Retry changes nothing on screen until the refetch succeeds (the notice disappears) or fails again (no change at all). A second click is just deduped. To show that something is happening, you could pass isFetching down and disable Retry (or swap the text to "Reading...") while it's true, or gate onRetryOrganization in MembersView.tsx on organization.isError && !organization.isFetching.

guanzheh and others added 4 commits November 22, 2026 22:33
…onsoles

The search box, the status pill, the summary card, the spend cells with
the trend line and the threshold filter move to
components/features/console-shared. Each takes its data and its actions
as props. The Users tab and the organization's Members page use them, and
look as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The list that the Users tab shows in the details of an account moves to
components/features/console-shared. The caller reads the projects and
writes each line of figures, and decides if a reader sees the masked key.
A key can carry a control at the end of its line. The Users tab looks as
before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The figures of a lookback window (requests, ok, failed, average latency)
move to components/features/console-shared. The Requests tab adds its own
lines and its bars to the card, and looks as before. The four copies of
the latency format in the Admin Console become one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ed components

The one-line summary of a change, the opened entry with each field in
full, and the mark of a row that opens move out of the Audit tab to
components/features/console-shared. The caller chooses the lines of the
record that a reader sees. The per-model token table of the Token usage
section moves there too, with a choice of columns. Both Admin pages look
as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
guanzheh and others added 16 commits November 22, 2026 22:41
…component

The tooltip box, the axis text and the grid lines were three copies: in the
analytics cards, in the growth card and in the chart of the organization
pages. They are one set of values in components/features/console-shared.
The series chart of the organization pages moves there too. No chart
changes its look.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…wo member actions

The API module and the query hooks get what the gateway added: the spend
of a member today, in 7 days and in all time, the two summary cards, the
limit-state and threshold filters, the projects, keys and models of a
member, the request volume, an hourly series, the member filter of the
audit log, and the calls that set the models of a member and revoke one
of its API keys.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…sers has

Members: two cards above the list (near or over the limit, top spenders
today) that open the list on their filter and order; filters for the use
of the limit and for a least spend of today and of the month; the spend
columns today, 7-day trend, this month and all-time, in place of the
1d / 7d / 30d switch.

Member panel: whether the account has an API key, a second factor and a
verified email; its projects and keys by name with their spend, and a
Revoke action on an active key; the models that are off, with a Models
dialog. A protected member gets neither action.

The bar of a limit turns amber from 80%, the mark that the filter and the
card use.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…bers of an organization

Usage: four cards with the requests of the last hour, day, week and
month, how many ended well and how many failed, and the average latency.

Audit log: a row opens on every field that the action recorded, and on
no source address; the member of a row narrows the log to that member;
the category Access, with the two new events in words.

Overview: the members with the highest spend, a table of the tokens of
each model (input, output, cached, requests), and a choice of hours or
days for the series of 1d and 7d. Hours of several days have their day in
the label.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Users tab gets an Organization column after the status, a filter (any
organization, none, or one of them) that it keeps in the address, and the
organization with the role in the details of an account. A deployment
that has no organization shows neither the column nor the filter.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…gh SSO only

The gateway marks such an account with sso_only on GET /user/me and
refuses a password for it. The personal Settings page then shows no
section to change or to set one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The gateway sends the five that lead each card. The shared summary card
takes how many of its accounts to show; the Users tab keeps three.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…beside it

The shared table kept the Admin console's classes on the organization's
overview, where its frame and its lines stood out from the panels next
to it. A caller now names the classes of the parts that differ, and the
Admin console names none.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Settings named the only way in of an account with "Set a password before
disconnecting it". An account that signs in through single sign-on only
now reads that it belongs to an organization.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Members: a failed read of the two cards is said, with a retry, and is no
longer two zeros. The 7-day total is also text for a screen reader. A
threshold below the least value is not sent, and its field is marked.

The share of a limit is decided on the ratio itself, as the gateway
compares it, and is rounded down: 79.6% reads 79% and is not near, 99.6%
reads 99% and is not over.

Member panel: a key with no time of use was "not used since the account
joined", not "never used". The note for an administrator names the
models and the API keys too.

Audit log: a change of models says what the action turned off and what
it turned on again, not the whole list after it.

Settings: the two refusals of a disconnect are told apart, and each has
its own sentence. A member of an organization is not told to set a
password to add an authenticator, and confirms the deleting of its
account at its identity provider, not with a phone code.

The tests of the organization hooks cover the three new reads and the two
new writes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The gateway no longer counts from the day an account became a member.
The all-time card of the member panel says nothing under its figure, and
a key without a time of use is a key that was never used.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… signs in through SSO only

Login: when a password is refused for an address that an organization's
single sign-on answers for, a line under the error says so, with a
"Log in with SSO" action that starts the sign-in for the address that
was typed.

The step that asks to connect a waiting identity, and the form in
Settings that connects one, say before the action that the account then
signs in through that provider only and that its password is removed.

Each shows only with the field the gateway sends for it: sso_sign_in on
the refused sign-in, sso_only_after_link on the waiting identity, and
sso_only_provider on the identities of the account.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…nd read the profile again after a link

After a link on the sign-in page, the console went on with the profile it
had read before the link. Settings then still offered "Change Password" to an
account that had just become a member and had no password any more. The
sign-in page now reads the profile again before it goes on.

The two notices were easy to overlook:

- On the sign-in page, the action of the notice was a line of bold text
  under the sentence. It is a filled button now.
- In Settings, the sentence was small print between the last field and the
  buttons. It is a warning box at the top of the form now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…re, and a page style the heading of projects and keys

Two options on components that the Admin console and the organization
console share. The Admin console does not use them, and looks as it did.

- `SpendCells` takes `week`: the total of the last days. With it, the cell
  is that figure, like the cells beside it, and no line is drawn.
- `ProjectsAndKeys` takes `headingClass`, for a page whose other headings
  look another way.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d models and the request volume of the organization console

Members:

- The two cards above the list are lists with bars now, without an accent
  color. Each says in words how many members it holds ("13 members spent
  today"), where it had a bare figure beside five names.
- A card is a switch. A second press puts the list back, and the card says
  which of the two a press does. "Clear filters" puts the list back from any
  filter, order or search.
- The 7-day column is an amount, as the three columns beside it are.

Member panel:

- Status, joined, last sign-in, API key, two-factor and email are one panel
  of named facts, on the columns of the figures below it. They were two lines
  of small text.
- "Disabled models" lists the models one to a line, and marks those of the
  platform administrator. The audit log says "Disabled" and "Enabled again".

Usage:

- The request volume cards have no heading and no explanation above them.
  Each card has its window, the count, a bar of how the requests ended, and
  the two counts and the average latency under it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… name of the organization

The sentence said that the account signs in "through Example University
only". A person signs in through single sign-on, and a member can sign in
through each identity that is linked. The sentence now says "through single
sign-on only", in the two places that have it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@guanzheh

Copy link
Copy Markdown
Contributor Author

The pages for the second part of #1840 are here, as new commits. No pushed commit is rewritten.

  • Shared components. Changed in part. The first five commits move the parts that the two consoles both show to components/features/console-shared/. These are the summary cards, the spend cells with the trend, the filters, the projects and keys, the request volume card, the open audit entry, the token table and the series chart. They add no feature, and the Admin pages look and work as before. A later commit adds two options to the spend cells and to the projects list, which Admin does not use. The request list and the audit list stay two tables, because their columns differ: Admin shows the request content and the source address. Tested.
  • Organization console. Changed. Members: the two cards, the filters and the four spend columns. Member panel: the account facts, the projects, the keys, the model switch and the key revoke. Usage: the request volume. Audit log: the open entry and the member filter. Overview: the top members, the token table and the hourly series. Tested.
  • Admin → Users. Changed: an Organization column, an organization filter, and the organization with the role in the details. Tested.
  • Settings of an account. Changed: no password section for an account that signs in through single sign-on only. Tested.
  • Notice of single sign-on only. Not in the request. The sign-in page shows a line and an SSO button after a failed password sign-in with an address of an organization. The link step and the connect form in Settings say that the link removes the password. Tested.

Three points where the result is not the request word for word:

  • Three parts of the organization console do not have the look of Admin. The two cards on Members are lists with bars. The 7-day column is an amount, where Admin has a trend line. The request volume cards on Usage have a bar of the requests that ended well and that failed. The Admin pages keep their look, and only Admin uses the shared summary card and request volume card.
  • Member details stay in the panel at the right side, and a row in Admin → Users still opens in place. The parts inside the two are the shared ones.
  • The bar of a monthly limit turns amber at 80%, where it was 90%. This is the threshold of the "near the limit" filter.

Before and after

The pages at the first review (2026-11-20) and now. The description has the screenshots of the parts that are new. The organization and its members are synthetic.

First reviewNow
Overview
Members
Member panel
Usage
Audit log

Beside the Admin console. The cards, the 7-day column and the request volume cards are the three parts that do not have the look of Admin.

Admin → UsersOrganization → Members
Admin → Recent RequestsOrganization → Usage

guanzheh and others added 2 commits November 23, 2026 17:56
…page uses

`SpendCells` had `trendTitle`, the total of the trend as a title and as
hidden text, for the member list of the organization console. That list now
shows the total as a figure. `SummaryCard` had `shown`, for a card with five
names; the organization console has its own cards now. The Users tab of the
Admin console passed neither, and looks as it did.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…he sign-in notice

- A module's look gets its own link for the action of the sign-in notice
  again. The filled button is for the console's own look only: a module
  styles that action itself.
- After a link, a profile read that fails is made once more before the page
  goes on. `refreshUser` now resolves to whether the profile was read.
- A window with one request says "1 request".
- "Clear filters" and a card also empty a threshold field that holds a
  number the list does not take.
- The line at the foot of a member card is for the eye. The card keeps one
  name for a screen reader, and its state is the state of the switch.
- A member card uses the bar colors of a limit, and a share of zero draws no
  fill, as on the bar of a limit.
- Tests: a search that is applied, with a card and with "Clear filters"; the
  look of the action in both looks; what `refreshUser` resolves to.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@1a1a11a 1a1a11a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at 02ac77f, covering the 22 commits since my last pass at 5c35136 (04550a9..02ac77f), read against the #1840 head 38cac90.

The new pages follow the gateway closely:

  • Member actions. memberActions still hides every action for protected members and admins. Revoke is only offered for active keys, and the 409/404 answers from #1840 come back as the dialog error. The models dialog never offers a platform-disabled model as toggleable. It keeps an org-disabled model visible after the platform stops offering it, so it can still be turned back on. It also sends only real changes, which matches the known filter on the gateway side.
  • SSO-only accounts. The password section, the 2FA setup and the delete-account proof all key off sso_only / sso_reauth_provider, the same way the gateway decides. refreshUser now returns whether the read succeeded, and confirmLink re-reads the profile after a link, so Settings doesn't flash a password form for a fresh member.
  • Login notice. The SSO line only shows for the address that was actually refused (ssoHint compares against the field), it's suppressed while a link is waiting, and jsonOrThrow only keeps sso_sign_in when provider_name is a non-empty string. The provider name is rendered as text, so there's no markup injection there.
  • Shared components. Moving them into console-shared/ looks behavior-neutral for the Admin pages as far as I can tell. The amber threshold changing from 90% to 80% is called out in the description.

A few things:

  1. unlinkRefusal tells the two 409s apart by comparing error.message with the gateway's English sentences (SsoIdentities.tsx L125-140). Today they match sso_routes.py in #1840 exactly. But any wording change on the gateway, or a gateway that ever localizes its detail, silently drops a member back to the generic text. Since #1840 is still open, a machine-readable code on those two refusals (an error / code field, like sso_sign_in got) would be sturdier than string equality.
  2. The Retry point from my last review is still open (MemberDialogs.tsx, the organization-read notice). With react-query v5, isError stays true while the refetch runs, so Retry gives no feedback until it resolves. Minor, mentioning it only so it isn't lost.
  3. Small cleanup: in SsoIdentities.tsx the old JSDoc for lastMethod ("Why the account's only way in stays...", L116-120) now sits orphaned above the refusal constants. function lastMethod itself has no comment.

One thing to keep in mind from my #1840 review: the org console now shows the whole account's history, including requests from before the account joined. That's consistent with the gateway and documented there, so nothing needs to change here.

CI: GitHub reports no check runs on 02ac77f, so I'm relying on the local results in the description.

*/
export function unlinkRefusal(error: unknown, t: Translate, ssoOnly: boolean): string {
if (error instanceof APIError && error.statusCode === 409) {
if (error.message === ORGANIZATION_IDENTITY_REFUSAL) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only works while the gateway's detail stays byte-identical to these constants. Right now it matches sso_routes.py in #1840. Since both PRs are still open, could the gateway add a small code to these two 409s (e.g. {"code": "organization_identity"} / "last_sign_in") and could this switch on that instead? Otherwise a copy edit on the backend quietly changes what members see.

/** Why the account's only way in stays: said before it is tried, and when it is refused. */
function lastMethod(t: Translate): string {
/**
* Why the account's only way in stays: said before it is tried, and when it is

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this doc block belonged to lastMethod and is now stranded above the refusal constants, right before a second JSDoc. Move it down to function lastMethod, or drop it.

The comment had stayed above the two refusal constants when they were
added before the function.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@1a1a11a 1a1a11a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at e2b7608, since my pass at 02ac77f.

One commit since then, touching only SsoIdentities.tsx: the JSDoc for lastMethod moves from above the refusal constants to directly above function lastMethod (now L142-146). That resolves my cleanup point 3. It's a comment-only move with no behavior change, and the ORGANIZATION_IDENTITY_REFUSAL / LAST_SIGN_IN_REFUSAL block now carries only its own comment, which reads correctly.

The other two points from my last review are unchanged at this head and haven't had a reply yet, so I'm restating them briefly so they don't get lost:

  1. unlinkRefusal still matches the two 409s by exact English text (error.message === ORGANIZATION_IDENTITY_REFUSAL / LAST_SIGN_IN_REFUSAL, L126-139). If the gateway's wording changes, or its detail is ever localized, it quietly falls back to the generic message. Since #1840 is still open, I'd still prefer a machine-readable code on those two refusals. If you'd rather keep string matching, a test on the gateway side that pins those two sentences would at least make a drift fail loudly.
  2. Retry feedback in the organization-read notice of the limit dialog (MemberDialogs.tsx L195-203): the button gives no pending state while the refetch runs. This is minor and doesn't block.

Nothing new to flag in this delta.

CI: GitHub reports no check runs on e2b7608.

This branch has not been deployed

No deployments
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