Skip to content

fix(dashboard): green hover/skeleton bleed + cap getRuns page_size#40

Merged
hoootan merged 2 commits into
mainfrom
fix/dashboard-page-size-cap
Apr 28, 2026
Merged

fix(dashboard): green hover/skeleton bleed + cap getRuns page_size#40
hoootan merged 2 commits into
mainfrom
fix/dashboard-page-size-cap

Conversation

@hoootan
Copy link
Copy Markdown
Owner

@hoootan hoootan commented Apr 28, 2026

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 --accent to mean "brand green" (#4ADE80), but shadcn already uses --accent to mean "neutral hover/selected surface" (the value Tailwind's bg-accent, hover:bg-accent, focus:bg-accent, text-accent-foreground resolve to in Skeleton, DropdownMenu, Select, Dialog, NavigationMenu, Command, DataTableColumnHeader, etc.).

Result: every loading skeleton, every dropdown hover, every selected command-palette item turned bright green.

Fix

  • Introduce --brand / --brand-ink tokens (the colors that used to be in --accent / --accent-ink).
  • Restore --accent to its shadcn intent — a neutral surface (var(--bg-3)).
  • Re-target every brand-intent token (--primary, --success, --ring, --chart-1, --sidebar-primary, --sidebar-ring, --accent-soft, --accent-wash, --focus) at --brand.
  • Re-target every brand-intent CSS rule (.btn-primary, .tag-ok, .dot-ok, .kpi-icon, .sparkline, .health-pill, .heatmap-cell.l*, .toggle.on, .set-nav .is-on, etc.) from var(--accent)var(--brand).
  • Keep the Tailwind theme bridge --color-accent: var(--accent) so bg-accent resolves to neutral.
  • Same surgery in the light theme.

Fix 2 — getRuns page_size cap

After the redesign, three pages call getRuns({ page_size: 200 }). The server caps page_size at 100 (server/src/flowforge_server/api/routes/runs.py:76Query(50, ge=1, le=100)), so every request returns 422 Unprocessable Entity and the runs/home/functions pages render empty.

Drop all three callsites from 200100 (server max).

Follow-up (out of scope)

Real pagination when there are >100 runs.

Test plan

  • pnpm build — all routes generate, no type errors
  • Open / — Skeleton shimmer renders neutral (not green); Recent activity loads with real runs (no 422)
  • Open /runs — list renders; hovering a row no longer flashes brand-green
  • Open /functions — sidebar recent-runs renders
  • Open /settings → click any nav item → Concurrency tab → toggle the idempotency switch — toggle stripe is still brand-green (--toggle.on { background: var(--brand) })
  • Open a Dialog (Settings → Danger zone → Pause all) — focus ring + close-button hover are neutral, primary action button is brand-green
  • Toggle theme to Light — same checks pass (brand color is #1E7A47)

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
Copilot AI review requested due to automatic review settings April 28, 2026 23:14
@hoootan hoootan changed the title fix(dashboard): cap getRuns page_size at 100 to match server limit fix(dashboard): green hover/skeleton bleed + cap getRuns page_size Apr 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.getRuns callsites to use page_size: 100 (server max) instead of 200.
  • Refactor dashboard theme tokens in globals.css by introducing --brand/--brand-ink and redefining --accent as 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.

Comment on lines +53 to +66
/* 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 */

Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +53 to +65
/* 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 */
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
/* 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);

Copilot uses AI. Check for mistakes.
…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.
@hoootan hoootan merged commit f645c58 into main Apr 28, 2026
4 checks passed
@hoootan hoootan deleted the fix/dashboard-page-size-cap branch April 28, 2026 23:37
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.

2 participants