Skip to content

(docs): cut the theme context down to current behaviour and invariants (#1355) - #1397

Merged
devsuitup merged 2 commits into
mainfrom
docs/1355-theme
Nov 29, 2026
Merged

devsuitup merged 2 commits into
mainfrom
docs/1355-theme

Conversation

@devsuitup

Copy link
Copy Markdown
Owner

Part 18 of #1355

Summary

Reshapes .ai/contexts/theme.md into purpose, current behaviour, invariants and test pointers, under headings. No behaviour change.

  • Before: 81 lines, 633 words. After: 85 lines, 569 words (about 90 percent of the words; the old file was already almost all constraints, and the headings add lines). Correctness and reasons won over the 55 percent target.
  • Inventory: 40 statements checked against code and tests; 37 TRUE, 0 FALSE, 2 unverifiable (design-palette provenance, external manual-verification list), 1 history dropped.
  • Dropped: the "reuses the Settings design's palette" provenance, the "hash regenerated" history, duplicate wording.
  • No pointer cites a heading of this file; all 13 citation sites (README, shared-guidelines, ipc-bridge, window-frame, viewer-panel, changes-view) cite it whole and still resolve.

Docs

Agent docs only (.ai/contexts/theme.md).

Changelog

no-changelog: no user-visible change.

Tests

  • node scripts/check-docs.js --validate, node scripts/check-doc-refs.js (0 failures), git diff --check, pointer script: pass.
  • test/theme.test.js (Node 22, one process): 23 pass, 0 fail. No test reads this doc's text.

Not verified

Native painting, startup flash, contrast and real xterm rendering (as the doc itself says); the Settings design-palette provenance.

Invariants kept

  • Global theme setting: SETTING_DEFAULTS.theme = dark; light, system; sets data-theme on root; Settings -> General -> Appearance saves with other global prefs.
  • style.css owns tokens; default :root dark, :root[data-theme="light"] swaps; distinct old shades keep distinct tokens (Dark unchanged); fixed colors (white on solid buttons, black shadows/backdrops, brand artwork, search highlights).
  • Heatmap = CSS classes not canvas; inline-style modules (sidebar subagent colors, tool bullets, toolbar flashes) use CSS variables.
  • THEME_CHOICES single source for normalization + #sv-theme; --control-color-scheme via .control-select; schedule field errors keep #e06060 via --state-error.
  • Head scripts setting-defaults.js + theme.js before stylesheets/body; getInitialTheme() -> sync get-initial-theme -> loaded settings cache only; no localStorage mirror (reason kept); data-theme before parse.
  • System follows matchMedia live; explicit ignores; Settings applies via window.appTheme.apply; app-theme-changed only on effective change.
  • theme.js dual mode (normalize/resolve/colors exports; window.appTheme).
  • installWindowTheme (main.js): same normalizer/resolver, nativeTheme.updated, initial options include background+overlay, Dark #111118 (accepted startup difference), macOS traffic lights, windowTheme.refresh() in writeGlobalSettings shared by set-setting(global)/merge-global-settings after persistence not project saves, sync IPC name only no FS IO.
  • Terminals: Terminal Theme = dark palette; Light -> LIGHT_TERMINAL_THEME whatever; Dark restores; new terminals same palette; bindTerminalThemes(() => openSessions) / window._applyTerminalTheme over every entry incl hidden and panel shells.
  • CodeMirror compartment Dracula/GitHub Light; plugin reconfigure + listener removal; docs/selection/undo/merge state untouched; Markdown diagram observer follows data-theme.
  • Tests: theme.test.js scope; theme-dark.json (dark root tokens, CSS hash, three inline modules), var() fallback resolution via test/css-vars.js, normalization rules, hash-changes-on-edit consequence; static guarantee; manual-verification list.
  • covers: unchanged (5 files). H1 unchanged.

…#1355)

Group the context under purpose, behaviour, invariants and test pointers; drop the design-palette provenance and the fixture regeneration history. Every constraint, reason and pointer target is kept.
@devsuitup devsuitup added the no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived label Nov 29, 2026
@devsuitup
devsuitup merged commit a024e9e into main Nov 29, 2026
10 checks passed
@devsuitup
devsuitup deleted the docs/1355-theme branch November 29, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog The PR changes nothing a user sees; the CHANGELOG.md check is waived

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant