From 6de6a4a911c91924021cf5dbe0f629274e8d5f41 Mon Sep 17 00:00:00 2001 From: kurise <3067168909@qq.com> Date: Fri, 8 May 2026 23:43:41 +0800 Subject: [PATCH] fix(statusline): wire GitBranch to footer rendering Previously S::GitBranch was exposed in /statusline picker and persisted to config, but the footer render path always returned Vec::new(). Wire it up by: - Adding S::GitBranch => footer_git_branch_spans(app) in the match - Adding footer_git_branch_spans() that calls the already-implemented workspace_git_branch() and formats as "git:{branch}" Fixes #1217 --- crates/tui/src/tui/ui.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/tui/src/tui/ui.rs b/crates/tui/src/tui/ui.rs index b717568c..d20aacbe 100644 --- a/crates/tui/src/tui/ui.rs +++ b/crates/tui/src/tui/ui.rs @@ -6652,7 +6652,8 @@ fn render_footer_from( for item in items { let chip = match *item { S::ContextPercent => footer_context_percent_spans(app), - S::GitBranch | S::LastToolElapsed | S::RateLimit => Vec::new(), + S::GitBranch => footer_git_branch_spans(app), + S::LastToolElapsed | S::RateLimit => Vec::new(), _ => continue, }; if chip.is_empty() { @@ -6696,6 +6697,17 @@ fn footer_context_percent_spans(app: &App) -> Vec> { )] } +fn footer_git_branch_spans(app: &App) -> Vec> { + let workspace = app.workspace.as_path(); + let Some(branch) = workspace_git_branch(workspace) else { + return Vec::new(); + }; + vec![Span::styled( + format!("git:{branch}"), + Style::default().fg(app.ui_theme.text_muted), + )] +} + fn footer_cost_spans(app: &App) -> Vec> { let displayed_cost = app.displayed_session_cost_for_currency(app.cost_currency); if !should_show_footer_cost(displayed_cost) {