Skip to content

Commit 37b7947

Browse files
Shawclaude
andcommitted
feat(cloud-frontend): visual review harness + dashboard redesign + palette purge
Loop 1+2 of the cloud-frontend UI review grind. Adds the manual-review protocol that any UI-touching agent must follow, extends the audit spec to 53 routes × 2 viewports with rest+hover screenshots and palette violation detection, redesigns the dashboard home, and removes blue from the entire user-facing surface. Harness + protocol - packages/cloud-frontend/AGENTS.md — manual visual review protocol (run command, output layout, per-page review markdown rules, 5-loop discipline, checklist template). - packages/cloud-frontend/tests/e2e/aesthetic-audit.spec.ts — expanded from ~30 to 53 routes (every path in src/App.tsx incl. parameterized routes via e2e-fixture id); captures <slug>--hover.png after hovering the first primary button; detects orange<->black hover transitions, neutral->orange hover destinations, and any blue color; auto-stubs manual-review/<slug>.md for every route; H1/H2/H3 fixes (anon-mode for public routes, mocked API endpoints for auth routes, networkidle wait so loading skeletons don't get captured). - packages/cloud-frontend/package.json — audit:cloud script. - CLAUDE.md — points at the new protocol. - packages/cloud-frontend/aesthetic-audit-output/LOOP_1_TRIAGE.md — loop-1 baseline findings. E2E expansion - tests/e2e/_helpers/siwe-session.ts — reusable loginWithInjectedEthereum helper extracted from siwe-flow.spec.ts. - tests/e2e/blue-banned.spec.ts — source-grep + runtime HSL-bucket enforcement of the no-blue rule across 8 key pages. - tests/e2e/focus-rings.spec.ts — tabs through each page asserting visible focus outline/box-shadow/border. - docs/E2E_COVERAGE_GAPS.md — per-page enumeration of untested interactive surfaces with concrete test recipes. Dashboard redesign - src/dashboard/Page.tsx — new IA: greeting, credit balance + top-up CTA, 4-up stat row (agents/containers/apps/keys), agents grid, secondary cards (earnings/affiliates/docs), deep-link pills. Reuses existing hooks; no new endpoints; replaces DashboardActionCards (which mixed blue + orange->black hover). - docs/DASHBOARD_REDESIGN.md — design rationale. Color/hover system - docs/HOVER_SYSTEM.md — palette rules (orange-rest hovers orange-darker; neutral-rest hovers neutral; blue banned). - 70 blue Tailwind classes removed across 35 source files. - packages/ui/src/styles/theme.css — --brand-blue remapped to neutral; --status-success → green; --status-info → neutral. - packages/ui/src/cloud-ui/components/connection-card.tsx — tone="blue" callout remapped to neutral. - docs/BLUE_FOLLOWUP.md — documents remaining blue in @elizaos/ui cloud-ui components (out of this session's scope). Loops 3-5 (visual layout polish, a11y, mobile, designer-eye sign-off) require running `bun run --cwd packages/cloud-frontend audit:cloud` and filling in each manual-review/<slug>.md verdict — that's the iterative loop the new infrastructure enables. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bd9bc35 commit 37b7947

48 files changed

Lines changed: 1991 additions & 179 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/cloud-frontend/AGENTS.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Cloud Frontend — Manual Visual Review Protocol
2+
3+
Any coding agent that touches UI in `packages/cloud-frontend/` MUST follow this
4+
protocol before declaring work complete. The protocol exists because automated
5+
e2e specs catch only what they assert — hover-state regressions, palette drift,
6+
broken empty states, and mobile layout breaks slip through. A visual audit +
7+
human-style page-by-page review is the only reliable gate.
8+
9+
## Run the audit
10+
11+
```bash
12+
bun run --cwd packages/cloud-frontend audit:cloud
13+
```
14+
15+
This runs `tests/e2e/aesthetic-audit.spec.ts` headless against the local
16+
preview server and opens `aesthetic-audit-output/contact-sheet.html` in your
17+
default browser when finished.
18+
19+
The audit walks every route in `src/App.tsx` (public + dashboard, including
20+
parameterized routes hit with an invalid `e2e-fixture` id so the empty/error
21+
state is captured) at desktop (1440x900) and mobile (390x844) viewports.
22+
23+
## Where outputs land
24+
25+
```
26+
packages/cloud-frontend/aesthetic-audit-output/
27+
desktop/<slug>.png full-page screenshot at rest
28+
desktop/<slug>--hover.png full-page screenshot with first primary button hovered
29+
mobile/<slug>.png
30+
mobile/<slug>--hover.png
31+
manual-review/<slug>.md human-authored review notes (REQUIRED for every route)
32+
contact-sheet.html grid view of every screenshot + flagged issues
33+
report.json machine-readable per-page audit data
34+
```
35+
36+
Stub `manual-review/<slug>.md` files are auto-generated for every route the
37+
first time the audit runs. Existing files are never overwritten — the human
38+
notes are the source of truth.
39+
40+
## The manual review loop
41+
42+
For every UI change, run this loop until verdict is `good` for every page you
43+
touched (and every page your change can reach transitively — global header,
44+
footer, layout, theme, button primitives, etc.):
45+
46+
1. Run `bun run --cwd packages/cloud-frontend audit:cloud`.
47+
2. Open `aesthetic-audit-output/contact-sheet.html`. Walk every page that
48+
could be affected.
49+
3. For each affected page, open `manual-review/<slug>.md` and fill in:
50+
- **Visual issues** — anything that looks wrong, broken, or off-brand.
51+
- **Color / hover violations** — quote the element + rest/hover colors.
52+
Project rules: brand orange (#ff8a00-ish) is accent only, never a hover
53+
destination from neutral; orange<->black hover transitions are banned;
54+
blue is banned from the palette entirely.
55+
- **Layout breaks** — viewport + element.
56+
- **Interaction targets to add to e2e** — buttons/links that should have
57+
automated coverage.
58+
- **Verdict**`good`, `needs-work`, or `broken`.
59+
4. Fix the issues.
60+
5. Commit screenshots + manual-review markdown + code fixes together (one
61+
commit per loop iteration is fine).
62+
6. Re-run the audit and repeat. Allow up to 5 loops per page. If a page is
63+
still not `good` after 5 loops, escalate — do not declare done.
64+
65+
## Rules
66+
67+
- **Every page must have a screenshot AND a `manual-review/<slug>.md`** with
68+
a verdict checked into the repo. A page with no review markdown is a page
69+
that was never reviewed.
70+
- **Do not mark a UI task complete with any page at verdict `needs-work` or
71+
`broken`.** Either fix it or document why it is acceptable in the markdown.
72+
- **Never overwrite an existing `manual-review/<slug>.md`** — the human notes
73+
are load-bearing. The audit only writes stubs for new routes.
74+
- **The contact sheet is not the review.** It is the index. The review lives
75+
in the per-page markdown.
76+
77+
## Checklist template (mirrored in every stub)
78+
79+
- [ ] Header / nav present and aligned
80+
- [ ] Logo size + nav padding match other pages
81+
- [ ] No blue colors anywhere (banned)
82+
- [ ] Hover states do not transition orange<->black on the same element
83+
- [ ] Focus ring visible on every interactive element (tab through)
84+
- [ ] Empty state renders cleanly
85+
- [ ] Loading state renders cleanly (no layout jump)
86+
- [ ] Mobile layout: no horizontal scroll, tap targets >= 44px
87+
- [ ] Text contrast meets WCAG AA
88+
- [ ] Border radius is 3px (xs) or pill — no other values
89+
- [ ] No console errors at rest
90+
- [ ] No 5xx network requests
91+
92+
## What the spec auto-flags
93+
94+
You don't need to eyeball these — the spec already detects them and lists
95+
them on each contact-sheet card and in `report.json`:
96+
97+
- console errors and `pageerror` events
98+
- non-401/403/404 failed network responses
99+
- border-radius values outside {0, 3px, pill}
100+
- palette violations: orange<->black hover transitions, neutral->orange
101+
hover destinations, any blue color on buttons (rest, hover, or focus ring)
102+
103+
Your job in the manual review is to catch what the spec can't: spacing,
104+
typography rhythm, contrast, empty/loading state quality, mobile breaks,
105+
keyboard navigation, and overall brand fit.
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Loop 1 — baseline triage of existing screenshots
2+
3+
Generated 2026-05-21 from `aesthetic-audit-output/desktop/*.png` (last run
4+
before wave-1 changes). Per-page reviews will land under
5+
`manual-review/<slug>.md` once that directory exists; this file is the
6+
roll-up so loop 2 can act on it.
7+
8+
## Cross-cutting harness bugs (block accurate evaluation)
9+
10+
These must be fixed in `tests/e2e/aesthetic-audit.spec.ts` BEFORE
11+
remaining loops produce trustworthy artifacts. Loop-2 prereqs.
12+
13+
### H1. `landing.png` captures the dashboard, not `/`
14+
The harness runs with `VITE_PLAYWRIGHT_TEST_AUTH=true` which keeps the
15+
mock session active. When visiting `/`, the app redirects authed users
16+
to `/dashboard`. Result: `landing.png` shows the dashboard (Instances
17+
empty state with "No agents yet"), not the marketing landing page.
18+
19+
**Fix:** Split the audit into two passes — a public pass (no test-auth
20+
cookie cleared) and an authed pass. Routes listed `auth: false` should
21+
run with the session cleared via `await context.clearCookies()` and a
22+
fresh storageState.
23+
24+
### H2. `dashboard-api-keys.png`, `dashboard-containers.png` render "Something went wrong / Unauthorized"
25+
Test-auth mode passes the UI gate (JWT decoded), but the API treats the
26+
mock token as unauthorized for these endpoints. Result: the
27+
audit captures the error boundary, not the page content.
28+
29+
**Fix:** Either (a) extend the test-auth backend stub to honour these
30+
endpoints, or (b) intercept API calls inside the audit spec with
31+
`page.route(...)` to return canned fixtures per route. Option (b) is
32+
strictly local and won't require backend changes.
33+
34+
### H3. `dashboard-billing.png`, `dashboard-settings.png` captured during loading skeleton
35+
Empty header (no "Billing" / "Settings" title), four placeholder
36+
rectangles, no real content. The audit fires the screenshot before
37+
content settles.
38+
39+
**Fix:** Add per-route "ready" waits. Easiest: wait for a
40+
`[data-testid="<slug>-ready"]` element on each page; add the testid in
41+
source where the page mounts its real content. Backup: wait until
42+
`networkidle` AND no `[aria-busy="true"]` element in the main region.
43+
44+
### H4. No hover-state screenshots yet
45+
Subagent A is adding `<slug>--hover.png` for the primary button — once
46+
that lands, re-run.
47+
48+
### H5. No mobile screenshots reviewed yet
49+
The mobile screenshots are in `aesthetic-audit-output/mobile/` but
50+
haven't been triaged. Loop-4 task.
51+
52+
---
53+
54+
## Page-level findings (desktop only — first pass)
55+
56+
### `/` (landing) → SEE H1 — currently shows dashboard, not landing
57+
Cannot evaluate until H1 fixed.
58+
59+
### `/login` (`login.png`)
60+
- Looks tight visually. Logo + cloud bg.
61+
- Email field → "Passkey" / "Magic Link" / "Ethereum" / "Solana" buttons.
62+
- ✅ no blue. ✅ orange CTA `Passkey` with neutral siblings.
63+
- **UX**: "Developer Dashboard" button top-right is confusing on a sign-in screen — what does it mean before login? Consider removing or renaming.
64+
- **Test gap**: error case when wallet user rejects sig (see `docs/E2E_COVERAGE_GAPS.md`).
65+
66+
### `/bsc` (`bsc.png`)
67+
- Marketing-style purchase card. Looks clean.
68+
- Cloud bg + white card. Mobile not yet checked.
69+
- ✅ no obvious blue/orange-black hover. Confirm hover state once `--hover` shots exist.
70+
71+
### `/dashboard` (`dashboard-home.png`) — REDESIGN IN PROGRESS (subagent C)
72+
- **VIOLATION**: "API Access" card is solid **blue** (`bg-blue-500` family). Banned. Subagent B should catch this.
73+
- Layout dominated by oversized marketing card "Run your Eliza agent on the hosted runtime" + 5 colored tiles. Feels like onboarding, not a dashboard.
74+
- "My Agent (0)" section is mostly empty → "Launch Instance" CTA. Reasonable empty state but the whole page is empty state.
75+
- Header right side: 🇺🇸 EN dropdown, "Invite" button, "LO" avatar. OK.
76+
- Sidebar shows "Dashboard" highlighted with thin orange left bar. Good.
77+
- **Test gap**: every tile's CTA → assert correct route.
78+
79+
### `/dashboard/agents` (`dashboard-agents.png`)
80+
- Title bar shows "Instances" not "Agents" — naming inconsistency between sidebar ("Instances") and the historical route (`/dashboard/agents`).
81+
- Usage & Rates card: RUNNING/IDLE/YOUR COST/REMAINING tiles. Visually OK; colors fine.
82+
- Empty state: centered "No agents yet" + "New Agent" button. Good.
83+
- **VIOLATION CHECK**: "New Agent" button rests white → confirm hover doesn't go to orange or black-from-orange. Captured `--hover.png` needed.
84+
- **Test gap**: click "New Agent" → navigates to creation flow.
85+
86+
### `/dashboard/api-explorer` (`dashboard-api-explorer.png`)
87+
- **VIOLATION**: blue HTTP-method badges (`POST` is solid blue). Subagent B must replace.
88+
- **VIOLATION**: "Auth" tab uses blue accent on selection. Replace with white/black or orange.
89+
- Endpoints list looks good otherwise.
90+
- Search + category chips work visually.
91+
- **Test gap**: each method badge color asserted in `blue-banned.spec.ts`.
92+
93+
### `/dashboard/api-keys` → SEE H2 — error state captured
94+
### `/dashboard/containers` → SEE H2 — error state captured
95+
### `/dashboard/billing` → SEE H3 — skeleton captured
96+
### `/dashboard/settings` → SEE H3 — skeleton captured
97+
98+
---
99+
100+
## Net findings for loop 2
101+
102+
1. **Fix the harness first** (H1–H3). Without that, screenshots for
103+
~half of dashboard routes are meaningless.
104+
2. **Blue eradication is broader than just hover classes** — subagent B
105+
should also catch the dashboard-home "API Access" card and the
106+
API-explorer method/auth badges (these are in component source, not
107+
just Tailwind utility classes).
108+
3. **Sidebar label "Instances" vs route `/dashboard/agents`** — pick
109+
one. The dashboard tile says "My Agent", the sidebar says
110+
"Instances", the page heading says "Instances". Customer mental
111+
model breaks. Decide on the canonical word and rename.
112+
4. **Header `/dashboard` title is just "Dashboard"** — once redesign
113+
lands, give it a clearer title or remove the title bar entirely.
114+
5. **Per-page testids** required for H3 fix — emit
115+
`data-testid="<slug>-ready"` on each dashboard page root once
116+
content loads.
117+
118+
## Loop 2 work derived from this triage
119+
120+
(Tracked in TaskList.)
121+
122+
- Fix H1, H2, H3 in `aesthetic-audit.spec.ts`.
123+
- Add per-page `data-testid` ready markers.
124+
- Add `blue-banned.spec.ts` enforcement.
125+
- Land subagent B's hover/color sweep including the dashboard-home blue card and API-explorer method badges.
126+
- Decide sidebar terminology: Instances vs Agents. Implement once.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Blue followup — `@elizaos/ui` components
2+
3+
The cloud-frontend `src/` tree is now blue-free (verified by grep + the
4+
runtime `tests/e2e/blue-banned.spec.ts` check). Remaining blue lives in
5+
the shared `@elizaos/ui` package's cloud-ui subdir. These components are
6+
consumed by cloud-frontend, so the visual leak is still real — but
7+
fixing them is a sweep through a different package that wasn't in this
8+
session's scope.
9+
10+
## Files still containing blue (as of 2026-05-21)
11+
12+
| File | What's blue | Suggested replacement |
13+
| --- | --- | --- |
14+
| `packages/ui/src/cloud-ui/components/log-viewer.tsx:133,157` | `info` log severity → `text-blue-300 border-l-blue-500` | Neutral: `text-white/70 border-l-white/30` |
15+
| `packages/ui/src/cloud-ui/components/glowing-stars.tsx:160` | `bg-blue-500 shadow-blue-400` decorative | Orange or white; this is a decorative effect, pick from brand palette |
16+
| `packages/ui/src/cloud-ui/components/timeline.tsx:90` | `via-blue-500` gradient stop | `via-orange-500` or remove |
17+
| `packages/ui/src/cloud-ui/components/promote-app-dialog.tsx:236,241,249,263,446` | Selected-state highlight for "social" channel option | Orange-accent: `border-orange-500/50 bg-orange-500/10 text-orange-300` |
18+
19+
Already handled in this session:
20+
21+
- `connection-card.tsx``tone="blue"` callout remapped to neutral
22+
`bg-white/5 border-white/15 text-foreground`. Three settings pages
23+
(`microsoft-connection.tsx`, `telegram-connection.tsx`,
24+
`whatsapp-connection.tsx`) still pass `tone="blue"` but now render
25+
correctly thanks to the source-level remap; the prop name can be
26+
renamed to `"info"` in a future cleanup pass.
27+
28+
## CSS variables
29+
30+
`packages/ui/src/styles/theme.css` has been edited so that
31+
`--brand-blue` (still defined for legacy callers) resolves to a neutral
32+
black/white opacity instead of `#0b35f1`. `--status-success` and
33+
`--status-info` were remapped off blue. The dist file
34+
`packages/ui/dist/styles/theme.css` is stale — running the package's
35+
build (or any consumer rebuild) will refresh it.
36+
37+
## Verification
38+
39+
Run `bun run --cwd packages/cloud-frontend test:e2e -- blue-banned`
40+
after the @elizaos/ui rebuild lands. The source-grep portion already
41+
passes; the runtime check will catch any remaining `var(--brand-blue)`
42+
fallthrough.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Dashboard Index Redesign
2+
3+
`/dashboard` (`src/dashboard/Page.tsx`) is the first authenticated surface a
4+
user sees. The legacy version showed a hero, a 5-card action strip
5+
(`DashboardActionCards`), and a 4-up "My Agents" grid. It mixed marketing
6+
copy, brand-blue chrome, and orange→black hover transitions, and surfaced
7+
no real state about the user's account.
8+
9+
## Audiences (single page, four hats)
10+
11+
1. **App creators** — building monetized apps. Want app health + earnings.
12+
2. **Agent operators** — running Eliza agents. Want container/agent status.
13+
3. **Inference customers** — using the model gateway. Want credit balance + API keys.
14+
4. **Affiliates** — referring users. Want a referral link they can copy.
15+
16+
## Signal > noise: 6 things on first load
17+
18+
1. **Greeting + credit balance** — what's in the wallet right now.
19+
2. **Top-up CTA** — single primary action for inference customers.
20+
3. **Agents snapshot** — count and a "Manage" affordance.
21+
4. **Containers snapshot** — running / total instances.
22+
5. **Apps snapshot** — count of deployed apps and a link to monetization.
23+
6. **API keys + Earnings + Referrals row** — three small, low-priority chips.
24+
25+
Everything deeper (analytics, billing history, security, admin) lives behind
26+
the sidebar; the index does not duplicate it.
27+
28+
## Layout (ASCII)
29+
30+
```
31+
+--------------------------------------------------------------+
32+
| Eyebrow: elizaOS Platform / Eliza Cloud |
33+
| H1: Welcome back, <name> |
34+
| Sub: One-line status (e.g. "<n> agents, $X balance") |
35+
+--------------------------------------------------------------+
36+
37+
+-------------------- Balance (wide) ------+-- Top up (CTA) ---+
38+
| $12.34 | Add credits → |
39+
| Credit balance | |
40+
+------------------------------------------+-------------------+
41+
42+
+-- Agents (2x) ---------+-- Containers ---+-- Apps ----------+
43+
| 3 agents | 2 / 3 running | 1 deployed |
44+
| [Manage] | [Instances] | [Apps] |
45+
+------------------------+-----------------+------------------+
46+
47+
+-------------- Agents Grid (existing AgentsSection) ----------+
48+
+--------------------------------------------------------------+
49+
50+
+-- API keys ---+-- Earnings ---+-- Referrals ---+-- Docs -----+
51+
| 2 keys | View | Copy link | Read |
52+
+---------------+---------------+----------------+-------------+
53+
```
54+
55+
## Card spec
56+
57+
| Card | Hook / source | Empty state | Skeleton | Primary CTA |
58+
| ----------- | ----------------------------------- | --------------------- | ----------------- | ------------------------ |
59+
| Balance | `useCreditsBalance()` | "—" + Add credits | Pulse on number | `/dashboard/billing` |
60+
| Top-up | static | n/a | n/a | `/dashboard/billing` |
61+
| Agents | existing `useDashboardData` | "No agent yet" | Existing skeleton | `/dashboard/my-agents` |
62+
| Containers | `useContainers()` | "0 instances" | Pulse on counts | `/dashboard/containers` |
63+
| Apps | `useApps()` | "No apps yet" | Pulse on counts | `/dashboard/apps` |
64+
| API keys | `useApiKeys()` | "0 keys" | Pulse on number | `/dashboard/api-keys` |
65+
| Earnings | static link | n/a | n/a | `/dashboard/earnings` |
66+
| Referrals | `useDashboardReferralMe()` | "Generate link" | Pulse | copy referral URL |
67+
| Docs | static link | n/a | n/a | `/docs` |
68+
69+
All numeric stats are rendered from authoritative server responses; no
70+
client-side computation beyond formatting (`toFixed`, `length`, simple
71+
counts of an already-fetched array). No fallback `?? 0` math that would
72+
hide a broken pipeline — when a query errors, the card shows "—".
73+
74+
## What's omitted (and why)
75+
76+
- **Marketing copy / pitch headline** — this is an authenticated console,
77+
not a landing page. The header is the user's name + status.
78+
- **Analytics charts**`useAnalyticsBreakdown` is heavy and belongs on
79+
`/dashboard/analytics`. Surfacing one chart here would duplicate it.
80+
- **Billing/invoices list** — already on `/dashboard/billing` and
81+
`/dashboard/invoices`.
82+
- **Security panel** — settings live in `/dashboard/security`.
83+
- **Admin chrome** — admins reach it via the sidebar.
84+
- **App creation wizard** — the Apps card links to the dedicated route.
85+
- **`DashboardActionCards`** — the existing brand card strip mixes blue
86+
(`#0B35F1`) and orange→black hover, both forbidden by the redesign
87+
constraints. We rebuild a smaller, monochrome+orange variant inline.
88+
89+
## Colors & hover
90+
91+
- Neutral: `bg-white/[0.04]`, border `border-white/10`, text `text-white`
92+
with `text-white/60` for muted lines.
93+
- Accent: `#FF5800` for the single primary balance/CTA card.
94+
- Hover:
95+
- Orange resting → `hover:bg-[#E04E00]` (darker orange).
96+
- Neutral resting → `hover:bg-white/[0.06]` (subtle white opacity).
97+
- **No** orange→black, **no** blue anywhere.
98+
99+
## Reuse
100+
101+
- `AgentsSection` / `AgentsSectionSkeleton` — kept verbatim.
102+
- `DashboardPageWrapper`, `DashboardPageContainer`, `DashboardPageStack`,
103+
`DashboardLoadingState` — kept.
104+
- `BrandButton`, `BrandCard` — for buttons and the framed cards.
105+
- Hooks: `useCreditsBalance`, `useContainers`, `useApps`, `useApiKeys`,
106+
`useDashboardReferralMe`, plus the existing `/api/v1/dashboard` fetch
107+
for agents.
108+
109+
No new endpoints, no new dependencies.

0 commit comments

Comments
 (0)