Skip to content

feat(ui): add dark/light/system theme support with toggle#100

Open
davidszp wants to merge 3 commits intoAdembc:mainfrom
davidszp:feat/theme-support
Open

feat(ui): add dark/light/system theme support with toggle#100
davidszp wants to merge 3 commits intoAdembc:mainfrom
davidszp:feat/theme-support

Conversation

@davidszp
Copy link
Copy Markdown

@davidszp davidszp commented Jan 9, 2026

Summary

  • Add theme engine with Dark and Light color schemes
  • Support "system" theme that auto-detects OS preference (macOS, Linux, Windows)
  • Press T to cycle themes: dark → light → system → dark
  • Theme preference persists in ~/.lazyssh/metadata.json

Changes

  • New Theme struct centralizes all UI colors (tcell + hex markup)
  • Platform-specific OS theme detection via build tags
  • Backwards-compatible metadata format (migrates old format automatically)
  • All hardcoded colors replaced with CurrentTheme.* references

Test plan

  • Build passes on all platforms (make build-all)
  • Toggle theme with T key, verify UI updates
  • Restart app, verify theme persists
  • Test "system" theme follows OS dark/light setting (tested on Arch Linux)
  • Verify old metadata.json files still work

Note: System theme detection tested on Arch Linux only. macOS and Windows detection implemented but not yet tested.

- Add Theme struct with Dark and Light presets in theme.go
- Add 'system' theme that auto-detects OS preference:
  - Linux: freedesktop portal (gdbus)
  - macOS: defaults read AppleInterfaceStyle
  - Windows: registry AppsUseLightTheme
- Replace all hardcoded colors with CurrentTheme.* references
- Add 'T' keyboard shortcut to cycle themes (dark → light → system)
- Persist theme preference in ~/.lazyssh/metadata.json
- Support backward compatibility with old metadata format
- Add settings infrastructure (GetTheme/SaveTheme) to service layer
- Add tests for theme and settings functionality
Separate alias text color from keyboard hint color for independent styling.
@davidszp davidszp mentioned this pull request Jan 10, 2026
3 tasks
- Watch for OS theme changes when "system" mode is selected
- Linux: event-driven via gdbus monitor (instant)
- macOS: polling-based detection (2s interval)
- Windows: stub implementation (detection only, no live updates)
- Improve light theme VersionTag/CommitTag contrast
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