Skip to content

refactor(cloud-ui): design-token compliance sweep — 87 files, ~800 hardcoded values → semantic tokens - #13073

Merged
lalalune merged 1 commit into
developfrom
refactor/ui-cloud-token-sweep
Jul 4, 2026
Merged

refactor(cloud-ui): design-token compliance sweep — 87 files, ~800 hardcoded values → semantic tokens#13073
lalalune merged 1 commit into
developfrom
refactor/ui-cloud-token-sweep

Conversation

@0xSolace

@0xSolace 0xSolace commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Design-token compliance sweep — cloud UI (87 files, ~800 values)

The cloud UI had accumulated hardcoded hex colors, white-opacity ladders (text-white/74 etc.), emoji icons, and ad-hoc backdrop-blur that made it effectively unthemeable and inconsistent across surfaces. This sweep converts those to the semantic tokens introduced by the design-token foundation.

Stacked PR. Base is feat/ui-token-foundation-shell (#13069) so the diff here is exactly the 87 cloud files and it compiles green (it needs the token defs). Merge #13069 first, then this retargets cleanly to develop.

The design-system argument

  • ~800 hardcoded values → semantic tokens: status-success / status-warning / destructive, accent, muted, card, scrim.
  • chain-* brand colors are kept as documented exceptions — a chain's brand color is data, not theme.
  • lucide-react icons replace inline SVGs and emoji icons for consistent sizing, currentColor theming, and a11y.
  • Zero behavior changes intended — this is a visual-token compliance pass.

Real bugs found and fixed during the sweep

  • Broken group-hover on MCP cards — hover state never triggered because the group class sat on the wrong ancestor.
  • Invalid Tailwind classes like text-white/74 (not a real opacity step) that silently rendered as full-opacity white.
  • rgba stacking in invoice detail tables where overlapping semi-transparent fills compounded into the wrong final color.

File count

87 files (packages/ui/src/cloud/** + packages/ui/src/cloud-ui/**), +1571 / −1596.

Validation

  • packages/ui tsc --noEmit: clean across all 87 files.
  • No colocated test files in scope; this is a token-compliance pass validated by the type checker and visual review.

Series

Part of a stacked UI-overhaul series. Depends on #13069. See linked siblings.

— [sol-orch]

…rdcoded values to semantic tokens

The cloud UI had accumulated hardcoded hex colors, white-opacity ladders
(text-white/74 etc.), emoji icons, and ad-hoc backdrop-blur that made it
effectively unthemeable and inconsistent across surfaces. This sweep converts
those to the semantic tokens introduced by the design-token foundation.

Scope (87 files under packages/ui/src/cloud/ and packages/ui/src/cloud-ui/):
- ~800 hardcoded values converted to semantic tokens: status-success /
  status-warning / destructive, accent, muted, card, scrim. chain-brand
  colors are kept as documented exceptions (a chain's brand color is data,
  not theme).
- lucide-react icons replace inline SVGs and emoji icons for consistent
  sizing, currentColor theming, and a11y.

Real bugs found and fixed during the sweep:
- broken group-hover on MCP cards (hover state never triggered because the
  group class was on the wrong ancestor).
- invalid Tailwind classes like text-white/74 (not a real opacity step) that
  silently rendered as full-opacity white.
- rgba stacking in invoice detail tables where overlapping semi-transparent
  fills compounded into the wrong final color.

Zero behavior changes intended — this is a visual-token compliance pass.

Stacked on the design-token foundation PR (#13069); needs its token defs to
compile.

Co-authored-by: wakesync <shadow@shad0w.xyz>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@0xSolace

0xSolace commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

UI overhaul series (stacked, merge in order):

Merge #13069 first; #13070 and #13073 then retarget to develop cleanly.

(A planned 4th PR for browser-bundle exports was dropped: #12919 and #12936 already landed those fixes on develop.)

— [sol-orch]

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 237b7780-808b-40ed-8537-f387457b9414

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/ui-cloud-token-sweep

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

Comment @coderabbitai help to get the list of available commands.

@lalalune

lalalune commented Jul 4, 2026

Copy link
Copy Markdown
Member

Reviewed — the token-compliance mechanics are sound, but two things block merge:

  1. Dead base branch. This PR targets feat/ui-token-foundation-shell (feat(ui): design-token foundation + shell mechanics (safe-area floor, home space, bottom bar, backgrounds) #13069), which is closed and unmerged. The token-foundation CSS (base.css + tailwind-theme.css) already landed on develop, so retarget this PR to develop — that should collapse it to a clean 87-file diff and clear the stale-base guard.

  2. Needs the visual-review loop. This isn't pure invisible token-aliasing — it has real visual delta: selected-state hue shifts (blue/purple/green → accent/status tokens), three claimed visual bug fixes, and emoji/brand-SVG → generic lucide icon swaps that are semantically loose (Twitter/X→AtSign, LinkedIn→Briefcase, Facebook→Users, Discord→Gamepad2, Telegram→Send). Per repo rules, packages/ui visual changes need bun run --cwd packages/app audit:cloud (or audit:app) before/after screenshots reviewed to good before merge — and please reconsider the brand-icon mappings (a generic AtSign/Briefcase reads worse than the recognizable brand glyph).

Retarget + attach the visual-audit evidence + confirm the icon choices, then it's good to go.

@lalalune
lalalune force-pushed the refactor/ui-cloud-token-sweep branch from a4a12bb to b6379e7 Compare July 4, 2026 14:53
@greptile-apps

greptile-apps Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review. (3000 files found, 100 file limit)

@lalalune
lalalune changed the base branch from feat/ui-token-foundation-shell to develop July 4, 2026 14:53
@lalalune

lalalune commented Jul 4, 2026

Copy link
Copy Markdown
Member

Review (PR-by-PR triage): needs-fix — same orphaned-base problem as #13070.

Most of the 87-file token sweep is sound (I cross-checked every semantic token root against develop theme CSS — accent/status-*/txt/muted/card/surface/border/etc. all resolve). But it is not merge-ready:

  • drawer.tsx uses bg-scrim, but color-scrim exists only on the closed-unmerged base feat(ui): design-token foundation + shell mechanics (safe-area floor, home space, bottom bar, backgrounds) #13069 — on develop bg-scrim emits no CSS, so the drawer overlay loses its dim (content bleeds through) — regressing the exact thing this claims to fix.
  • drawer.tsx assumes bg-card is opaque, but develop's dark card is rgba(0,0,0,0.72) — combined with the missing scrim the drawer is more see-through than before.
  • Evidence is inadequate for a UI/cloud-ui change: only tsc --noEmit (which cannot detect a missing-Tailwind-token regression) — no before/after screenshots or video.

To land: land color-scrim + the opaque dark-card value on develop (or fold them into this PR), retarget to develop, finish the 7 residual raw-palette classes, and attach audit:app before/after visual evidence proving the drawer/MCP-cards/badges render correctly. Also note sandbox-status.ts now renders disconnected and error identically (both status-danger). Decide together with #13070.

@lalalune
lalalune merged commit a6de6d6 into develop Jul 4, 2026
6 of 34 checks passed
@lalalune
lalalune deleted the refactor/ui-cloud-token-sweep branch July 4, 2026 14:59
@lalalune

lalalune commented Jul 4, 2026

Copy link
Copy Markdown
Member

Reviewed (adversarial): the token sweep itself is genuine and well-scoped (cloud UI only; verified no logic/billing/numeric/href changes in the billing/earnings/invoice files — only className/icon swaps). Two blockers before merge: (1) base is #13069, which is CLOSED unmerged — retarget to develop + rebase (the 'merge #13069 first' plan is dead). (2) After retargeting, drawer.tsx DrawerOverlay uses bg-scrim but --color-scrim is undefined on develop (it only existed in the closed #13069) while the old bg-black/50 + blur is dropped → the drawer scrim renders transparent (silent regression). Add --color-scrim to tailwind-theme.css (or use an existing token). Also: it's labeled 'zero behavior changes' but bundles real ones (scrollable DrawerBody, opaque scrim, sandbox status remap collapsing disconnected/error to one hue) — worth their own note/tests.

lalalune pushed a commit that referenced this pull request Jul 4, 2026
…brand fallback, buy-credits disabled state (#13437)

Fixes 2 of 3 visual findings from QA tracker #13406, and root-causes the third.

Finding 2 (billing selected payment-method = blank white box) — OWNED, our regression:
  The token sweep #13073 (a6de6d6) converted the selected toggle from
  `bg-[#FF5800] ... text-white` to `bg-[var(--accent)] ... text-white`. That
  regressed on the cloud dashboard: `dashboard-shell.tsx` wraps everything in
  `.theme-cloud`, where `--accent` resolves to `--brand-white`. Result:
  bg-white + text-white = an invisible label on a white fill = the blank white
  box. Fix pairs the accent fill with `text-accent-foreground` (black under
  `.theme-cloud`) so the label is readable in every theme scope, and swaps the
  raw white-opacity ladder on the unselected state for theme-aware
  border/muted tokens.

Finding 3 (Buy credits disabled reads as broken gray):
  `BrandButton variant="primary"` is `bg-accent` (white under `.theme-cloud`);
  `disabled:opacity-50` ghosted the white pill into an accidental muddy gray.
  Made the disabled state intentional per the design system — muted token
  surface (`disabled:bg-bg-muted disabled:text-muted`) + the existing reduced
  opacity — mirroring the proven `icon-primary` disabled pattern. Fixes the
  disabled look for all BrandButton primary call sites, not just billing.

Finding 1 (dashboard/apps white rectangle top-center) — root-caused, NOT a
  standalone cloud-ui component bug:
  The develop apps render path (ApplicationsPage → DashboardStatGrid) has no
  <img> and no white-block element. Pixel analysis of the prod evidence shows
  a flat pure-#fff 289x79 rectangle flanked by pure #000 — the agent-app-boot
  artifact from the apex post-signin bug ([qa-agent]'s #13410 scope: agent app
  boots on the apex host with no same-origin backend, assets 404 / shell chrome
  mis-renders). Same white-accent theme class as finding 2 is the likely
  mechanism. Left to #13410; not touching routing.

Evidence: tsc clean on touched files (pre-existing core/shared codegen errors
only), all 4 anti-slop gates unaffected (the pre-existing ChatSurface.tsx
backdrop-blur regression is untouched by this PR), biome clean, 5 new unit
tests pass, codex-reviewed (no correctness issues). Prod verification routes
through [qa-agent]'s signed-in session per the tracker protocol.

— [sol-orch]

Co-authored-by: wakesync <shadow@shad0w.xyz>
@github-actions github-actions Bot added the ui label Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants