> **Historical record.** This page describes the product as it was when it was written, under an earlier name, and is not kept up to date. For the current system (Astra) read [DESIGN_SYSTEM.md](DESIGN_SYSTEM.md) for the UI, and [ARCHITECTURE.md](ARCHITECTURE.md), [DEPLOYMENT.md](DEPLOYMENT.md), [RUNBOOK.md](RUNBOOK.md), [REMOTE_RUNNER.md](REMOTE_RUNNER.md) and [SECURITY.md](SECURITY.md). # Frontend audit (Patchwise web app) Branch `frontend-polish`, base commit `84145a2`. Step 1 of the frontend-polish plan: findings only, no code changed. This is what Steps 2 to 5 (tokens, components, page rebuilds, quality gates) will fix. **Method** - **Screenshots.** Playwright took full-page screenshots of 28 screens at 375, 768, 1280 and 1920 px, in light and dark, against the production build (`npm run build`) served by the FastAPI backend with a fresh admin and one stub P2P run. That is 224 screenshots. Reduced motion was on so the images are stable. - **Accessibility.** axe-core 4.11 ran on every screen at 375 and 1280 px in both schemes (112 scans). It was injected from a scratch install, not added to the repo. The raw results are in [frontend-audit/axe-results.json](frontend-audit/axe-results.json). - **Code metrics.** Counts were taken with grep over `web/src` (7 CSS files with 2,088 lines in total, and all TSX files). - **Screenshots in the repo.** 20 representative screenshots are committed in [frontend-audit/](frontend-audit/). The full set of 224 is outside the repo (30 MB) and can be regenerated with the same throwaway spec. - **What was checked by eye.** I looked at about 20 of the 224 screenshots. Every screen got the automated checks (axe, horizontal overflow, console errors), but not every screen was inspected visually. Step 4 re-screenshots each page as it is rebuilt. Severity: **P0** broken or blocks a task · **P1** clearly wrong, visible to every user · **P2** inconsistency or polish. --- ## 1. Top 10 (fix first) | # | Sev | Finding | Where | Evidence | |---|---|---|---|---| | 1 | P0 | On phones the page header overlaps itself. On Home, the environment and patch selects sit on top of the "Patch readiness" title, and "New test run" is pushed off screen. On Test runs, Export CSV, Scheduled runs and "+ New" cover the title, and the subtitle wraps one word per line. Nothing scrolls sideways, so the clipped controls cannot be reached. | `PageHeader` / `.trio-head` actions in `ReadinessPage.tsx`, `RunsPage.tsx` | [home 375](frontend-audit/home__375_light.png), [runs 375](frontend-audit/runs__375_light.png) | | 2 | P0 | The Ask panel stays open after you leave `/assistant`. Below 1024 px it is a full-screen drawer, so on a phone every later page shows only the chat. In the sidebar, "Ask" stays highlighted together with the current page. | App shell, Ask dock state in `components/shell/prefs.tsx` and `AppSidebar.tsx` | [audit 375](frontend-audit/audit__375_light.png), [users 768](frontend-audit/admin_users__768_light.png), [404 1280](frontend-audit/no-such-page__1280_light.png) | | 3 | P1 | The run header on phones loses its first line ("ocal mock pod · started…"). The back link turns into an odd icon. The primary button is clipped ("Approve all 79 and start test"). | `RunWorkspace.tsx` top bar, `RunGuide.tsx` | [run 375 dark](frontend-audit/run__375_dark.png) | | 4 | P1 | At 1280 px the run page has three columns (sidebar, guide, 450 px side panel). The title truncates to "Proc…" / "Local mc", and the tab strip scrolls with its first tab cut ("ios • your review"). | `RunWorkspace.tsx`, `SidePanel` | [run 1280](frontend-audit/run__1280_light.png), [report tab](frontend-audit/run_report__1280_light.png) | | 5 | P1 | Colour contrast fails on 22 of 24 signed-in screens (125 elements). The main offenders are the amber practice-environment badge (`.fpt-envbadge`, `.fpt-env-long`), Mantine `c="dimmed"` / `size="xs"` text, light-variant button labels, `.trio-chip`, empty-state copy and the orange "Awaiting approval" status. | `styles.css`, `apple.css`, Mantine `dimmed` | axe `color-contrast` | | 6 | P1 | Run tabs use invalid ARIA (`aria-controls` points to panels that aren't rendered; critical, 16 pages). Tab lists and cards declare roles without the required children (critical, 24 pages). | `RunWorkspace.tsx` tabs, `.trio-group`, `.fpt-card` | axe `aria-valid-attr-value`, `aria-required-children` | | 7 | P1 | Pagination buttons have no accessible name (critical). | Mantine `Pagination` in `LibraryPages.tsx` (Scenarios), `AdminPages.tsx` (Audit) | axe `button-name` | | 8 | P1 | Two systems style the same things. There are two type and token stacks (`--fpt-*` with 729 uses and the Apple tokens `--label`, `--r-*`, `--pill-*`), two icon sets (Tabler in 32 files, lucide in 5), and two component libraries (Mantine and beUI/Tailwind). | all CSS, `theme.ts`, `beui.css` | section 2 | | 9 | P1 | Settings at 1280 with the Ask panel open: the content column is about 300 px wide. Cards stack with a large empty gap, and a card is cut off at the right edge. | `SettingsPage.tsx` grid | [admin 1280](frontend-audit/admin__1280_light.png) | | 10 | P2 | Scenario filters "Process step" and "Priority" show empty selects with no placeholder. | `LibraryPages.tsx` | [scenarios 1920](frontend-audit/scenarios__1920_light.png) | --- ## 2. Typography **Font family.** One family (Inter Variable via `@fontsource-variable/inter`) with a monospace stack. It is reached through four different variables (`--font`, `--fpt-font`, `--fpt-font-display`, `--mono`/`--fpt-mono`) and set again in `theme.ts`. **P2:** keep one family token and one mono token. **Font sizes in CSS.** There are 16 distinct px values and no scale. | Size | Uses | Size | Uses | |---|---|---|---| | 13px | 34 | 14.5px | 4 | | 12px | 19 | 10.5px | | | 13.5px | 16 | 16, 17, 18, 20px | few | | 12.5px | 13 | 28, 30, 34px | few | | 11.5px | 13 | | | | 15px | 10 | | | | 14px | 10 | | | - **P1:** Half-pixel sizes (11.5, 12.5, 13.5, 14.5, 10.5) are the bulk of the body copy. - **P1:** Body text is 13 to 13.5 px almost everywhere, below a comfortable 14 to 15 px reading size. **Font sizes in TSX.** Three more sources: - Mantine `fz="xs"` / `size="xs"` / `size="sm"`. - Inline `style={{ fontSize }}`. - Tailwind arbitrary values on the account pages: `text-[13px]`, `[15px]`, `[16px]`, `[17px]`, `[28px]`, `[52px]` (`AuthShell.tsx`). The sign-in pages and the app therefore use different size ladders. Page titles look similar (about 28 px) but come from different code. **Weights.** CSS uses 400 (10), 500 (22), **550 (20)**, 600 (98), **650 (12)** and 700 (4); TSX adds `fw={600}` ×85. The 550 and 650 weights only work with the variable font. **P2:** keep three weights (400 / 500 / 600) and one display weight. **Line height.** It is set as px values tied to one font size: 16px (16), 18px (14), 20px (7), 22px, 19px, 14px, 17px, 21px, 26px, 34px, 36px, 40px. There are also a few unitless values (1.25, 1.5) and var. **P2:** pixel line heights break when the font size changes. Use unitless ratios per text style. **Letter spacing.** There are 13 distinct values from −0.03em to +0.04em (−0.014, −0.006, −0.024, −0.016, −0.012, −0.008, −0.004…), plus Tailwind `tracking-tight` and `tracking-[-0.035em]`. **P2:** fold into 3 values (display, title, body = 0). **Headings.** axe `heading-order` fails on Run, Test environments, Scripts, Learner and Users (an h3 or h5 directly after h1). The four run sub-tabs (`/runs/:id/scenarios|failures|report|workflow`) have **no h1** (`page-has-heading-one`). **P1** for screen-reader navigation. --- ## 3. Components, spacing, radius, shadows, colour **Control sizes.** - Mantine sizes are used inconsistently: Button `xs` ×38, `md` ×5, `sm` ×1; TextInput `xs` ×7; Select `xs` ×3; Textarea `xs` ×2; Badge `xs` ×5, `lg` ×1; ActionIcon `sm` ×1. - Heights hard-coded in CSS: 32px (16), 40px (15), 36px (11), 34px (10), 28px (10), plus 22px and 20px. There is no height scale, so a "default" button can be 28, 32, 34, 36 or 40 px depending on the page. - The account pages use 48 px controls (`h-12`); Account → Change password uses Mantine's 36 px. Both are forms. - **P1:** set 3 control heights (32 / 40 / 48) and one default per context. **Hand-styled buttons.** Raw `