Skip to content

refactor(web): split SettingsComputeUsage into components/ai-usage (L4, pure move) - #2746

Merged
simple-agent-manager[bot] merged 4 commits into
mainfrom
sam/task-l4-landing-slice-my6che
Nov 15, 2026
Merged

simple-agent-manager[bot] merged 4 commits into
mainfrom
sam/task-l4-landing-slice-my6che

Conversation

@simple-agent-manager

@simple-agent-manager simple-agent-manager Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Pure reorganization slice of the self-host landing plan (L4). The coordinator (task 01M7AF82KG9C78WAABTG3V1MN1) verifies the move and merges. Do not merge as author.

Summary

apps/web/src/pages/SettingsComputeUsage.tsx is 776 lines on main, over the 500-line limit in .claude/rules/18-file-size-limits.md. This PR moves the AI usage and AI budget sections into apps/web/src/components/ai-usage/. It is a pure move with no behaviour change. The file names and split points match the integration branch sam/selfhost-pass-2 (its own pure-move commit 34dbd5d46), so later slices apply as small diffs. Every moved body is main's current code, not the integration branch's.

File Lines Contents
pages/SettingsComputeUsage.tsx 776 → 259 formatHours, formatDuration, QuotaProgressBar, SettingsComputeUsage
components/ai-usage/format.ts 16 (new) formatCost, formatTokens, truncateModel
components/ai-usage/AiUsageSection.tsx 196 (new) AI_PERIODS, AiUsageSection
components/ai-usage/AiBudgetSettingsSection.tsx 309 (new) BudgetBar, BudgetSettingsSection
  • The only edits inside moved declarations are five added export keywords, on formatCost, formatTokens, truncateModel, AiUsageSection and BudgetSettingsSection. Everything else that changed is an import line.
  • The page's public surface is unchanged. App.tsx lazy-loads SettingsComputeUsage by name, and tests/playwright/fixtures/native-hardware-harness.tsx imports it the same way. Neither file is touched. Nothing else imported the moved symbols.
  • There are no import cycles: page → ai-usage/*, and AiUsageSection / AiBudgetSettingsSection → format.
  • How it was made: .tmp/l4/split.py (scratch, not committed) cut whole line ranges verbatim from git show origin/main:apps/web/src/pages/SettingsComputeUsage.tsx. Only the import blocks were written by hand.

Left for a later slice

Item File Reason left out
MonthlyCapUnavailableNote component apps/web/src/components/ai-usage/MonthlyCapUnavailableNote.tsx New behaviour (a notice when the installation cannot read AI Gateway cost data). It has no counterpart on main.
Monthly-cap-unavailable logic apps/web/src/components/ai-usage/AiBudgetSettingsSection.tsx (branch commits eba74739a, 55f8be286) Behaviour change: capAvailable / savedCapUsd, clearing the cap on save, "spending" vs "token" header copy, the conditional monthly-cap input and notes. It depends on the new monthlyCostCapAvailable field in packages/shared/src/types/ai-usage.ts.
Rename BudgetSettingsSection → AiBudgetSettingsSection AiBudgetSettingsSection.tsx declaration, plus page import and JSX The rename would change a non-import line (<BudgetSettingsSection />) in the page. Kept main's name. The file name already matches the branch.
Header doc comment apps/web/src/components/ai-usage/format.ts line 1 on the branch It is not a line on main.

AiUsageSection.tsx is byte-identical to the integration branch's file. Every item above is a deliberate omission. The task-completion-validator derived the same list independently.

Pure-move proof

1. Symbol table and per-symbol extraction comparison

node .tmp/l4/verify.cjs (scratch, not committed, like L2/L3's). It parses git show origin/main:<page> and the four new files with the TypeScript compiler API. It matches every top-level statement of main's page by name, and compares the statement text exactly. The only normalisation is dropping a leading export on the new side. It then compares old and new line multisets.

$ node .tmp/l4/verify.cjs; echo exit=$?
| Symbol | Old (main) | New | Identical |
|---|---|---|---|
| `formatHours` | SettingsComputeUsage.tsx:24-27 | SettingsComputeUsage.tsx:15-18 | yes |
| `formatDuration` | SettingsComputeUsage.tsx:29-35 | SettingsComputeUsage.tsx:20-26 | yes |
| `formatCost` | SettingsComputeUsage.tsx:37-41 | format.ts:1-5 | yes |
| `formatTokens` | SettingsComputeUsage.tsx:43-47 | format.ts:7-11 | yes |
| `truncateModel` | SettingsComputeUsage.tsx:49-52 | format.ts:13-16 | yes |
| `AI_PERIODS` | SettingsComputeUsage.tsx:58-63 | AiUsageSection.tsx:13-18 | yes |
| `AiUsageSection` | SettingsComputeUsage.tsx:65-241 | AiUsageSection.tsx:20-196 | yes |
| `BudgetBar` | SettingsComputeUsage.tsx:247-288 | AiBudgetSettingsSection.tsx:13-54 | yes |
| `BudgetSettingsSection` | SettingsComputeUsage.tsx:294-543 | AiBudgetSettingsSection.tsx:60-309 | yes |
| `QuotaProgressBar` | SettingsComputeUsage.tsx:549-627 | SettingsComputeUsage.tsx:32-110 | yes |
| `SettingsComputeUsage` | SettingsComputeUsage.tsx:633-776 | SettingsComputeUsage.tsx:116-259 | yes |

Symbols: 11, identical: 11. Statements in new files that are not on main: none

Lines removed and not re-added (19):
- import type {
-   ComputeUsageResponse,
-   UserAiBudgetResponse,
-   UserAiUsageResponse,
-   UserQuotaStatusResponse,
- } from '@simple-agent-manager/shared';
- import { Bot, Clock, Cpu, Gauge, Key, Server, Settings2, ShieldAlert } from 'lucide-react';
- import {
-   fetchComputeUsage,
-   fetchUserAiBudget,
-   fetchUserAiUsage,
-   fetchUserQuotaStatus,
-   updateUserAiBudget,
- } from '../lib/api';
- function formatCost(usd: number): string {
- function formatTokens(n: number): string {
- function truncateModel(model: string, max = 32): string {
- function AiUsageSection() {
- function BudgetSettingsSection() {
Lines added that were not in the old file (26):
+ import type { ComputeUsageResponse, UserQuotaStatusResponse } from '@simple-agent-manager/shared';
+ import { Body, Card, CardTitle, SectionHeading, Spinner } from '@simple-agent-manager/ui';
+ import { Body, Card, CardTitle, SectionHeading, Spinner } from '@simple-agent-manager/ui';
+ import { Clock, Cpu, Gauge, Key, Server } from 'lucide-react';
+ import { useCallback, useEffect, useState } from 'react';
+ import { useCallback, useEffect, useState } from 'react';
+ 
+ 
+ 
+ 
+ import { BudgetSettingsSection } from '../components/ai-usage/AiBudgetSettingsSection';
+ import { AiUsageSection } from '../components/ai-usage/AiUsageSection';
+ import { fetchComputeUsage, fetchUserQuotaStatus } from '../lib/api';
+ export function formatCost(usd: number): string {
+ export function formatTokens(n: number): string {
+ export function truncateModel(model: string, max = 32): string {
+ import type { UserAiUsageResponse } from '@simple-agent-manager/shared';
+ import { Bot } from 'lucide-react';
+ import { fetchUserAiUsage } from '../../lib/api';
+ import { formatCost, formatTokens, truncateModel } from './format';
+ export function AiUsageSection() {
+ import type { UserAiBudgetResponse } from '@simple-agent-manager/shared';
+ import { Settings2, ShieldAlert } from 'lucide-react';
+ import { fetchUserAiBudget, updateUserAiBudget } from '../../lib/api';
+ import { formatCost, formatTokens } from './format';
+ export function BudgetSettingsSection() {

Declarations that only gained `export `: 5
  function formatCost(usd: number): string {
  function formatTokens(n: number): string {
  function truncateModel(model: string, max = 32): string {
  function AiUsageSection() {
  function BudgetSettingsSection() {
Remaining removed/added lines that are not import lines or blank: 0
exit=0

The script was shown to discriminate. With No LLM usage yet changed to No LLM usage yet! in AiUsageSection.tsx, it reported AiUsageSection … NO, identical: 10, 2 flagged lines, and exit 1. With pct >= 80 changed to pct >= 81 in BudgetBar, it reported BudgetBar … NO. Both edits were reverted; after that the run was clean (exit 0).

2. Whole-diff removed vs added lines (multiset), plain git

$ git diff origin/main...HEAD -- apps/web | grep -E '^-' | grep -vE '^--- ' | cut -c2- | sort > removed.txt
$ git diff origin/main...HEAD -- apps/web | grep -E '^\+' | grep -vE '^\+\+\+ ' | cut -c2- | sort > added.txt
$ wc -l < removed.txt; wc -l < added.txt
522
526
$ comm -23 removed.txt added.txt     # removed, not re-added
  ComputeUsageResponse,
  UserAiBudgetResponse,
  UserAiUsageResponse,
  UserQuotaStatusResponse,
  fetchComputeUsage,
  fetchUserAiBudget,
  fetchUserAiUsage,
  fetchUserQuotaStatus,
  updateUserAiBudget,
function AiUsageSection() {
function BudgetSettingsSection() {
function formatCost(usd: number): string {
function formatTokens(n: number): string {
function truncateModel(model: string, max = 32): string {
import type {
import {
import { Bot, Clock, Cpu, Gauge, Key, Server, Settings2, ShieldAlert } from 'lucide-react';
} from '../lib/api';
} from '@simple-agent-manager/shared';
$ comm -13 removed.txt added.txt     # added, not in removed
(one blank line)
export function AiUsageSection() {
export function BudgetSettingsSection() {
export function formatCost(usd: number): string {
export function formatTokens(n: number): string {
export function truncateModel(model: string, max = 32): string {
import type { ComputeUsageResponse, UserQuotaStatusResponse } from '@simple-agent-manager/shared';
import type { UserAiBudgetResponse } from '@simple-agent-manager/shared';
import type { UserAiUsageResponse } from '@simple-agent-manager/shared';
import { AiUsageSection } from '../components/ai-usage/AiUsageSection';
import { Body, Card, CardTitle, SectionHeading, Spinner } from '@simple-agent-manager/ui';
import { Body, Card, CardTitle, SectionHeading, Spinner } from '@simple-agent-manager/ui';
import { Bot } from 'lucide-react';
import { BudgetSettingsSection } from '../components/ai-usage/AiBudgetSettingsSection';
import { Clock, Cpu, Gauge, Key, Server } from 'lucide-react';
import { Settings2, ShieldAlert } from 'lucide-react';
import { fetchComputeUsage, fetchUserQuotaStatus } from '../lib/api';
import { fetchUserAiBudget, updateUserAiBudget } from '../../lib/api';
import { fetchUserAiUsage } from '../../lib/api';
import { formatCost, formatTokens } from './format';
import { formatCost, formatTokens, truncateModel } from './format';
import { useCallback, useEffect, useState } from 'react';
import { useCallback, useEffect, useState } from 'react';

Every remaining difference is one of these:

  • an import line
  • one blank separator after a new file's import block
  • a declaration line that is identical except for the export prefix (five removed lines are matched by five export … added lines)

The (one blank line) above is literally an empty line in comm's output.

3. Existing tests pass unchanged

Test edits: none. No test file is in the diff (git diff --stat origin/main...HEAD lists the four source files and the task file only).

  • apps/web vitest, full suite: JSON reporter success: true, 409 files, 5,228 tests, 5,228 passed, 0 failed, 0 skipped.
  • pnpm check:fast: exit 0, 22/22 turbo tasks (format ratchet, ESLint incl. SAM boundary rules, type-boundary ratchet).
  • apps/web tsc --noEmit (app and service worker): exit 0.
  • vite build: success.
  • Existing Playwright audits for this page (compute-usage-audit.spec.ts, ai-usage-audit.spec.ts, 375x667 + 1280x800): 76 passed and 16 failed on the branch; 76 passed and 16 failed on a clean origin/main worktree. The two failure lists are identical (diff of the sorted test IDs is empty).
    • compute-usage-audit.spec.ts passes in full on both.
    • All 16 failures are in ai-usage-audit.spec.ts. It waits for text=LLM Usage without mocking the settings shell, which is the stale spec already recorded in tasks/backlog/2026-07-17-stale-playwright-audit-specs.md (16 rows). They are pre-existing and unchanged.

Validation

  • pnpm lint (via pnpm check:fast, exit 0)
  • pnpm typecheck (apps/web, exit 0; check:fast type-boundary ratchet)
  • pnpm test (apps/web vitest 5,228/5,228; no test changes)
  • Additional validation: vite build. quality:file-sizes: every touched file is under 500 lines. The proof scripts and the visual comparison are described above and below.
  • N/A: no sweep, cron or alarm candidate selection changed

Staging Verification (REQUIRED for all code changes — merge-blocking)

  • Staging deployment green: Deploy Staging 43666884157 succeeded, including smoke tests (02:37Z), on head d109a0c6d76cdb483ab98c134a5f9a9889f38f91. app.sammy.party now serves the route chunk SettingsComputeUsage-DjjqITUD.js (the baseline was SettingsComputeUsage-BV3B0lJ7.js), so the new code is the code tested.
  • Live app verified via Playwright: signed in to app.sammy.party as the staging smoke-test user at 1280x800 and 375x667, with one session reused for both captures.
  • Existing workflows confirmed working: Settings shell, sidebar and navigation render. All /api/usage* calls returned 200, with 0 console errors and 0 page errors.
  • New feature/fix verified on staging: the whole moved surface, details below.
  • Infrastructure verification completed: N/A: no infra changes.
  • Mobile and desktop verification notes added for UI changes (below)

Staging Verification Evidence

Window. Staging was claimed on feature.pr-shepherd-deps-20261111 (TAKEN seq195 at 02:15Z) under the root shepherd's handoff, after the P1 owner released it at 02:05Z. FREE was published at 02:41Z (seq196). Nothing was created or changed: no VM, no fixture, no settings and no budget change.

Method: before vs after on real staging data. A Playwright script captured /settings/usage once on the deploy that was live before this branch, and once after this branch's deploy. Each capture:

  1. loaded the page and took viewport and full-content screenshots;
  2. clicked 7 Days, then This Month (waiting for each response);
  3. opened Configure, checked the four inputs, then clicked Cancel (no save);
  4. recorded the page text, console and page errors, failed requests, the /api/usage* requests, and the five /api/usage* JSON responses.

Results:

Check Before (chunk BV3B0lJ7) After (chunk DjjqITUD)
LLM Usage, Budget Controls and Compute Usage sections render yes, both viewports yes, both viewports
/api/usage/ai?period=current-month, ?period=7d, /ai/budget, /quota, /compute 200 200, byte-identical JSON to before
Request sequence compute, quota, ai(month), ai/budget, ai(7d), ai(month) same
Console errors / page errors 0 / 0 0 / 0
Horizontal overflow none none
Page-load screenshot, 375 (viewport and full) byte-identical to before
Page-load screenshot, 1280 (viewport and full) differs only in one 13x10 CSS-px area at x 170-182, y 562-571: the sidebar's "Recent projects" relative time (31m before, 18m after). The usage content is pixel-identical
Page text after the period switch back to This Month identical to before

Caveats:

  • Mobile baseline caught the 7-day numbers. The first (before) capture did not wait for the This-Month response. The 375 baseline therefore recorded the in-flight 7-day numbers: the pre-existing stale-while-refetch behaviour noted in the review. The after capture waited, and its 375 text is identical to the 1280 baseline text.
  • Telemetry beacon. The only failed request on both sides is the telemetry beacon POST /api/t (ERR_ABORTED when the page closes).

Screenshots after the deploy (real staging data):

Sign-in note. The stored SAM_PLAYWRIGHT_PRIMARY_USER token returned 401 from https://api.sammy.party/api/auth/token-login twice (02:16Z). I did not retry. I used the documented workload-identity sign-in instead (/api/auth/workload-identity-login, 200). Afterwards I signed out (the session then read null) and deleted the local session files. This is reported on the coordination channel.

UI Compliance Checklist (Required for UI changes)

  • Mobile-first layout verified (no change: pixel-identical to main at 375 and 1280)
  • Accessibility checks completed (no change: same DOM, ARIA and roles, byte-identical JSX)
  • Shared UI components used or exception documented (unchanged @simple-agent-manager/ui usage)
  • Playwright visual audit run locally. Mock data covered normal, long text, special characters, many items, empty, error, BYOC, exceeded budget and quota, and the edit form, at 375x667 and 1280x800. assertNoOverflow (including the clipped-overflow walk) passed in every scenario.
  • Desktop and mobile screenshots posted (linked below)
  • Agent and ui-ux-specialist reviewed the screenshots: no visual issues introduced

UI Screenshot Evidence

All screenshots were taken with Playwright: a main-vs-branch comparison, not only an audit. The full method and results are in the screenshot comment: #2746 (comment)

  • Builds: vite build of a clean origin/main worktree (4bdaaf61f) and of this branch, each served by vite preview.
  • Spec: .tmp/l4/compare.spec.ts (scratch) ran the same API mocks and a fixed clock (page.clock.setFixedTime) against both builds at 375x667 and 1280x800. Per scenario it took a viewport and a full-content shot, logged every /api/usage* request with method and body, and logged console errors.
  • Results:
    • 10 of 10 tests passed on each build.
    • All 28 PNGs are byte-identical between main and the branch: cmp reported 28 same and 0 different. The ui-ux-specialist re-checked this with its own cmp.
    • The API request sequence is identical in all 10 scenarios. The order is GET /api/usage/compute, /quota, /ai?period=current-month, /ai/budget. After the period click there is GET /api/usage/ai?period=7d. After Save there is PUT /api/usage/ai/budget with an identical JSON body, then a budget refetch.
    • Console errors match on both sides: the expected 500 in the two error scenarios, and the mock harness's notifications/ws handshake noise (no WebSocket mock). The only differences are the port in that message and its retry count.
    • Full-page shots differ between every pair of scenarios, so each scenario captured different content (rule 62).

Surface: Settings > Usage, normal data

Surface: Settings > Usage, stress data

Surface: Settings > Usage, empty state

Surface: Settings > Usage, error and BYOC

Surface: Settings > Usage, period switch and budget edit form

End-to-End Verification (Required for multi-component changes)

  • Data flow traced. /settings/usage → App.tsx lazyNamed(import('./pages/SettingsComputeUsage')) → SettingsComputeUsage, which calls fetchComputeUsage + fetchUserQuotaStatus and renders <AiUsageSection /> (fetchUserAiUsage(period)) and <BudgetSettingsSection /> (fetchUserAiBudget, updateUserAiBudget). This is unchanged from main; only the file boundaries moved. Verified by the identical request logs above and on staging.

Data Flow Trace

See above.

Untested Gaps

  • The built route chunk changed by 4 bytes, 19,414 → 19,418 B. The modules are still bundled into the same lazy SettingsComputeUsage chunk. The behaviour is identical, as the comparison above shows.

Post-Mortem (Required for bug fix PRs)

N/A: not a bug fix.

What broke

N/A

Root cause

N/A

Class of bug

N/A

Why it wasn't caught

N/A

Process fix included in this PR

N/A

Post-mortem file

N/A

Specialist Review Evidence (Required for agent-authored PRs)

  • All local reviewers completed and findings addressed before merge
  • If any reviewer did NOT complete: needs-human-review label added and merge deferred to human: N/A, every reviewer completed.
Reviewer Status Outcome
ui-ux-specialist PASS No user-visible difference. It reran verify.cjs and judged the classifier unable to hide a body change, ran its own cmp (28/28 PNGs identical), and opened 7 screenshots from both builds. Hook order, component identity, the lazy route chunk and other consumers are all unchanged. It found no CRITICAL, HIGH or MEDIUM issues introduced. Pre-existing issues on main, out of scope for a pure move: AiUsageSection hides loaded data while a period refetch runs (data && !loading, rule 48), and both sections use hand-rolled fetch hooks. Both are covered by the existing TanStack migration task 01M0E14DMF42M4RGYEE3RXMA03.
task-completion-validator PASS Every checklist item is in the diff. It diffed main against the new files by hand and reran the proof; nothing from branch commits eba74739a/55f8be286 leaked in. It derived the same "Left for a later slice" list, and confirmed no test changes, all files under 500 lines and that consumers resolve. Two LOW notes were addressed in the task file and here: the checklist now records the evidence and the CodeRabbit / do-not-merge steps, and the WebSocket log noise is explained above.

CodeRabbit Review Evidence (Required for agent-authored PRs)

  • CodeRabbit requested after local review, staging if applicable, and CI gates passed
  • Waited about 15 minutes
  • Either CodeRabbit reviewed and no CodeRabbit feedback is unresolved, or it did not review and the observed outcome is recorded below

CodeRabbit Notes

Outcome: no CodeRabbit review; not re-triggered (rule 25).

  • Request: made at 2026-11-15 02:42:17Z through the trusted label path (coderabbit-review). The coderabbit-bot-review.yml run 43669016604 succeeded.
  • Reply: at 02:42:30Z CodeRabbit answered "Action not completed: Review rate limited". It had already posted "Review limit reached" when the draft opened at 01:14:23Z.
  • Wait: no review had arrived by 02:58Z.
  • Timing: CI was fully green on the code-bearing head d109a0c6d when CodeRabbit was requested. The one later commit only touches the task file.

Exceptions (If any)

Agent Preflight (Required)

  • Preflight completed before code changes

Classification

  • external-api-change
  • cross-component-change
  • business-logic-change
  • public-surface-change
  • docs-sync-change
  • security-sensitive-change
  • ui-change
  • infra-change

External References

N/A: no external API or library behaviour is involved. Moving module-level React components and pure functions into ES modules, imported by name, does not change rendering, hook order or component identity.

Codebase Impact Analysis

Touched: apps/web/src/pages/SettingsComputeUsage.tsx, plus the new apps/web/src/components/ai-usage/{format.ts,AiUsageSection.tsx,AiBudgetSettingsSection.tsx} and the task file. The consumers are apps/web/src/App.tsx (lazy route) and apps/web/tests/playwright/fixtures/native-hardware-harness.tsx; neither changed. Same-named formatters elsewhere (AdminCosts, AdminAIProxy, WorkspaceSidebar, AIUsageChart) are independent local copies and are untouched. Overlap check, 2026-11-15 ~01:00Z: no open PR and no active task touches SettingsComputeUsage or components/ai-usage.

Documentation & Specs

N/A: no docs, rules or specs describe this page's internal file layout (I searched apps/www/src/content/docs, .claude/rules, apps/web/.claude, AGENTS.md and CLAUDE.md). Backlog task files cite old line numbers in SettingsComputeUsage.tsx. They are historical notes, left as is.

Constitution & Risk Check

  • Principle X (simplicity): a pure move into the integration branch's existing layout, with no new abstraction.
  • Principle XI: no values added or changed.
  • Risk: the Settings > Usage page. It is mitigated by the AST and multiset proofs, an unchanged test suite with zero test edits, a pixel-identical main-vs-branch comparison, and a live staging check.

Head: 572f6fd03108d6d6f03e23ae7b1abbfc365d59fb. Staging ran on d109a0c6d76cdb483ab98c134a5f9a9889f38f91; the only commit after it touches the task file (git diff --stat d109a0c6d 572f6fd03 lists only tasks/active/2026-11-15-l4-web-settings-usage-split.md).

🤖 Generated with Claude Code

raphaeltm and others added 2 commits November 15, 2026 00:59
…4, pure move)

Rule 18: the page was 776 lines. AiUsageSection (with AI_PERIODS), BudgetSettingsSection
(with BudgetBar) and the cost/token/model formatters move verbatim from main into
apps/web/src/components/ai-usage/. Only import lines and five `export` keywords differ.
No behaviour change; the integration branch's monthly-cap-unavailable behaviour and its
component rename are left for a later slice.

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

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d60c28e and 572f6fd.

Files selected for processing: 5

  • apps/web/src/components/ai-usage/AiBudgetSettingsSection.tsx
  • apps/web/src/components/ai-usage/AiUsageSection.tsx
  • apps/web/src/components/ai-usage/format.ts
  • apps/web/src/pages/SettingsComputeUsage.tsx
  • tasks/active/2026-11-15-l4-web-settings-usage-split.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@simple-agent-manager

Copy link
Copy Markdown
Contributor Author

Playwright screenshots: Settings > Usage, main build vs this branch's build. The images are in the SAM project library under /pr-screenshots/l4-settings-usage-split/.

Method: vite build of a clean origin/main worktree (4bdaaf61f) and of this branch, each served by vite preview. The same Playwright spec then ran against both with identical API mocks and a fixed clock (page.clock.setFixedTime), at iPhone SE 375x667 and desktop 1280x800.

Results:

  • 10/10 tests passed on each build.
  • All 28 PNGs are byte-identical between main and the branch (cmp: 28 same, 0 different).
  • The /api/usage* request sequence (method, path, query, PUT body) is identical in every scenario.
  • assertNoOverflow passed in every scenario. It is apps/web/tests/playwright/audit-helpers.ts and includes the clipped-overflow walk.

The links below are the branch's full-content shots; main's are byte-identical.

Scenario Desktop 1280x800 Mobile 375x667
Normal: 4 models with cached and error counts, 10-day trend, custom budget with a $50 cap, quota at 60%, 3 nodes normal-desktop normal-mobile
Stress: a 243-char model name, 30 <script>/CJK/emoji model names, a 30-day trend, budget and quota exceeded, 30 nodes (one with a 204-char name) stress-desktop stress-mobile
Empty: no LLM usage, platform-default budget, unlimited quota, no nodes empty-desktop empty-mobile
Error: /api/usage/ai 500, BYOC quota, $0.01 cap errors-desktop errors-mobile
Interaction: "7 Days" clicked, then Configure, with an edited daily input limit (Save was then asserted) edit-desktop edit-mobile

Quality review: I reviewed every linked image, and the ui-ux-specialist independently reviewed seven shots from both builds. Long and special-character names truncate inside their cards, and HTML renders as text. The exceeded alerts, error card, empty states and edit form render correctly. There is no horizontal overflow or clipping. No visual issues found, and nothing differs from main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simple-agent-manager
simple-agent-manager Bot marked this pull request as ready for review November 15, 2026 02:42
@simple-agent-manager simple-agent-manager Bot added the coderabbit-review Trigger CodeRabbit review for opt-in PRs label Nov 15, 2026
@raphaeltm

Copy link
Copy Markdown
Owner

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud

Copy link
Copy Markdown

@simple-agent-manager
simple-agent-manager Bot merged commit fd0be69 into main Nov 15, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit-review Trigger CodeRabbit review for opt-in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant