fix(ui): honor color settings in prompt themes#10009
Conversation
Greptile SummaryThis PR fixes demand prompt themes ignoring the
Confidence Score: 5/5The change is narrowly scoped to theme selection; the worst outcome of a regression is unstyled or over-styled prompt output, not data loss or a crash. Settings::get() already calls console::set_colors_enabled_stderr() before get_theme() checks that flag, so the color state is always up to date when the guard runs. no_color_theme() clears every style field the PR description identifies as problematic, and the test asserts all of them. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "test(ui): cover unstyled prompt theme fi..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request introduces a no-color theme mode in src/ui/theme.rs by checking if colors are enabled for stderr and returning a theme with default styles if they are not. It also adds a unit test to verify that key theme components have no foreground or background colors when disabled. The review feedback suggests expanding the no_color_theme function to reset additional fields such as error_indicator, help_style, and spinner_style, and updating the regression tests to include assertions for these fields.
Summary
color=falsewithcolor_theme=base16Discussion
Addresses #9999.
Tests
mise run formatcargo fmt --all -- --checkcargo test --all-features ui::theme::tests::get_theme_returns_no_color_theme_when_color_is_disabled -- --exact