fix(theme): use terminal-default background instead of hardcoded Black (#586)#601
fix(theme): use terminal-default background instead of hardcoded Black (#586)#601merchloubna70-dot wants to merge 2 commits into
Conversation
Hmbown#586) Replace hardcoded Color::Black background with Color::Reset so the TUI respects the user's terminal background color. Fixes display on light terminals and custom themes.
There was a problem hiding this comment.
Code Review
This pull request updates the TUI rendering logic to use the terminal's default background color (Color::Reset) when clearing the screen. While this is a positive change, feedback indicates it is incomplete because other UI components, such as the main body and header, still use hardcoded background colors that override the terminal's default. It is recommended to apply Color::Reset to these components as well to ensure a consistent look.
| // Clear entire area with background color | ||
| let background = Block::default().style(Style::default().bg(app.ui_theme.header_bg)); | ||
| // Clear entire area with terminal default background | ||
| let background = Block::default().style(Style::default().bg(Color::Reset)); |
There was a problem hiding this comment.
This change is a good step towards respecting the terminal's theme, but it seems incomplete as other parts of the UI still use hardcoded background colors, making this fix only partially effective.
- Main Body Background: On lines 4607-4609, the main body area (
chunks[1]) is filled withpalette::DEEPSEEK_INK. This overrides the terminal's default background for the largest part of the UI. - Header Background: The
HeaderWidgetis constructed withapp.ui_theme.header_bgon line 4586, which is then used as its background color. This also overrides the terminal's default background.
To fully address the issue described in the pull request, you might want to consider using Color::Reset in these places as well, or removing the explicit background setting to let the initial clear show through.
For example, for the body:
// crates/tui/src/tui/ui.rs:4607-4609
Block::default()
.style(Style::default().bg(Color::Reset))
.render(chunks[1], f.buffer_mut());And for the header, you could consider passing Color::Reset to HeaderData::new instead of app.ui_theme.header_bg.
…bown#601) Follow-up to Hmbown#601 — Gemini review identified the fix as incomplete. Replaces ALL hardcoded Color::Black backgrounds with Color::Reset across 10 UI files: sidebar, session_picker, model_picker, provider_picker, command_palette, pager, plan_prompt, user_input, deepseek_theme, ui. Implemented using `deepseek exec --model deepseek-v4-flash`. 🐋
…bown#601) Follow-up to Hmbown#601 — Gemini review identified the fix as incomplete. Replaces ALL hardcoded Color::Black backgrounds with Color::Reset across 10 UI files: sidebar, session_picker, model_picker, provider_picker, command_palette, pager, plan_prompt, user_input, deepseek_theme, ui. Implemented using `deepseek exec --model deepseek-v4-flash`. 🐋
|
Closing as superseded by current The main The additional Closing #601 as integrated/superseded for the original #586 issue. |
Closes #586.
Root cause: Background and border colors were hardcoded to
Color::Black, breaking display on light terminals and custom themes.Fix: Replace
Color::BlackwithColor::Resetfor background elements so the TUI inherits the user's terminal background color.Implemented using
deepseek exec --model deepseek-v4-flash. 🐋