mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
fix(tui/agents): guard overlay clamp (fixes #478)
This commit is contained in:
@@ -35866,7 +35866,8 @@ impl ChatWidget<'_> {
|
||||
body_area.width
|
||||
} else {
|
||||
let max_allowed = body_area.width.saturating_sub(30).max(18);
|
||||
desired_sidebar.clamp(24, max_allowed)
|
||||
let min_allowed = 24.min(max_allowed);
|
||||
desired_sidebar.clamp(min_allowed, max_allowed)
|
||||
};
|
||||
|
||||
let constraints = if body_area.width <= sidebar_width {
|
||||
|
||||
@@ -2324,6 +2324,16 @@ fn agent_status_missing_batch_displays_error() {
|
||||
insta::assert_snapshot!("agent_status_missing_batch_displays_error", output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agents_overlay_narrow_terminal_does_not_panic() {
|
||||
let mut harness = ChatWidgetHarness::new();
|
||||
harness.send_key(make_key(KeyCode::Char('a'), KeyModifiers::CONTROL));
|
||||
|
||||
let output = render_chat_widget_to_vt100(&mut harness, 52, 18);
|
||||
let output = normalize_output(output);
|
||||
assert!(output.contains("Agents"), "Agents overlay did not render");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agents_toggle_claude_opus_persists_via_slash_command() {
|
||||
let _lock = ENV_LOCK.lock().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user