fix: fix border style for BottomPane (#893)

This PR fixes things so that:

* when the `BottomPane` is in the `StatusIndicator` state, the border
should be dim
* when the `BottomPane` does not have input focus, the border should be
dim

To make it easier to enforce this invariant, this PR introduces
`BottomPane::set_state()` that will:

* update `self.state`
* call `update_border_for_input_focus()`
* request a repaint

This should make it easier to enforce other updates for state changes
going forward.
This commit is contained in:
Michael Bolin
2025-05-10 23:34:13 -07:00
committed by GitHub
parent b4785b5f88
commit a1f51bf91b
3 changed files with 63 additions and 45 deletions

View File

@@ -252,10 +252,7 @@ impl ChatWidget<'_> {
cwd,
reason,
};
let needs_redraw = self.bottom_pane.push_approval_request(request);
if needs_redraw {
self.request_redraw()?;
}
self.bottom_pane.push_approval_request(request)?;
}
EventMsg::ApplyPatchApprovalRequest {
changes,
@@ -284,8 +281,7 @@ impl ChatWidget<'_> {
reason,
grant_root,
};
let _needs_redraw = self.bottom_pane.push_approval_request(request);
// Redraw is always need because the history has changed.
self.bottom_pane.push_approval_request(request)?;
self.request_redraw()?;
}
EventMsg::ExecCommandBegin {