Skip to content

refactor(desktop): remove dead shell CSS recipes and close check-dead-css blind spots #1980

Description

@Astro-Han

Summary

maka-tokens.css carries ~13 dead legacy shell "recipes" plus 2 dead tokens, and scripts/check-dead-css.mjs cannot see them due to three blind spots in the scanner.

Evidence

Dead rules with zero className consumers anywhere in apps/desktop/src + packages/ui/src (verified per-class, exact match, not substring):

  • .maka-shell (maka-tokens.css:1208), .maka-shell-rail-right (1217), .maka-sidebar + header/section/row/button state family (1223-1281), .maka-titlebar (1294,1304), .maka-chat (1310), .maka-composer-toolbar (1408), .maka-shimmer (1469)
  • Tokens --w-rail/--w-sidebar (649-650) are read only by those dead rules.
  • Live for contrast: .maka-main (mcp-page.tsx:306), .maka-code (artifact-preview.tsx:77), .maka-turn (packages/ui/chat-turn.tsx:398).

Scanner blind spots (scripts/check-dead-css.mjs):

  1. Class selectors are collected only from styles/ + reference-shell.css; maka-tokens.css is scanned for tokens only.
  2. Consumer check is substring sourceBlob.includes(cls)maka-shell is "used" by maka-shell-astryx, maka-sidebar by maka-sidebar-update-button, maka-titlebar by maka-titlebar-action, maka-chat by maka-chat-message-*. .maka-composer-toolbar and .maka-shimmer have no substring consumer at all — they are invisible purely due to blind spot 1.
  3. Tokens are seeded as "live" by reads inside the token sheet itself.

--check currently prints "no dead classes or tokens found ✓" while ~13 dead rules coexist — the baseline gate is blind for this sheet.

Fix

  • Delete the dead rules and --w-rail/--w-sidebar; fold @keyframes maka-shimmer into functional-motion.stories.tsx (its only consumer) or delete it, and fix the stale governance comment.
  • Fix the scanner: include maka-tokens.css class selectors in the scan, switch the consumer check to word-boundary matching (\bmaka-shell\b).
  • While in the sheet: apps/desktop/src/renderer/astryx-theme/maka.d.ts:7 references ./maka.variants.d.ts, which @astryxdesign/cli 0.2.0 no longer emits (scripts/build-astryx-theme.mjs:30-33); strip the reference during theme build post-processing (currently masked by skipLibCheck).

Owner

apps/desktop renderer (CSS) + scripts/check-dead-css.mjs.

Acceptance

  • npm run check:release / check-dead-css --check flags dead classes in maka-tokens.css (fixture covering prefix-collision and token-read-only-by-dead-rules).
  • Removing the dead rules causes no visual change (no live consumer).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions