Skip to content

feat: add per-mode theme overrides - #2324

Merged
ogulcancelik merged 2 commits into
herdrdev:masterfrom
aneym:pr/theme-custom-modes
Aug 22, 2026
Merged

feat: add per-mode theme overrides#2324
ogulcancelik merged 2 commits into
herdrdev:masterfrom
aneym:pr/theme-custom-modes

Conversation

@aneym

@aneym aneym commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

[theme.custom] applies one set of overrides in both modes, so with auto_switch a value tuned for the dark theme washes out when the light theme activates. #837 proposed per-mode blocks and @ogulcancelik approved a PR there.

This adds [theme.custom.light] and [theme.custom.dark]. Resolution order: theme defaults, then [theme.custom], then the block matching the resolved appearance. Configs that do not use the new blocks resolve exactly as they do today.

[theme]
auto_switch = true

[theme.custom]
accent = "#fe640b"

[theme.custom.light]
text = "#2e3145"
subtext0 = "#494c66"

before and after: sidebar rows in the light theme, with and without a light-mode override

Both panes are the same seeded layout rendered with catppuccin-latte active; the only difference is the [theme.custom.light] block.

Refs #837. #2032 asks for the same capability from a full-theme-pair angle; this shape covers it through [theme.custom.light]/[theme.custom.dark] alone.

Test plan

  • Rebased onto current master (ffc4e263).
  • Focused theme tests: 4 passed, covering parsing both blocks, shared-vs-mode precedence, active light/dark resolution, manual-mode fallback, and sidebar_bg/new sidebar row color tokens.
  • Full nextest run: 3,329 passed, 3 failed. The failures are unrelated PTY/process timing tests (live_handoff x2 and api_ping pane-info); rerunning the CI suite with exactly those three excluded passed all 3,329 remaining Rust tests plus fmt, clippy, UI architecture, integration assets, and plugin marketplace checks.
  • just windows-lint: passed.
  • Maintenance script suite: 98 passed, including config-reference parity, docs translation parity, and Windows ConPTY packaging.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db283f9a-99de-44b8-aedf-4ed9ea98d87b

📥 Commits

Reviewing files that changed from the base of the PR and between 47b056c and b7b3d5e.

📒 Files selected for processing (3)
  • docs/next/CHANGELOG.md
  • docs/next/website/src/content/docs/ja/configuration.mdx
  • docs/next/website/src/content/docs/zh-cn/configuration.mdx

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The theme configuration now supports light- and dark-appearance custom color overrides. Automatic theme switching applies active mode overrides after shared custom and legacy accent colors. Tests and documentation cover the new behavior.

Changes

Theme appearance overrides

Layer / File(s) Summary
Theme configuration contract
src/config/theme.rs, src/config.rs
CustomThemeColors defines optional light and dark ModeThemeColors tables. Deserialization tests cover their color values. The type is publicly re-exported.
Mode-aware palette resolution
src/app/state.rs, src/app/mod.rs
Automatic theme selection passes active mode overrides to palette resolution. Palette::with_mode_overrides applies token values after shared custom and legacy accent colors. Tests verify precedence and fallback behavior.
Configuration documentation and examples
docs/next/website/src/content/docs/configuration.mdx, docs/next/website/src/data/config-reference.json, docs/next/website/src/content/docs/ja/configuration.mdx, docs/next/website/src/content/docs/zh-cn/configuration.mdx, src/main.rs, docs/next/CHANGELOG.md
Documentation, reference data, changelog, and default examples describe light and dark appearance-specific color settings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to b7b3d

This adds optional light- and dark-mode theme overrides while preserving existing behavior for configurations that do not use them; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant HostAppearance
  participant resolve_effective_theme
  participant resolve_palette_for_theme_name
  participant Palette
  HostAppearance->>resolve_effective_theme: select light or dark appearance
  resolve_effective_theme->>resolve_palette_for_theme_name: pass active mode overrides
  resolve_palette_for_theme_name->>Palette: apply shared custom colors
  Palette->>Palette: apply active mode-specific colors
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (3 skipped: 3 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the per-mode theme overrides, resolution order, compatibility behavior, tests, and validation results.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding per-mode theme overrides.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kangal-bot

Copy link
Copy Markdown
Collaborator

Hi @aneym, thanks for your interest in contributing!

Herdr automatically admits focused bug fixes from contributors who are not maintainers when the title uses fix: ... or fix(scope): ... and the patch changes no more than 20 files and 1,000 total added or deleted lines.

Contributors who are not maintainers may submit only focused bug fixes. If this pull request fixes a bug, rename it to use a conventional fix: ... or fix(scope): ... title, then tag a maintainer to review and reopen it.

Feature requests, behavior changes, and other proposals belong in GitHub Discussions and require maintainer approval before a pull request.

If this gate classified the pull request incorrectly, reply and tag a maintainer listed in .github/MAINTAINERS. A verified maintainer can reopen it; reopening by anyone else will be closed again automatically.

Patch size: 7 changed files, 391 changed lines.

See https://github.com/herdrdev/herdr/blob/master/CONTRIBUTING.md for the contribution policy.

@kangal-bot kangal-bot closed this Aug 4, 2026
@ogulcancelik ogulcancelik reopened this Aug 4, 2026
@kangal-bot kangal-bot added ai-review Trigger automated AI reviews for pull requests admitted by the PR gate maintainer-approved PR scope explicitly approved by a maintainer labels Aug 4, 2026
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown

Greptile Summary

Adds light- and dark-specific custom theme overrides that are layered over shared overrides when automatic theme switching is active.

  • Extends theme configuration parsing and reference documentation with theme.custom.light and theme.custom.dark.
  • Applies the override block matching the resolved host appearance after the base theme and shared custom colors.
  • Preserves manual theme behavior by leaving mode-specific blocks inactive when auto_switch is disabled.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/app/mod.rs Resolves and applies the active appearance-specific override after shared theme colors while preserving manual-mode behavior.
src/app/state.rs Adds palette support for applying every mode-specific color token.
src/config/theme.rs Adds deserializable light and dark override blocks and parsing coverage.
src/config.rs Re-exports the new mode-specific theme color model.
src/main.rs Documents the new override blocks in the generated default configuration.
docs/next/website/src/data/config-reference.json Adds reference entries for all supported light- and dark-specific color tokens.

Reviews (13): Last reviewed commit: "docs: complete per-mode theme documentat..." | Re-trigger Greptile

Comment thread src/app/mod.rs
@aneym
aneym force-pushed the pr/theme-custom-modes branch from 66ee3b8 to d1a4e65 Compare August 8, 2026 02:55

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/config/theme.rs (1)

126-146: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Add sidebar_bg to mode-specific overrides.

ModeThemeColors omits sidebar_bg, although CustomThemeColors and Palette support it. A user cannot set a light-only or dark-only sidebar background.

Add sidebar_bg to ModeThemeColors. Apply it in Palette::with_mode_overrides. Add parsing and palette-resolution coverage.

Proposed fix
--- a/src/config/theme.rs
+++ b/src/config/theme.rs
 pub struct ModeThemeColors {
     pub accent: Option<String>,
     pub panel_bg: Option<String>,
+    pub sidebar_bg: Option<String>,
     pub surface0: Option<String>,
--- a/src/app/state.rs
+++ b/src/app/state.rs
         if let Some(c) = &custom.panel_bg {
             self.panel_bg = parse_color(c);
         }
+        if let Some(c) = &custom.sidebar_bg {
+            self.sidebar_bg = parse_color(c);
+        }

Based on supplied downstream context, src/app/state.rs:641-692 has the same omission.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cefb19c-6dd0-416f-9a93-164b72966a75

📥 Commits

Reviewing files that changed from the base of the PR and between 66ee3b8 and d1a4e65.

📒 Files selected for processing (7)
  • docs/next/website/src/content/docs/configuration.mdx
  • docs/next/website/src/data/config-reference.json
  • src/app/mod.rs
  • src/app/state.rs
  • src/config.rs
  • src/config/theme.rs
  • src/main.rs
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/next/website/src/content/docs/configuration.mdx
  • docs/next/website/src/data/config-reference.json
  • src/main.rs
  • src/app/state.rs
  • src/app/mod.rs
  • src/config.rs

@aneym
aneym force-pushed the pr/theme-custom-modes branch from d1a4e65 to baff68f Compare August 8, 2026 08:57
@aneym

aneym commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Added sidebar_bg to the per-mode overrides in baff68f: field on ModeThemeColors, applied in with_mode_overrides, covered in the parse and palette-resolution tests, and documented under theme.custom.light/theme.custom.dark in the config reference.

@aneym
aneym force-pushed the pr/theme-custom-modes branch 2 times, most recently from bd6babf to 1c53cf1 Compare August 11, 2026 02:55
@aneym
aneym force-pushed the pr/theme-custom-modes branch from 1c53cf1 to 47b056c Compare August 20, 2026 01:07
@aneym

aneym commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@aneym
aneym force-pushed the pr/theme-custom-modes branch 5 times, most recently from e35f2a1 to 7d23934 Compare August 21, 2026 22:04
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

@aneym

aneym commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@aneym

aneym commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@aneym

aneym commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews resumed.

@aneym

aneym commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
⚠️ Action not completed

No files to review.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aneym
aneym force-pushed the pr/theme-custom-modes branch from 7d23934 to f608ecd Compare August 22, 2026 04:53
aneym and others added 2 commits August 23, 2026 00:07
allow [theme.custom.light] and [theme.custom.dark] blocks so custom
overrides can differ per resolved appearance when auto_switch flips.
precedence: theme defaults, then [theme.custom], then the block for
the active mode. configs without the new blocks resolve unchanged.

refs herdrdev#837
@ogulcancelik
ogulcancelik force-pushed the pr/theme-custom-modes branch from f608ecd to b7b3d5e Compare August 22, 2026 21:11

@ogulcancelik ogulcancelik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the implementation, precedence, manual-mode behavior, config coverage, and documentation. Rebased onto current master; local and CI checks pass, and both review bots are clear.

@ogulcancelik
ogulcancelik merged commit db6f301 into herdrdev:master Aug 22, 2026
8 checks passed
@kangal-bot kangal-bot removed the ai-review Trigger automated AI reviews for pull requests admitted by the PR gate label Aug 22, 2026
@ogulcancelik

Copy link
Copy Markdown
Collaborator

@aneym sorry for taking so long, ty!

jerryfane added a commit to jerryfane/herdr that referenced this pull request Aug 24, 2026
* fix: match Windows Ctrl+digit keybindings (herdrdev#2913)

refs herdrdev#2910

* fix: sync powershell process working directory (herdrdev#2879)

* fix: reap ctrl-click url openers (herdrdev#2906)

* fix: reap ctrl-click url openers

refs herdrdev#2903

* fix: scope linux opener test import

refs herdrdev#2903

* test: isolate url opener regression

refs herdrdev#2903

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(docs): link agents to config reference data

* feat(website): plugin marketplace discovery shelves — trending and new arrivals

* fix(website): raise timeout on docs release integration test for slow builders

* fix: retry Windows installer activation after transient locks (herdrdev#2921)

refs herdrdev#2916

* fix: isolate hidden pane render cadence (herdrdev#2892)

refs herdrdev#2890

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: preserve macOS IME commits in report-all mode (herdrdev#2947)

* feat: make Windows generally available

* docs: publish preview documentation

* docs: finalize 0.8.1 release notes

* release: v0.8.1

* fix(ci): publish v0.8.1 documentation

* fix: restore v0.8.0 as stable release

* fix(perf): eliminate redundant terminal wake work (herdrdev#2962)

* fix(perf): eliminate redundant terminal wake work

* fix(perf): harden release benchmark gate

* test(perf): strengthen performance guardrails

* fix(theme): keep active terminal row visible under cursor (herdrdev#2989)

refs herdrdev#2987

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(cli): exit quietly when output pipes close (herdrdev#2996)

refs herdrdev#2994

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* docs: finalize 0.8.2 release notes

* release: v0.8.2

* docs: update website manifest for v0.8.2

* docs: publish preview documentation

* fix: strip ansi sequences from tab bar status (herdrdev#3003)

* fix: strip ansi sequences from tab bar status

refs herdrdev#3001

* docs: clarify tab bar escape sequence scope

refs herdrdev#3001

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix(input): preserve mouse forwarding through handoff (herdrdev#3002)

refs herdrdev#3000

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: honor mouse capture config in terminal attach (herdrdev#2995)

refs herdrdev#2992

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: synchronize plugin pane pwd (herdrdev#2985)

* fix: synchronize plugin pane pwd

refs herdrdev#2984

* refactor: isolate plugin pwd platform policy

refs herdrdev#2984

* docs: fix changelog conflict resolution

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: Can Celik <ogulcancelik@gmail.com>

* fix: add claude screen activity fallbacks

refs herdrdev#1630
refs herdrdev#2241

* fix(windows): detect cursor bundled node process (herdrdev#3034)

* fix(windows): detect cursor bundled node process

refs herdrdev#3032

* docs: clarify cursor detection scope

* fix(windows): constrain cursor runtime detection

refs herdrdev#3032

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* ci: support immutable preview releases

* chore: remove akbash maintainer authority

* test: use native path in docs parity assertion (herdrdev#3043)

* chore: pin kennel maintainer identities

* chore: keep kennel authority private

* fix(graphics): isolate oversized kitty images (herdrdev#3035)

* fix(graphics): isolate oversized kitty images

refs herdrdev#3033

* fix(graphics): budget pane image cleanup

refs herdrdev#3033

---------

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: preserve multiline paste in terminal attach (herdrdev#3056)

refs herdrdev#3054

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: keep background Claude MCP tasks working (herdrdev#3094)

* fix: match generated characters in prefix bindings (herdrdev#3085)

refs herdrdev#3079

* fix: publish Claude MCP detection manifest

* docs: document macos keychain launch context

refs herdrdev#966

* fix: preserve focus after background worktree removal (herdrdev#3099)

* fix: copy selections before delayed mouse release (herdrdev#3102)

refs herdrdev#3100

Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>

* fix: clear Windows Terminal identity in panes (herdrdev#3127)

* fix(windows): preserve non-us shifted text (herdrdev#3055)

* fix(windows): preserve non-us shifted text

refs herdrdev#3045

* fix(windows): retain shifted key repeat lifecycle

refs herdrdev#3045

* feat: add per-mode theme overrides (herdrdev#2324)

* feat: add per-mode theme overrides

allow [theme.custom.light] and [theme.custom.dark] blocks so custom
overrides can differ per resolved appearance when auto_switch flips.
precedence: theme defaults, then [theme.custom], then the block for
the active mode. configs without the new blocks resolve unchanged.

refs herdrdev#837

* docs: complete per-mode theme documentation

---------

Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>

* fix(windows): add local cmd installer bootstrap (herdrdev#3133)

* fix(windows): add local cmd installer bootstrap

refs herdrdev#2751

* fix(windows): bound installer downloads

refs herdrdev#2751

* fix(api): start lifecycle subscriptions from live events (herdrdev#3134)

refs herdrdev#1270

* fix: keep omp panes working through scheduled continuations (herdrdev#3122)

refs herdrdev#2851

* fix: serve a google-eligible favicon

* fix(graphics): batch kitty image row lifecycle (herdrdev#3166)

* fix(graphics): coalesce terminal kitty placements

A Unicode-placeholder image arrives as one placement per viewport row it
covers, and after 624dfd4 the budgeted encoder emitted one placement per
frame, so every redraw painted images one row per frame.

* fix(graphics): coalesce only pure kitty re-displays

Keep pixel uploads and superseded-image deletes in a transaction of
their own: a placement joins the coalesced transaction only when its
image is uploaded and its source already maps to that image, and
nothing joins after an upload or a delete.

* fix(graphics): batch kitty image row lifecycle

---------

Co-authored-by: kataokatsuki <kataokatsuki@users.noreply.github.com>

---------

Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
Co-authored-by: akbash <akbash@herdr.dev>
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: kangal-bot <285672167+kangal-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alex <a.neyman17@gmail.com>
Co-authored-by: caner-akca <94343893+caner-akca@users.noreply.github.com>
Co-authored-by: kataokatsuki <kataokatsuki@users.noreply.github.com>
joonhwan pushed a commit to joonhwan/herdr that referenced this pull request Aug 25, 2026
* feat: add per-mode theme overrides

allow [theme.custom.light] and [theme.custom.dark] blocks so custom
overrides can differ per resolved appearance when auto_switch flips.
precedence: theme defaults, then [theme.custom], then the block for
the active mode. configs without the new blocks resolve unchanged.

refs herdrdev#837

* docs: complete per-mode theme documentation

---------

Co-authored-by: Ogulcan Celik <ogulcancelik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer-approved PR scope explicitly approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants