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:
@@ -3938,9 +3938,15 @@ impl ChatApp {
|
|||||||
&& matches!(key.code, KeyCode::Char('p') | KeyCode::Char('P'));
|
&& matches!(key.code, KeyCode::Char('p') | KeyCode::Char('P'));
|
||||||
|
|
||||||
if is_file_focus_key && matches!(self.mode, InputMode::Normal) {
|
if is_file_focus_key && matches!(self.mode, InputMode::Normal) {
|
||||||
self.expand_file_panel();
|
let was_collapsed = self.is_file_panel_collapsed();
|
||||||
self.focused_panel = FocusedPanel::Files;
|
self.toggle_file_panel();
|
||||||
self.status = "Files panel focused".to_string();
|
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);
|
return Ok(AppState::Running);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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(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
|
constraints.push(Constraint::Length(3)); // Mode and shortcuts bar
|
||||||
|
|
||||||
let layout = Layout::default()
|
let layout = Layout::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user