Skip to content

feat: redesign Teams, Keys, People, Status, Analytics and Sign in - #61

Merged
brtydse100 merged 73 commits into
mainfrom
feat/redesign-pages
Nov 20, 2026
Merged

brtydse100 merged 73 commits into
mainfrom
feat/redesign-pages

Conversation

@brtydse100

@brtydse100 brtydse100 commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Targets main; #59 and #60 are merged.

What changes

Brings every remaining page into the design introduced in #60.

Foundation

  • Every component now uses the design tokens directly, so light and dark themes work natively.
  • The legacy global colour-override block in index.css (about 250 lines that remapped old dark-theme classes) is removed. That block was the root cause of the unreadable "Deletion is intentionally guarded" warning on Teams, which was already broken on main.
  • New shared building blocks:
    • components/ui.ts: buttons, fields, cards, table captions and tones;
    • components/Page.tsx: page header, pill, callout, usage bar and metric card.

Pages

  • Teams: each team is a row with name, ID and tags, spend against budget with a bar, models, RPM/TPM, members/keys, and actions. The deletion warning is a readable callout, and the search sits in the list header.
  • Keys: each key row shows the key and masked ID, owner, team chip, spend with a bar (sand at 80%, red at 95%), and an Active/Blocked pill. Click-to-select and every label are unchanged.
  • People:
    • local accounts are a table with avatar, role and status pills, and actions;
    • the add-user form is a card;
    • the directory is a searchable table;
    • the three headed help notes are kept, below the directory.
  • Status: a readiness banner, gateway and database metric cards, a security warnings callout, and a real audit table (time, action, actor, details, outcome).
  • Analytics: metric cards with coloured top edges, a restyled chart (bar width capped so a few days don't fill it), and the model table.
  • Sign in: a navy brand panel (logo or custom logo, plus login text) beside the form; on phones the panel stacks above the form. SSO, local login and the custom logo and text work as before.

Fixes

  • The sidebar no longer highlights "Audit log" and "Status" together; links now compare the #section part of the address.
  • "Audit log" scrolls to the audit table.
  • On phones the current page's link stays in view in the scrolling nav row.
  • The Organization edit panel's "own spend" swatch was invisible in dark mode; it now uses a neutral tone.

Setup guide setting

  • The My key "Setup guide" link used to open the built-in API reference for every user and could not be changed. A new optional setup_guide_url (SETUP_GUIDE_URL, Helm config.setupGuideUrl) now drives it; blank hides it. Administrators find the API reference in their account menu. Synced across config, .env.example, Compose, Helm, docs/configuration.md, DEPLOYMENT.md and API.md.

README and demo media

  • The README hero and docs/media screenshots now show the redesigned UI (2400 x 1350, demo data), with Organization and dark-theme captures and a small screenshot table in the README. The old walkthrough video and hand-drawn SVGs of the previous UI are removed.

No other API, permission or behaviour changes. Button labels and accessible names the tests rely on are kept.

Validation

  • Backend: pytest passed (918 passed, 5 skipped); helm lint and the docs and configuration checks pass.

  • Frontend:

    • Prettier, ESLint, tsc and the build are clean;
    • Vitest passed 240 of 240;
    • npm audit --omit=dev found no vulnerabilities.
  • Playwright:

    • demo specs: 20 passed;
    • API-mocked specs (admin-navigation, my-key-customization, organization-chart, key-model-budgets, dynamic-policy-fields, login-customization): 13 passed.
    • The SSO and LiteLLM integration specs run in CI against live Keycloak and LiteLLM and pass.
  • Screenshots of every page in light and dark at 1440 px, plus Sign in, Teams and Keys at 390 px, were reviewed during development.

Review follow-ups

Reviewed by independent judges over eleven rounds, several of which rendered every page at phone, tablet and desktop widths in both themes; the last two approved with nothing to change. Changes made in response:

  • Colours: solid button fills keep white labels at 4.5:1 or better in both themes and darken on hover; the Teams Delete button is red again (small buttons take colours from a variant); chart gridlines use the line colour; a test rejects competing colour classes on shared buttons.
  • Phones: hidden table labels stay inside their scroll boxes so no page scrolls sideways; key rows stack under the key; the current sidebar link stays in view after late loads.
  • Status and audit: the Audit log link rescrolls on repeat clicks, scrolls even when the audit failed, and does not jump when data loads; dependency cards say "Unknown" when status itself cannot be read.
  • Accuracy: expired keys show "Expired" using the same rule as My key; Analytics shows an empty chart instead of crashing when there is no usage.
  • People: the directory stays first and the three headed help notes are kept.
  • Live SSO tests (CI): the redesign had dropped the copyable account email and the "Assigned through" line; both are restored (in feat: redesign My key and Organization pages #60) and covered here by demo browser tests.
  • Tests: audit navigation, sidebar active links, key status pills, empty analytics, and phone-width checks for every page. Each new test was checked to fail without its fix.

Preview image

docker pull ghcr.io/brtydse100/litegate:test-pr-61-cb1a817

Built from tag test-pr-61-cb1a817; the image's org.opencontainers.image.revision is cb1a8175f47fdb961d0e4b5758c8fc4389f84eee, the PR head.

🤖 Generated with Claude Code

brtydse100 and others added 30 commits November 19, 2026 07:44
With hundreds of members and groups, every Organization page load sent one
/team/info request per group and one /user/info request per listed member,
and the background sweep re-synchronized everyone every minute.

- Organization overview spend reads one paged /v2/team/list snapshot and the
  member table reads one paged /key/list snapshot. Each refreshes at most
  once a minute and concurrent readers share a single refresh. Teams missing
  from the listing, or a listing without spend, fall back to per-item reads.
- The full organization sweep runs every ORGANIZATION_SYNC_INTERVAL_SECONDS
  (default 900, 60-86400). Budget and per-user limit edits wake it early;
  passes stay at least 60 seconds apart. Sign-in and key operations still
  synchronize their own user immediately.
- Key writes and budget enforcement keep reading live LiteLLM data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- My key: navy top bar for users, budget ring with refill date and pace,
  key card with Show/Copy and a full-width Regenerate key action, status
  and details side column; create state for users without a key.
- Admin shell: navy sidebar with Workspace/Manage/System groups and a
  readiness dot on Status.
- Organization: root tabs, metric cards, budget split, needs-attention
  list, lazily loaded group table with re-rooting, and an edit panel that
  saves group budgets and per-person limits through the budget endpoints.
- Design tokens as CSS variables for light and dark themes; IBM Plex is
  bundled so the CSP needs no external font hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every page now uses the design tokens directly, so light and dark themes
  work natively; the legacy global colour-override block in index.css is
  removed (this also fixes the unreadable Teams deletion warning).
- Shared page header, card, table, pill, callout and button styles.
- Teams and Keys: table-style rows with spend-vs-budget bars and status
  pills. People: local accounts and the directory as tables, with one short
  help note. Status: readiness banner, dependency metric cards, warnings
  callout and an audit table. Analytics: metric cards and restyled chart.
- Sign in: navy brand panel beside the form; stacks on phones.
- Sidebar: "Audit log" and "Status" are no longer highlighted together; the
  current link stays in view on phones; Audit log scrolls to the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Cache a failed bulk listing for the snapshot TTL so an outage or an
  oversized installation does not make every waiting request repeat it.
- Stop on the first page when LiteLLM reports more pages than the bound.
- Fall back to team info unless the listing has spend, max_budget and
  budget_duration, so sparse listings never report a false mismatch.
- Correct stale "60-second" wording and document what waits for the sweep.
- Test failure caching, early bound, sweep wakes from every edit endpoint,
  a wake during a pass, and that enforcement never reads the snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Per-person limit tags and descriptions only say "override" when the API
  names this group as the source; no-limit and out-of-scope sources no
  longer read as overrides.
- "Everything is healthy." needs loaded status and spend; otherwise the
  header says what is unavailable or still loading.
- Near-budget count compares unrounded spend; wording matches.
- Solid teal, sand and danger button tokens keep white labels at 4.5:1 in
  both themes; the ready dot is a token.
- Account menu: focus moves in, arrows/Home/End, Escape returns focus,
  theme item is a menuitem. Root picker uses pressed buttons, not tabs.
- No daily pace for periods under a day; unit tests for keyBudget and the
  Organization label helpers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	frontend/src/components/AppChrome.tsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d pages

- Solid teal, danger and sand buttons use fills that keep white labels at
  4.5:1 in both themes; sand-ink is darkened for light mode.
- Teams values carry screen-reader column names; budgets and periods use
  the shared money and duration formatting.
- Custom logos sit on a white tile on navy (sign-in and sidebar); docs say so.
- Table captions are opaque, so the sticky audit header hides rows beneath.
- Audit link follows router navigation: repeat clicks rescroll, plain
  Status returns to the top, and trailing slashes keep the active link.
- Analytics bars spread evenly; few-day ranges label the bars directly.
- People page keeps its directory first and its three headed help notes.
- Avatar and navy text use tokens; unused legacy colour scales removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Health line, near-budget count and attention items now check the
  selected root group itself, not only its descendants.
- Near-budget wording covers groups already over budget.
- Restore "LiteGate has no saved copy of this key" when a key cannot be
  shown.
- Not-ready sidebar dot uses a light alert tone readable on navy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Raise a fresh HTTPException per caller instead of re-raising one cached
  object whose traceback grows for the whole TTL.
- Treat a malformed listing (bad JSON or numbers) as a cached 502 so
  reports fall back instead of returning 500.
- Count a key repeated across offset pages once.
- Docs state exactly when teams and members are read individually.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Screen readers read words instead of spelling short capitalised labels.
Organization table captions are opaque.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	frontend/src/index.css
- Plain Status scrolls the window too, so phones return to the top.
- Scroll once per navigation, never again when audit data arrives.
- Tests cover repeat audit clicks and the return to top.
- "1 model" instead of "1 models" on Teams.
- Table headers and page captions are written in sentence case and
  capitalised with CSS so screen readers read words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also assert the no-saved-copy note for keys that cannot be revealed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stub jsdom's window.scrollTo for every test and scope scrollIntoView to
the navigation tests.

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

- Empty report pages and scopes with no visible groups no longer load a
  bulk listing.
- Key listings stop at 50 pages (5,000 keys, the administrative listing
  limit) so a cold load stays short; larger installs read per item.
- Listing failures are logged once per refresh; data age counts from the
  start of the load.
- API.md and comments no longer describe a 60-second reconciler.
- The enforcement tripwire rejects any access to the snapshots.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Sync errors and unassigned people come before budget warnings, and a
  "Show N more" control reveals anything beyond three.
- Opening a group moves focus to its panel heading.
- The per-person limit field shows the configured value and how to
  restore it; the group budget no longer claims to come from config.
- Usage report's accessible name starts with its visible text.
- The overview no longer refetches on window focus, as documented.
- sand-ink passes 4.5:1 in light mode; negative amounts read "-$5";
  small budgets keep a full-width spend bar.
- The Audit log shortcut moves to the next PR, which adds the hash-aware
  links and scrolling it needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Solid button fills darken on hover so white labels keep 4.5:1.
- Key rows say Expired for keys past their expiry instead of Active.
- The Audit log link scrolls to the audit section even when it failed.
- Restore the Audit log shortcut now that links and scrolling handle it.
- Visible hover on select-all, select-page and pager buttons; the member
  move field uses the shared input style; the error page card stands out.
- "1 account", "resets every day"; docs say People page and blue checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The per-person field promises the inherited or configured limit, since
  a parent override can differ from the configured value.
- "Show more" resets when the root changes or the list shrinks.
- Closing the group panel returns focus to the row that opened it.
- One isKeyExpired rule, shared by My key and the admin key list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An installation over the listing bound logs at info, not warning.
- Listing reuse counts from the end of a load so a slow LiteLLM does not
  trigger back-to-back reloads; docs say so.
- Tests: empty pages and scopes skip the listings; the team page bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
brtydse100 and others added 26 commits November 19, 2026 21:09
The upward menu was 240px wide in a 236px sidebar, so its edge was cut
off and the sidebar gained a horizontal scrollbar. It is now 208px, with
a browser test. Docs name the Usage report button.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The danger colours were added on top of buttonSmall's grey ones, and
Tailwind picks between two colour classes by stylesheet order, so the
grey won. Small buttons now take their colours from a variant
(buttonSmall / buttonSmallDanger). Tests reject competing colours in the
shared class strings and colours added on top of a shared button.
The sign-in completion screen uses the canvas background like the loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both dependency cards claimed an outage when the status request failed;
they now say Unknown with a neutral marker. The audit scroll box is the
containing block for its hidden copy notice, the button colour guard also
checks conditionals and hover/state prefixes, and the docs note Analytics
appears only when enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- When the top-bar links wrap on phones the avatar stayed at the left and
  its right-anchored menu opened off-screen (x = -163 at 390px). The
  links now align right and the menu is capped to the screen, with a
  browser test that fails without the fix.
- The create-key card says saved keys can be shown again when LiteGate
  stores secrets, and "shown once" only when it does not.
- Sub-groups in the edit panel get distinct colours.
- The gateway card's dot stays neutral until status arrives.
- Docs mention that saving in the panel refreshes the overview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Below the lg breakpoint the panel rendered after the usage report; once
the report loaded it pushed the newly focused panel off-screen, so
opening a group looked like nothing happened. The panel now comes first
on narrower screens, with a browser test at 390px and 768px that fails
without the fix.

Also: the top-bar divider only shows when links share a row, and member
emails in the report keep a readable column width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The phone link row scrolled to the current page only when the route
changed, so links and status dots that arrive after load pushed it off
screen (Teams, Keys, People and Status opened directly). The row now
scrolls itself whenever the route or the link list changes, with a
browser test that fails without the fix.

Also: key-row owner, team and spend span the full width on phones so
emails do not break mid-word, and the team table fits its box exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel switched beside the report at Tailwind's lg (1024px), but the
admin sidebar, report column and panel only fit side by side from about
1136px, so between 1024px and 1136px it wrapped under the report and was
pushed off-screen again. It now comes first in the page and moves beside
the report from 1140px; keyboard order matches what is on screen. The
browser test covers 390, 768, 1024, 1100 and 1280px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where scrollbars take space (Windows, for example) the report and panel
no longer fit at exactly 1140px, so they wrapped and the panel dropped
below the report again; between 1136px and 1139px the panel also sat on
the left. From 1140px the two columns never wrap (the report gives up a
scrollbar's width), and below it the panel always takes its own row. A
browser test gives scroll areas 17px scrollbars and checks 1136-1157px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Playwright launches Chromium with --hide-scrollbars, so the injected 17px
scrollbar style created none and the test could not catch the bug. The
check now lives in its own demo spec that keeps scrollbars, and asserts
the scrollbar really takes 17px; with the previous layout it fails at
1140px and 1150px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The redesign showed the signed-in email as plain text, dropping the copy
button the sidebar footer had, and replaced the Organization page heading
with the greeting, so nothing named the page. The sidebar footer and the
account menu use the shared copyable email again, and the page's h1 is
"Organization" with the greeting below it. Both regressions were caught
by the live SSO tests in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	frontend/src/components/AppChrome.test.tsx
The top bar showed the signed-in email only as text inside the account
button, so on My key the address had no copy button until the menu was
opened. The address now sits beside the button with its own copy button.
A demo browser test checks it is visible and copies on My key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copying is asynchronous, so reading the clipboard straight after the
click could race the write and fail intermittently.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live SSO restart tests look for "Assigned through" on My key, which
the redesign had dropped along with the "Key status: …  Contact an
administrator" note for keys that are not working. The status card shows
the full assignment path again, and the note returns under the same rule
as before (not for Ready, Needs attention or Updating, which have their
own messages). A demo browser test checks the assignment line.

Also give the organization Refresh test five seconds for its refetch; it
timed out once on a loaded CI runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	frontend/e2e/demo-mode.spec.ts
#	frontend/src/components/AdminOrganization.tsx
#	frontend/src/components/AdminStatus.tsx
#	frontend/src/components/AppChrome.test.tsx
#	frontend/src/components/AppChrome.tsx
#	frontend/src/components/ThemeToggle.tsx
#	frontend/src/components/organization/GroupPanel.tsx
#	frontend/src/index.css
#	frontend/src/pages/Home.tsx
#	frontend/src/pages/MyKey.tsx
#	frontend/tailwind.config.ts
@brtydse100
brtydse100 changed the base branch from feat/redesign to main November 20, 2026 07:23
brtydse100 and others added 2 commits November 20, 2026 09:24
Replace the README hero and the docs/media screenshots with captures of the
redesigned interface from the demo build (2400 x 1350, sanitized demo
data), add the Organization page and the dark theme, and add a small
screenshot table to the README. Remove the walkthrough video and the
hand-drawn SVGs, which showed the old interface; the media index points
to the live demo instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The top-bar link labelled "Setup guide" actually opened the built-in API
reference (/api/docs), could not be changed or hidden, and showed to every
user. A new optional setup_guide_url (SETUP_GUIDE_URL, Helm
config.setupGuideUrl) now drives the link; blank hides it. Administrators
keep the API reference as "API reference" in their account menu.

Synced across config.py, .env.example, Compose, Helm values/configmap,
docs/configuration.md, DEPLOYMENT.md and API.md, with backend and
frontend tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brtydse100
brtydse100 merged commit 3337b09 into main Nov 20, 2026
10 checks passed
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