guanghu/docs/adr/0013-remove-theming-system.md
Guanghu Domestic Migration 9b41d51231
Some checks are pending
Auto-update PR branches / Update open PR branches (push) Waiting to run
CI / Frontend Static Quality Checks (push) Waiting to run
CI / Frontend Tests & Coverage (push) Waiting to run
CI / Rust Tests & Quality Checks (push) Waiting to run
CI / Linux build verification (push) Waiting to run
Deploy docs / Build VitePress site (push) Waiting to run
Deploy docs / Deploy to GitHub Pages (push) Blocked by required conditions
Release (Alpha) / Compute alpha version (push) Waiting to run
Release (Alpha) / Build release artifacts (push) Blocked by required conditions
Release (Alpha) / GitHub Release (alpha) (push) Blocked by required conditions
Release (Alpha) / Update docs and release pages (push) Blocked by required conditions
chore: import sanitized domestic snapshot for REPO-004
Source snapshot: 514ab1975951d94342ea38e64101d5a0f1c51c77
2026-07-17 15:55:28 +08:00

2.0 KiB

type, id, title, status, date, superseded_by
type id title status date superseded_by
ADR 0013 Remove vault-based theming system superseded 2026-03-23 0081

Context

Laputa had a vault-based theming system where themes were markdown notes in theme/ with type: Theme frontmatter. Each property became a CSS variable. This included a ThemeManager hook, theme property editor, dark mode detection, live preview on save, and three built-in themes. The system was complex (spanning Rust seed/create/defaults modules, TypeScript hooks, and CSS variable bridging) and added significant maintenance burden for a feature that most users never customized beyond the defaults.

Decision

Remove the vault-based theming system entirely. The app uses a single, hardcoded light theme defined in CSS variables (src/index.css) and editor theme (src/theme.json). The theme/ folder, ThemeManager hook, theme Rust modules, theme property editor, and dark mode support were all deleted.

Options considered

  • Option A (chosen): Remove theming, ship a single polished light theme — drastically reduced complexity, fewer files to maintain, no theme-related bugs. Downside: no user customization, no dark mode.
  • Option B: Keep theming but simplify — reduce to light/dark toggle only. Downside: still requires theme loading, CSS variable bridging, and live preview infrastructure.
  • Option C: Keep the full theming system — maximum flexibility. Downside: high maintenance cost for a rarely-used feature, frequent source of bugs (WKWebView reflow issues, CSS var sync).

Consequences

  • Deleted: src-tauri/src/theme/, src/hooks/useThemeManager.ts, ThemePropertyEditor.tsx, theme-related commands, _themes/ legacy support.
  • Single theme defined in src/index.css (CSS variables) and src/theme.json (editor typography).
  • No dark mode support — the app is light-only.
  • Protected folders reduced: theme/ is no longer scanned by scan_vault.
  • Re-evaluation trigger: if dark mode becomes a hard requirement for accessibility or user demand.