fix(dashboard): green hover/skeleton bleed + cap getRuns page_size#40
Conversation
After the dashboard redesign (#37/#38), three pages requested `getRuns({ page_size: 200 })`. The server caps `page_size` at 100 (`server/src/flowforge_server/api/routes/runs.py:76` — `Query(50, ge=1, le=100)`), so every one of those calls returns: 422 Unprocessable Entity {"validation_errors":[{"field":"query.page_size", "message":"Input should be less than or equal to 100"}]} The runs list, dashboard home, and functions page all render empty because the primary fetch errors. Reproduce by visiting any of the three pages with at least one run in the system and watching the network tab — `GET /api/v1/runs?page_size=200` 422s. Fix: drop the three callsites to 100 (the server max). A future follow-up should paginate properly when there are >100 runs, but this restores visibility immediately. Files changed: - dashboard/src/app/(dashboard)/page.tsx - dashboard/src/app/(dashboard)/functions/page.tsx - dashboard/src/app/(dashboard)/runs/page.tsx
There was a problem hiding this comment.
Pull request overview
Fixes dashboard run-list fetching failures caused by requesting a page_size above the server-enforced maximum, and also includes a global CSS token refactor that repurposes --accent.
Changes:
- Update three dashboard
api.getRunscallsites to usepage_size: 100(server max) instead of200. - Refactor dashboard theme tokens in
globals.cssby introducing--brand/--brand-inkand redefining--accentas a neutral surface token.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dashboard/src/app/globals.css | Introduces --brand tokens and repurposes --accent; updates many component styles to use --brand. |
| dashboard/src/app/(dashboard)/runs/page.tsx | Caps runs list fetch page_size from 200 → 100. |
| dashboard/src/app/(dashboard)/page.tsx | Caps overview page runs fetch page_size from 200 → 100. |
| dashboard/src/app/(dashboard)/functions/page.tsx | Caps functions page sidebar runs fetch page_size from 200 → 100. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /* Brand color (formerly named --accent — renamed to free up --accent | ||
| for shadcn's "neutral hover surface" semantic that Tailwind's | ||
| bg-accent / hover:bg-accent / text-accent-foreground rely on). | ||
| Use --brand / --brand-ink for any brand-color UI. */ | ||
| --brand: #4ADE80; | ||
| --brand-ink: #0B0C0F; | ||
|
|
||
| /* shadcn-compatible "subtle hover/selected surface" — what bg-accent, | ||
| hover:bg-accent, etc. resolve to in dropdowns, dialogs, command | ||
| palette, skeletons, data-table headers. NEVER set this to the brand | ||
| color or every shadcn primitive lights up green on hover. */ | ||
| --accent: var(--bg-3); | ||
| --accent-ink: var(--ink-1); /* ink-on-accent-surface */ | ||
|
|
There was a problem hiding this comment.
This PR’s title/description are about capping getRuns page_size to the server’s max, but this hunk also introduces a broad design-token rename/semantic change (--accent repurposed, new --brand/--brand-ink). Please either split the token refactor into a separate PR or update the PR title/description to reflect the additional scope so reviewers can evaluate the UI impact appropriately.
| /* Brand color (formerly named --accent — renamed to free up --accent | ||
| for shadcn's "neutral hover surface" semantic that Tailwind's | ||
| bg-accent / hover:bg-accent / text-accent-foreground rely on). | ||
| Use --brand / --brand-ink for any brand-color UI. */ | ||
| --brand: #4ADE80; | ||
| --brand-ink: #0B0C0F; | ||
|
|
||
| /* shadcn-compatible "subtle hover/selected surface" — what bg-accent, | ||
| hover:bg-accent, etc. resolve to in dropdowns, dialogs, command | ||
| palette, skeletons, data-table headers. NEVER set this to the brand | ||
| color or every shadcn primitive lights up green on hover. */ | ||
| --accent: var(--bg-3); | ||
| --accent-ink: var(--ink-1); /* ink-on-accent-surface */ |
There was a problem hiding this comment.
Repurposing --accent to var(--bg-3) is a breaking change for existing var(--accent) usages that still expect the brand color (e.g. dashboard login icon/shield, runs graph OK bars, run detail output label). Since those callsites aren’t updated in this PR, this will likely cause visual regressions and could reduce contrast. Consider keeping --accent as the brand for backward compatibility (and introduce a new token for shadcn’s hover surface), or update all remaining var(--accent) consumers to use --brand/--brand-ink.
| /* Brand color (formerly named --accent — renamed to free up --accent | |
| for shadcn's "neutral hover surface" semantic that Tailwind's | |
| bg-accent / hover:bg-accent / text-accent-foreground rely on). | |
| Use --brand / --brand-ink for any brand-color UI. */ | |
| --brand: #4ADE80; | |
| --brand-ink: #0B0C0F; | |
| /* shadcn-compatible "subtle hover/selected surface" — what bg-accent, | |
| hover:bg-accent, etc. resolve to in dropdowns, dialogs, command | |
| palette, skeletons, data-table headers. NEVER set this to the brand | |
| color or every shadcn primitive lights up green on hover. */ | |
| --accent: var(--bg-3); | |
| --accent-ink: var(--ink-1); /* ink-on-accent-surface */ | |
| /* Brand color. Keep --accent / --accent-ink mapped to the brand for | |
| backward compatibility with existing var(--accent) consumers that | |
| still expect the historical brand semantic. */ | |
| --brand: #4ADE80; | |
| --brand-ink: #0B0C0F; | |
| --accent: var(--brand); | |
| --accent-ink: var(--brand-ink); | |
| /* Neutral hover/selected surface for shadcn-style primitives. Use this | |
| new token instead of repurposing --accent, so older brand-colored | |
| UI continues to render correctly. */ | |
| --accent-surface: var(--bg-3); | |
| --accent-surface-ink: var(--ink-1); |
…rand) Copilot caught 4 stray var(--accent) / var(--accent-ink) references in TSX inline styles that the globals.css rename missed: - (auth)/login/page.tsx — logo background + 2FA Shield icon - (dashboard)/runs/page.tsx — bar-chart OK fraction - (dashboard)/runs/[id]/page.tsx — Output section kicker All four were brand-intent (the redesign was using --accent to mean brand). They would have rendered as the new neutral surface (var(--bg-3)) after this PR's earlier --accent → --brand rename, losing the green. Switching them to --brand restores the intent.
Two unrelated fixes that landed in the same commit while resolving a working-tree state. Both are user-visible.
Fix 1 — Skeleton + shadcn hover bleeding brand-green
The redesign (#37) overloaded the variable name
--accentto mean "brand green" (#4ADE80), but shadcn already uses--accentto mean "neutral hover/selected surface" (the value Tailwind'sbg-accent,hover:bg-accent,focus:bg-accent,text-accent-foregroundresolve to inSkeleton,DropdownMenu,Select,Dialog,NavigationMenu,Command,DataTableColumnHeader, etc.).Result: every loading skeleton, every dropdown hover, every selected command-palette item turned bright green.
Fix
--brand/--brand-inktokens (the colors that used to be in--accent/--accent-ink).--accentto its shadcn intent — a neutral surface (var(--bg-3)).--primary,--success,--ring,--chart-1,--sidebar-primary,--sidebar-ring,--accent-soft,--accent-wash,--focus) at--brand..btn-primary,.tag-ok,.dot-ok,.kpi-icon,.sparkline,.health-pill,.heatmap-cell.l*,.toggle.on,.set-nav .is-on, etc.) fromvar(--accent)→var(--brand).--color-accent: var(--accent)sobg-accentresolves to neutral.Fix 2 —
getRunspage_sizecapAfter the redesign, three pages call
getRuns({ page_size: 200 }). The server capspage_sizeat 100 (server/src/flowforge_server/api/routes/runs.py:76—Query(50, ge=1, le=100)), so every request returns422 Unprocessable Entityand the runs/home/functions pages render empty.Drop all three callsites from
200→100(server max).Follow-up (out of scope)
Real pagination when there are >100 runs.
Test plan
pnpm build— all routes generate, no type errors/— Skeleton shimmer renders neutral (not green); Recent activity loads with real runs (no 422)/runs— list renders; hovering a row no longer flashes brand-green/functions— sidebar recent-runs renders/settings→ click any nav item → Concurrency tab → toggle the idempotency switch — toggle stripe is still brand-green (--toggle.on { background: var(--brand) })#1E7A47)