diff --git a/server/src/chat/commands/status/render.rs b/server/src/chat/commands/status/render.rs index 80f5486b..b7f46fa4 100644 --- a/server/src/chat/commands/status/render.rs +++ b/server/src/chat/commands/status/render.rs @@ -215,11 +215,12 @@ pub(crate) fn build_status_from_items( out } -/// Render the one-line working tree summary for a story with uncommitted changes. +/// Return an inline working-tree suffix for a story with uncommitted changes. /// -/// Returns an empty string when the working tree is clean. File paths are not -/// listed here; use `status N` (triage) for the per-file breakdown. -fn render_working_tree_lines(info: &crate::service::git_ops::DirtyFiles) -> String { +/// Returns an empty string when the working tree is clean. The suffix is +/// appended directly to the coder line, e.g. `, Working tree: 3 modified (uncommitted)`. +/// File paths are not listed here; use `status N` (triage) for the per-file breakdown. +fn working_tree_suffix(info: &crate::service::git_ops::DirtyFiles) -> String { if info.is_clean() { return String::new(); } @@ -228,7 +229,7 @@ fn render_working_tree_lines(info: &crate::service::git_ops::DirtyFiles) -> Stri (0, n) => format!("{n} new"), (m, n) => format!("{m} modified, {n} new"), }; - format!(" Working tree: {summary} (uncommitted)\n") + format!(", Working tree: {summary} (uncommitted)") } /// Shared lookup tables passed to [`render_item_line`] to keep the argument count manageable. @@ -378,9 +379,9 @@ fn render_item_line( .and_then(|a| a.throttled) .is_some_and(|until| until > chrono::Utc::now()); let dot = super::traffic_light_dot(blocked, throttled, agent.is_some()); - let wt_lines = dirty_files_by_story + let wt_suffix = dirty_files_by_story .get(story_id) - .map(render_working_tree_lines) + .map(working_tree_suffix) .unwrap_or_default(); if let Some(agent) = agent { let model_str = config @@ -389,10 +390,10 @@ fn render_item_line( .and_then(|ac| ac.model.as_ref().map(|m| m.as_str())) .unwrap_or("?"); format!( - " {dot}{display}{cost_suffix}{dep_suffix} — {} ({model_str})\n{wt_lines}", + " {dot}{display}{cost_suffix}{dep_suffix} — {} ({model_str}){wt_suffix}\n", agent.agent_name ) } else { - format!(" {dot}{display}{cost_suffix}{dep_suffix}\n{wt_lines}") + format!(" {dot}{display}{cost_suffix}{dep_suffix}{wt_suffix}\n") } }