chore: Tailwind v4 cleanup — drop cssnano + tokenize hardcoded colors#181
Conversation
cssnano was dead weight under Tailwind v4: both @tailwindcss/postcss and Vite's production minifier already minify CSS (verified dist CSS is minified without it). Bumps version 4.51.1 -> 4.51.2 and scaffolds the tw4-cleanup LCD work-item JOURNAL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Repairs ~18 already-written component classes that referenced tokens absent
from the adapter and so emitted no CSS:
- bg-surface-hover (7 uses) — missing hover lift on rows/buttons
- text-text-disabled (11 uses) — uncolored disabled flags/buttons
Also adds surface.sunken (#000000) so the next commit can replace hardcoded
bg-black/{40,20} with bg-surface-sunken/{40,20} via opacity modifiers (identical
CSS). Parity test extended to lock the three new hex values.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- bg-black/{40,20} -> bg-surface-sunken/{40,20} (Info x5, PaginatedTableView x2,
StackViewer x1, MemoryViewerPaginated x2) — identical CSS via opacity modifier
- text-gray-500! -> text-text-tertiary! for UNMAPPED memory cells
Satisfies the CLAUDE.md no-hardcoded-colors rule for these components. CRT
display colors remain intentionally exempt.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Log the cssnano drop + token-compliance / dead-token repair as DECISIONS D-007, retire the Tailwind-v4-follow-ups debt subsection, and note the deferred remainder (error reds, text-black, index.css base defaults) under Component Color Standardization. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (13)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughTailwind v4 cleanup continuation: introduces three semantic color tokens, removes cssnano from the build, updates component styling to use the new surface-sunken background token, refactors the memory viewer with performance optimizations and enhanced keyboard navigation, and documents the changes via decision logs and version bump. ChangesTailwind v4 Cleanup & Component Improvements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying apple1js with
|
| Latest commit: |
5515142
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2f01e171.apple1js.pages.dev |
| Branch Preview URL: | https://chore-tw4-cleanup.apple1js.pages.dev |
Move shareable project facts from machine-local Claude memory into committed instructions so they survive for any contributor: - Fix a HARMFUL instruction: 'Before ANY Commit' told everyone to run repo-wide yarn lint:md:fix, which corrupts the lcd-conventions.md machine block and reflows nested lists (prettier 4-space vs markdownlint MD007 2-space; md-lint isn't in CI so it's silent). Now scopes markdownlint to the edited file + warns. - Make the version branch-prefix mapping explicit (feat/=minor; fix|refactor| chore|docs|test=patch; major needs approval; owner may override refactor->minor). - Add 'WASM core tests need a real browser' to Testing Strategy + a fuller section in cpu_test_guidelines.md (native cargo test panics on CPU/WasmSystem; parity suites skip in CI; verify via Vite import in a browser). - Add browser-verify reality to 'UI Work' (emulator never idles -> drive via in-page JS; sample auto-dismissing toasts in one loop). - De-hardcode the stale version (4.42.7) in the Quick Start checklist. Version 4.51.3 (pinned above in-flight PR #181's 4.51.2 to keep the version.ts conflict resolution unambiguous). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…#182) Move shareable project facts from machine-local Claude memory into committed instructions so they survive for any contributor: - Fix a HARMFUL instruction: 'Before ANY Commit' told everyone to run repo-wide yarn lint:md:fix, which corrupts the lcd-conventions.md machine block and reflows nested lists (prettier 4-space vs markdownlint MD007 2-space; md-lint isn't in CI so it's silent). Now scopes markdownlint to the edited file + warns. - Make the version branch-prefix mapping explicit (feat/=minor; fix|refactor| chore|docs|test=patch; major needs approval; owner may override refactor->minor). - Add 'WASM core tests need a real browser' to Testing Strategy + a fuller section in cpu_test_guidelines.md (native cargo test panics on CPU/WasmSystem; parity suites skip in CI; verify via Vite import in a browser). - Add browser-verify reality to 'UI Work' (emulator never idles -> drive via in-page JS; sample auto-dismissing toasts in one loop). - De-hardcode the stale version (4.42.7) in the Quick Start checklist. Version 4.51.3 (pinned above in-flight PR #181's 4.51.2 to keep the version.ts conflict resolution unambiguous). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the Tailwind v3→v4 upgrade (#179), executing the two tech-debt items parked in
DECISIONS.mdD-006 plus a latent bug surfaced while scoping them. Logged as D-007.What changed
cssnano— redundant under v4:@tailwindcss/postcss+ Vite already minify CSS in production (verified the emitteddistCSS is minified without it). One dep + one config line gone.bg-surface-hover(7×) andtext-text-disabled(11×), but neither token existed intokens.ts/the adapter, so those classes emitted no CSS (missing hover lift on rows/buttons, uncolored disabled flags/buttons). Addedsurface.hover(#334155) andtext.disabled(#6B7280) — fixes all ~18 call sites with zero component edits.bg-black/{40,20}→bg-surface-sunken/{40,20}(newsurface.sunken#000000; identical CSS via opacity modifier) across Info, PaginatedTableView, StackViewer, MemoryViewerPaginated (10 sites); unmapped-celltext-gray-500!→text-text-tertiary!.Out of scope (deferred): error reds (
Error.tsx/AppContent),text-blackcontrast text,index.cssbase defaults. CRT colors exempt (CLAUDE.md).Why the broken tokens slipped through
The token-parity test only guards adapter → config (forward: "every token is in the theme"), never component → token (reverse: "every class resolves"). So dead class references were invisible to CI.
Verification
yarn test:cigreen — 759 passed, 20 skipped (the skipped are browser-only WASM parity/benchmark tests). Parity test extended to lock the 3 new hex values.distCSS grep (the deterministic RENDER check — Tailwind v4 only emits a utility when the class is used AND maps to a real token):bg-surface-hover{background-color:#334155}— now emits (was absent)text-text-disabled,.text-text-muted{color:#6b7280}— now emits (was absent)bg-surface-sunken/40→oklab(0% none none/.4)— byte-identical to oldbg-black/40distCSS still minified.Version bumped 4.51.1 → 4.51.2 (chore = patch).
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests
Chores