From c06e7685b20c87966673673bbd0387cb4b64d656 Mon Sep 17 00:00:00 2001 From: Mostafa Ashraf Date: Sun, 1 Feb 2026 14:59:16 +0200 Subject: [PATCH] feat: Display the current profile name in the side panel's context section and remove it from the footer. --- tui/src/services/side_panel.rs | 35 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/tui/src/services/side_panel.rs b/tui/src/services/side_panel.rs index b84f8b9f..e59c0e95 100644 --- a/tui/src/services/side_panel.rs +++ b/tui/src/services/side_panel.rs @@ -69,7 +69,7 @@ pub fn render_side_panel(f: &mut Frame, state: &mut AppState, area: Rect) { let context_height = if context_collapsed { collapsed_height } else { - 5 // Header + Tokens + Model + Provider + 6 // Header + Tokens + Model + Provider + Profile }; // Billing section is hidden when billing_info is None (local mode) @@ -237,6 +237,13 @@ fn render_context_section(f: &mut Frame, state: &AppState, area: Rect, collapsed }; lines.push(make_row("Provider", provider_value, Color::DarkGray)); + // Profile + lines.push(make_row( + "Profile", + state.current_profile_name.clone(), + Color::DarkGray, + )); + let paragraph = Paragraph::new(lines); f.render_widget(paragraph, area); } @@ -632,29 +639,17 @@ fn render_changeset_section(f: &mut Frame, state: &AppState, area: Rect, collaps f.render_widget(paragraph, area); } -/// Render the footer section with version and profile -fn render_footer_section(f: &mut Frame, state: &AppState, area: Rect) { +/// Render the footer section with version and shortcuts +fn render_footer_section(f: &mut Frame, _state: &AppState, area: Rect) { let mut lines = Vec::new(); let version = env!("CARGO_PKG_VERSION"); - let profile = &state.current_profile_name; - let available_width = area.width as usize; - // Line 1: Version (left) and Profile (right) - let left_part = format!("{}v{}", LEFT_PADDING, version); - let right_part = format!("profile {} ", profile); - let total_content = left_part.len() + right_part.len(); - let spacing = available_width.saturating_sub(total_content).max(1); - - lines.push(Line::from(vec![ - Span::styled( - format!("{}v{}", LEFT_PADDING, version), - Style::default().fg(Color::DarkGray), - ), - Span::raw(" ".repeat(spacing)), - Span::styled("profile ", Style::default().fg(Color::DarkGray)), - Span::styled(profile, Style::default().fg(Color::Reset)), - ])); + // Line 1: Version (left) + lines.push(Line::from(vec![Span::styled( + format!("{}v{}", LEFT_PADDING, version), + Style::default().fg(Color::DarkGray), + )])); // Empty line between version/profile and shortcuts lines.push(Line::from(""));