Tint chat composer background (#1921)

## Summary
- give the chat composer a subtle custom background and apply it across
the full area drawn

<img width="1008" height="718" alt="composer-bg"
src="https://github.com/user-attachments/assets/4b0f7f69-722a-438a-b4e9-0165ae8865a6"
/>

- update turn interrupted to be more human readable
<img width="648" height="170" alt="CleanShot 2025-08-06 at 22 44 47@2x"
src="https://github.com/user-attachments/assets/8d35e53a-bbfa-48e7-8612-c280a54e01dd"
/>

## Testing
- `cargo test --all-features` *(fails: `let` expressions in
`core/src/client.rs` require newer rustc)*
- `just fix` *(fails: `let` expressions in `core/src/client.rs` require
newer rustc)*

------
https://chatgpt.com/codex/tasks/task_i_68941f32c1008322bbcc39ee1d29a526
This commit is contained in:
Ed Bayes
2025-08-07 00:46:45 -07:00
committed by GitHub
parent 04b40ac179
commit eb80614a7c
3 changed files with 9 additions and 5 deletions

View File

@@ -688,7 +688,7 @@ impl AgentTask {
let event = Event {
id: self.sub_id,
msg: EventMsg::Error(ErrorEvent {
message: "Turn interrupted".to_string(),
message: " Turn interrupted".to_string(),
}),
};
let tx_event = self.sess.tx_event.clone();

View File

@@ -35,6 +35,8 @@ const BASE_PLACEHOLDER_TEXT: &str = "...";
/// If the pasted content exceeds this number of characters, replace it with a
/// placeholder in the UI.
const LARGE_PASTE_CHAR_THRESHOLD: usize = 1000;
/// Background color used for the chat composer area.
const COMPOSER_BG_COLOR: Color = Color::Black;
/// Result returned when the user interacts with the text area.
pub enum InputResult {
@@ -735,6 +737,10 @@ impl WidgetRef for &ChatComposer {
let mut textarea_rect = textarea_rect;
textarea_rect.width = textarea_rect.width.saturating_sub(1);
textarea_rect.x += 1;
// Fill only the textarea content region with a subtle background so it
// doesn't affect the hint line or popups and remains behind the text.
buf.set_style(textarea_rect, Style::default().bg(COMPOSER_BG_COLOR));
let mut state = self.textarea_state.borrow_mut();
StatefulWidgetRef::render_ref(&(&self.textarea), textarea_rect, buf, &mut state);
if self.textarea.text().is_empty() {

View File

@@ -504,10 +504,8 @@ impl HistoryCell {
}
pub(crate) fn new_error_event(message: String) -> Self {
let lines: Vec<Line<'static>> = vec![
vec!["ERROR: ".red().bold(), message.into()].into(),
"".into(),
];
let lines: Vec<Line<'static>> =
vec![vec!["🖐 ".red().bold(), message.into()].into(), "".into()];
HistoryCell::ErrorEvent {
view: TextBlock::new(lines),
}