Skip to content

CL-6490: scan plugins-ui for Tailwind utilities, and guard the scan list - #224

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-6490-tailwind-source
Aug 21, 2026
Merged

TheGreatAxios merged 2 commits into
mainfrom
cl-6490-tailwind-source

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • apps/web/src/tailwind.css scanned artifact-ui, bench-ui, chat-ui, and settings-ui for Tailwind utility classes but not plugins-ui, even though apps/web/src/app.css imports its prebuilt styles.css the same way as the others. plugins-ui's component geometry lives entirely as Tailwind utility classes (its own styles.css is a one-line comment saying exactly that), so nothing generated the CSS for min-h-16 (plugin-card.tsx) or [&>*:last-child]:border-b-0 (the group dividers in plugins-gallery.tsx, mcp-servers-section.tsx, mcp-preset-cards.tsx). Added the missing @source "../../../packages/plugins-ui/src"; line.
  • tasks-ui had the identical gap (imported, never scanned). It has no Tailwind utility classes in its source today (its own styles.css comment says "layout glue only"), so this wasn't visibly broken — but leaving it out means the same silent failure reopens the moment someone adds one. Added it too, to make "every package whose stylesheet is imported is also scanned" an actual invariant instead of a case-by-case judgment call.
  • New check:tailwind-source guard (wired into package.json and .github/workflows/ci.yml, same pattern as check:web-utilities/check:ui-vocabulary): fails when a package whose stylesheet app.css imports has no matching @source entry in tailwind.css, naming the exact line to add. The point of the message is that this failure mode is otherwise silent — no build error, just missing CSS.

Verification (before/after)

Built apps/web and grepped the emitted CSS:

  • Reverted tailwind.css to the pre-fix @source list (only artifact-ui/bench-ui/chat-ui/settings-ui) and ran the new check against it: fails, naming both plugins-ui and tasks-ui and the exact @source line to add.
  • With the fix applied, check:tailwind-source passes, and the built CSS now contains .min-h-16{min-height:calc(var(--spacing) * 16)} and .\[\&\>\*\:last-child\]\:border-b-0>:last-child{...} — both previously absent.
  • Caveat found while verifying, not fixed here: installed-strip.tsx's data-[state=connected]:bg-success (and its sibling data-[state=needs_attention]:bg-destructive) still does not compile even with the @source fix. Reason: apps/web's own Tailwind build never registers --color-success/--color-destructive as @theme color tokens — those only exist as plain :root custom properties inherited from react-ui's already-compiled stylesheet, so this build's Tailwind compiler doesn't know "success"/"destructive" are valid colors and can't emit the variant utility. bg-success/bg-destructive alone happen to work only because react-ui's own separate build already emits those plain classes for its own components — but the data-[state=...]: combinator is specific to installed-strip.tsx and only this build could generate it. Fixing this needs --color-success/--color-destructive (or similar) registered in tailwind.css's own @theme block — a different, small fix, out of scope here since it's a distinct root cause from the missing @source line. Flagging for a follow-up.

CL-6472 read

Traced whether the missing utilities plausibly caused CL-6472's "Plugins page shows only GitHub" symptom. They don't look like a contributing cause:

  • min-h-16 only sets a row's minimum height; without it the row still renders at its intrinsic content height (padding + text) — shorter, not hidden.
  • [&>*:last-child]:border-b-0 only removes the last row's bottom border; without it the row still renders, just with an extra border line (a double border, not a missing row).
  • plugins-gallery.tsx's PluginGrid maps directly over the plugins prop passed in from apps/web/src/pages/plugins-page.tsx — which preset rows exist at all is decided entirely upstream, by data fetching/resolution, before any of these CSS classes apply.

None of the three "confirmed dead" classes can make a row disappear or collapse to invisible — they're geometry/cosmetic only. This doesn't rule out a stale-build angle in general, but the specific utilities named in CL-6490 don't explain CL-6472's symptom. Not closing CL-6472 — just adding this as evidence.

Test plan

  • bun test scripts/checks/test/tailwind-source.test.ts — new unit tests, 5 pass
  • bun run check:tailwind-source — passes on the fixed tree; fails (naming both gaps) when run against the pre-fix @source list
  • bun run check:web-utilities — passes, confirms min-h-16 and the last-child border rule now land in built CSS
  • bun test scripts/checks/test (the CI "Structural check self-tests" step) — 109 pass, includes the new file
  • bun run lint — clean (0 errors)
  • bun run check (typecheck, lint, test) — passes

Fixes CL-6490.

… the @source list

apps/web/src/tailwind.css scanned artifact-ui, bench-ui, chat-ui, and
settings-ui for Tailwind utilities but not plugins-ui, even though app.css
imports its prebuilt stylesheet the same way. plugins-ui's component
geometry lives entirely as Tailwind utility classes, so `min-h-16` and the
`[&>*:last-child]:border-b-0` group-divider rule never made it into the
built CSS — silently, since a missing @source entry errors nowhere.

tasks-ui had the same gap (imported but not scanned); it has no Tailwind
utilities in its source today, but adding it now keeps the invariant that
every imported package is also scanned, so the same silent gap can't
reopen the moment it adds one.

check:tailwind-source guards this: it fails when a package whose
stylesheet app.css imports is missing from tailwind.css's @source list,
naming the exact line to add.
@TheGreatAxios
TheGreatAxios merged commit a48df23 into main Aug 21, 2026
2 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-6490-tailwind-source branch August 25, 2026 15:29
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.

1 participant