feat(ui): shrink system/status output height and improve file panel toggle feedback

- Adjust layout constraint from 5 to 4 lines to match 2 lines of content plus borders.
- Refactor file focus key handling to toggle the file panel state and set status messages (“Files panel shown” / “Files panel hidden”) instead of always expanding and using a static status.
This commit is contained in:
2025-10-13 19:18:50 +02:00
parent 80dffa9f41
commit ae0dd3fc51
2 changed files with 10 additions and 4 deletions

View File

@@ -3938,9 +3938,15 @@ impl ChatApp {
&& matches!(key.code, KeyCode::Char('p') | KeyCode::Char('P'));
if is_file_focus_key && matches!(self.mode, InputMode::Normal) {
self.expand_file_panel();
self.focused_panel = FocusedPanel::Files;
self.status = "Files panel focused".to_string();
let was_collapsed = self.is_file_panel_collapsed();
self.toggle_file_panel();
if was_collapsed && !self.is_file_panel_collapsed() {
self.status = "Files panel shown".to_string();
} else if !was_collapsed && self.is_file_panel_collapsed() {
self.status = "Files panel hidden".to_string();
} else {
// No visual change (e.g., width constraints), keep prior status
}
return Ok(AppState::Running);
}

View File

@@ -283,7 +283,7 @@ pub fn render_chat(frame: &mut Frame<'_>, app: &mut ChatApp) {
}
constraints.push(Constraint::Length(input_height)); // Input
constraints.push(Constraint::Length(5)); // System/Status output (3 lines content + 2 borders)
constraints.push(Constraint::Length(4)); // System/Status output (2 lines content + 2 borders)
constraints.push(Constraint::Length(3)); // Mode and shortcuts bar
let layout = Layout::default()