Skip to content

chore(desktop): CSS/token governance and magic-number cleanup #1046

Closed

Description

@Astro-Han

Context

Low-risk housekeeping surfaced by an audit. CSS is otherwise well-governed
(dead CSS ≈ 0, z-index fully tokenized, 31 justified !important).

CSS structure

  • theme-preview.css (670) is a grab-bag: styles bot (:420-538), About, WeChat, and
    generic form-input focus alongside actual theme-preview. Split by concern; return
    .settingsBot* to bot.css.
  • Two naming dialects: kebab .maka-* everywhere vs camelCase across settings/*
    (~603 fragments). Pick one or document the settings dialect.

Token misuse / phantoms

  • Hardcoded hex #07C160 (WeChat green) at theme-preview.css:550,578 — the only raw hex
    value in component CSS; tokenize as --brand-wechat or similar.
  • Phantom tokens surviving on fallback only: --surface (chat-detail.css:57, real token
    is --surface-canvas), --accent-contrast (onboarding.css:319).
  • Dead token defs (zero consumers): --shadow-border-opacity (maka-tokens.css:227/623),
    --radius (:383), --maka-titlebar-area-height (:537).

Magic numbers / inline styles (TS)

  • Name bare delays: main.tsx:26 (150), :34 (2500); app-shell-effects.ts:139 (200);
    skills-panel.tsx:100 (4000) — sibling constants are already named.
  • Collapse repeated static inline style: tool-activity.tsx:107/124/138 (+ stray
    marginRight 3 vs 4 at :147) into one class.
  • session-history-list.tsx:288 — move the static transition: 140ms into CSS.

Acceptance

theme-preview split; no raw hex or phantom/dead tokens; named constants; no duplicated
static inline style. Can be done as several small PRs if preferred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions