Skip to content

refactor: migrate theme system to native macOS patterns#805

Merged
datlechin merged 1 commit intomainfrom
refactor/native-macos-theme-system
Apr 20, 2026
Merged

refactor: migrate theme system to native macOS patterns#805
datlechin merged 1 commit intomainfrom
refactor/native-macos-theme-system

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Semantic colors by default: UI/sidebar/toolbar colors now resolve to native NSColor equivalents (labelColor, separatorColor, controlBackgroundColor, etc.) instead of hardcoded hex. They adapt automatically to light/dark mode, system accent color, and high contrast settings. Custom themes can still override with hex values.
  • Native typography: Replaced ThemeEngine.shared.activeTheme.typography.* across 65 files with SwiftUI semantic text styles (.body, .caption, .subheadline, .callout, .title3, .title2) for proper Dynamic Type and accessibility support.
  • Removed layout customization: Deleted ThemeTypography, ThemeSpacing, ThemeCornerRadius, ThemeIconSizes, ThemeRowHeights, ThemeAnimations structs and the Layout tab from the theme editor. Spacing/radius/icon values replaced with literals.
  • Native empty states: EmptyStateView now wraps ContentUnavailableView (macOS 14+).
  • Minor fixes: removed deprecated UserDefaults.synchronize(), fixed VimRegister pasteboard side-effect in didSet (now explicit syncToPasteboard()), fixed AboutWindowController panel memory retention.

93 files changed, 623 insertions, 1190 deletions.

Test plan

  • Switch between Default Light, Default Dark, Dracula, Nord themes — verify visual correctness
  • Toggle macOS light/dark mode in Auto appearance mode — UI colors should adapt
  • Change system accent color — selection highlights should follow
  • Enable high contrast (Accessibility > Display) — text/borders should become more distinct
  • Open Settings > Appearance — verify only Fonts + Colors tabs (no Layout)
  • Duplicate a built-in theme, edit colors, verify "Reset to Default" button works
  • Import an old-format theme JSON (with typography/spacing sections) — should load without errors
  • Verify theme preview cards show correct sidebar strips for all themes
  • Check empty states: AI Chat panel, Structure tab (foreign keys, indexes, check constraints)
  • Vim mode: yank text (yy), paste in external app — pasteboard sync should work
  • Open and close About window — verify no memory growth

@datlechin datlechin merged commit ed3f37d into main Apr 20, 2026
2 checks passed
@datlechin datlechin deleted the refactor/native-macos-theme-system branch April 20, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant