Skip to content

feat(themes): add 13 built-in color themes with theme picker.#3

Merged
Blankeos merged 6 commits intomainfrom
color-themes
Apr 1, 2026
Merged

feat(themes): add 13 built-in color themes with theme picker.#3
Blankeos merged 6 commits intomainfrom
color-themes

Conversation

@Blankeos
Copy link
Copy Markdown
Owner

@Blankeos Blankeos commented Apr 1, 2026

  • Add ColorTheme struct and COLOR_THEMES array with 13
    presets
    (default, catppuccin-mocha, catppuccin-macchiato,
    dracula, tokyonight,
    gruvbox, nord, solarized-dark, onedark, rosepine,
    kanagawa, everforest,
    monokai)
  • Expand Theme struct with 100+ color fields for
    complete UI theming
    (syntax highlighting, diff panel, rebase mode, ref
    labels, etc.)
  • Add interactive theme picker popup with live preview
    and keyboard navigation
  • Persist selected theme to app state config
  • Replace all hardcoded color values with theme-aware
    colors

image

Blankeos added 2 commits April 1, 2026 05:10
- Add ColorTheme struct and COLOR_THEMES array with 13
presets
  (default, catppuccin-mocha, catppuccin-macchiato,
dracula, tokyonight,
   gruvbox, nord, solarized-dark, onedark, rosepine,
kanagawa, everforest,
   monokai)
- Expand Theme struct with 100+ color fields for
complete UI theming
  (syntax highlighting, diff panel, rebase mode, ref
labels, etc.)
- Add interactive theme picker popup with live preview
and keyboard navigation
- Persist selected theme to app state config
- Replace all hardcoded color values with theme-aware
colors
- Rename RefPickerItem/RefPickerAction to
ListPickerItem/ListPickerAction for generality
- Extract ListPickerCore struct to hold common picker
state (items, selected, search_textarea, scroll_offset)
- Consolidate RefPicker and ThemePicker to use
ListPickerCore
- Extract list_picker_display_idx() helper to compute
display indices with category headers
- Extract list_picker_visible_height() helper for
consistent height calculation
- Consolidate rendering logic into render_list_picker()
function
- Add search/filter support to ThemePicker for
consistency
- Remove redundant inline comments
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db6149c071

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/gui/mod.rs
Comment on lines +2340 to +2342
let mut state = self.config.app_state.clone();
state.color_theme = Some(ct.id.to_string());
let _ = state.save(&self.config.state_path);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Load latest AppState before saving chosen theme

The theme picker’s Enter handler saves color_theme by cloning self.config.app_state, which is only the startup snapshot. If a user changed persisted UI settings earlier in the same session (for example showCommandLog/showFileTree/diffLineWrap, which are saved via AppState::load+save), this write will overwrite those newer values with stale ones and silently revert preferences. Read the current state from disk before mutating color_theme so unrelated fields are preserved.

Useful? React with 👍 / 👎.

Comment thread src/gui/mod.rs
open_theme_picker = true;
}
}
KeyCode::Down => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep j/k navigation in help popup

This branch now handles only arrow keys, so j/k no longer move the selection in the help popup even though the popup hint still advertises j/k navigation. In practice, pressing j or k is treated as text input and modifies the search field, which is a behavioral regression from previous key handling and breaks expected vim-style navigation.

Useful? React with 👍 / 👎.

Comment thread src/gui/mod.rs
Comment on lines +305 to +309
pub fn active_theme(&self) -> crate::config::Theme {
crate::config::COLOR_THEMES
.get(self.current_theme_index)
.map(|ct| ct.to_theme())
.unwrap_or_default()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Respect gui.theme overrides when computing active theme

active_theme() now returns only a built-in preset from COLOR_THEMES, and rendering paths use this result directly, so existing gui.theme overrides from config.yml (parsed by UserConfig::theme) are effectively ignored after this change. That removes previously working user customization behavior and introduces a backward-compatibility regression for users relying on custom border/selection color settings.

Useful? React with 👍 / 👎.

Blankeos added 4 commits April 1, 2026 08:16
Separates state directory from
config directory following XDG
Base Directory specification.
State files are now stored in
XDG_STATE_HOME (defaults to
~/.local/state) instead of the
config directory, improving
compliance with system directory
standards.

Also refactors home_dir resolution
to avoid duplication by extracting
it once.
@Blankeos Blankeos merged commit 02c3b4d into main Apr 1, 2026
5 checks passed
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