Skip to content

refactor(cockpit): polish — chat lib data-theme, token migration, border standardization#307

Merged
blove merged 8 commits into
mainfrom
cockpit-polish-clean
May 14, 2026
Merged

refactor(cockpit): polish — chat lib data-theme, token migration, border standardization#307
blove merged 8 commits into
mainfrom
cockpit-polish-clean

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 14, 2026

Summary

First in a three-PR sequence (spec: `docs/superpowers/specs/2026-05-13-cockpit-polish-design.md`, plan: `docs/superpowers/plans/2026-05-13-cockpit-polish.md`).

  • Chat lib theme attribute rename: `[data-ngaf-chat-theme]` → `[data-theme]` in both `chat-tokens.ts` (TS-injected) and `chat.css` (global stylesheet). Aligns with Tailwind v4 / shadcn / Storybook conventions. The lib's existing three-layer cascade (`:root` default → `prefers-color-scheme` override → `[data-theme]` programmatic override) is preserved — only the override attribute name renames. Breaking for any external consumer that set the old attribute; we're 0.0.x so a patch bump is sufficient signal.
  • `installEmbeddedTheme` cleanup: drop the in-flight `dataset.ngafChatTheme` set. After the chat lib rename, `data-theme` covers both design-tokens and chat lib theming.
  • `cockpit.css` token migration: drop dead `@theme inline` block (13 lines, no Tailwind utility consumed it) and unused shadcn alias `:root` block (14 lines). Replace 11 hardcoded `rgba(0, 64, 144, X)` and the single `rgba(26, 27, 38, 0.95)` literal with `--ds-*` tokens — code blocks and callouts now theme correctly in light AND dark. Net cockpit.css: -30 lines.
  • Border standardization: migrate 6 inline `style={{ borderBottom: ... }}` / `borderRightColor` / `borderLeft` sites in cockpit components to Tailwind arbitrary-value classes (`border-b border-[var(--ds-border)]`). Consistent with cockpit's dominant Tailwind-arbitrary-value pattern. Includes preserving layout-stability in `navigation-groups.tsx` (transparent border on inactive branch).

PR 2 (chat lib polish — text-wrap bug + bubble width handling) and PR 3 (cockpit ↔ website style alignment) follow.

Test plan

  • `pnpm nx run-many -t lint,test -p design-tokens,ui-react,example-layouts,chat,cockpit` — green
  • `pnpm nx e2e cockpit` — verified via CI on this PR (local was blocked by .next dev lock contention with running dev server)
  • `pnpm nx build website` — green
  • `pnpm nx build cockpit-chat-timeline-angular` — green
  • Manual chrome MCP smoke (pre-PR): chat input flips with host theme; no white callouts in cockpit dark; no dark code-block headers in light

🤖 Generated with Claude Code

blove and others added 8 commits May 13, 2026 17:07
First in a three-PR sequence (cockpit polish → chat lib polish → cockpit
vs website style alignment). Renames @ngaf/chat theme attribute from
data-ngaf-chat-theme to data-theme for consistency. Replaces hardcoded
rgba color literals in cockpit.css with --ds-* tokens. Standardizes
cockpit border styling on Tailwind arbitrary values. Drops shadcn-style
alias vars in cockpit.css in favor of direct --ds-* consumption.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6 tasks: chat lib data-theme rename, installEmbeddedTheme cleanup,
cockpit.css token migration + dead-code drop, inline border → Tailwind
arbitrary values across 6 component files, version bumps, PR ship.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 14, 2026 0:12am

Request Review

@blove blove merged commit 60492c7 into main May 14, 2026
14 checks passed
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