Skip to content

feat: dark/light theme toggle at runtime#21

Open
muk2 wants to merge 2 commits intomainfrom
feature/issue-19-theme-toggle
Open

feat: dark/light theme toggle at runtime#21
muk2 wants to merge 2 commits intomainfrom
feature/issue-19-theme-toggle

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 18, 2026

Summary

Implements runtime dark/light theme toggling for pgrsql, addressing #19.

  • Ctrl+Shift+T toggles between dark and light themes from any screen
  • Theme persistence — preference saved to ~/.config/pgrsql/theme and loaded on startup
  • Status bar indicator — shows current theme name (Dark/Light) in the right section
  • Help overlay — updated with the new keybinding
  • Added ThemeName::toggle() and ThemeName::as_str() helper methods
  • App::new() loads saved theme preference on initialization

Changes

File Change
src/ui/theme.rs Added ThemeName::toggle(), ThemeName::as_str() methods
src/ui/app.rs Added toggle_theme(), save_theme_preference(), load_theme_preference() methods; Ctrl+Shift+T global keybinding; load preference in App::new()
src/ui/components.rs Theme indicator in status bar; new keybinding in help overlay

Test plan

  • All 124 existing tests pass
  • Clippy clean (no warnings)
  • cargo fmt clean
  • Verify Ctrl+Shift+T toggles theme visually
  • Verify theme persists after restart
  • Verify status bar shows "Dark" or "Light"
  • Verify help overlay lists the new keybinding

Closes #19

🤖 Generated with Claude Code

muk2 and others added 2 commits February 18, 2026 19:21
Add Ctrl+Shift+T keybinding to toggle between dark and light themes.
Theme preference persists across sessions via ~/.config/pgrsql/theme.
Status bar shows current theme indicator. Help overlay updated with
new keybinding.

Closes #19

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Most terminals report Ctrl+Shift+T as KeyCode::Char('T') with only
the CONTROL modifier — the SHIFT is implicit in the uppercase letter.
The previous check required both CONTROL and SHIFT explicitly, which
only works with enhanced keyboard protocols (e.g. kitty).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Feature: Dark/light theme toggle at runtime

1 participant