huskies: merge 1042
This commit is contained in:
@@ -5,9 +5,6 @@ use crate::config::ProjectConfig;
|
||||
use crate::pipeline_state::{ArchiveReason, PipelineItem, Stage};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
||||
/// Maximum number of dirty file paths shown inline per story before truncating.
|
||||
const MAX_DIRTY_FILES_SHOWN: usize = 20;
|
||||
|
||||
/// Map a stage to its display section label, or `None` to skip it entirely.
|
||||
///
|
||||
/// This is the single source of truth for the "where does this item appear"
|
||||
@@ -218,9 +215,10 @@ pub(crate) fn build_status_from_items(
|
||||
out
|
||||
}
|
||||
|
||||
/// Render working tree summary lines for a story with uncommitted changes.
|
||||
/// Render the one-line working tree summary for a story with uncommitted changes.
|
||||
///
|
||||
/// Returns an empty string when the working tree is clean.
|
||||
/// 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 {
|
||||
if info.is_clean() {
|
||||
return String::new();
|
||||
@@ -230,16 +228,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"),
|
||||
};
|
||||
let mut out = format!(" Working tree: {summary} (uncommitted)\n");
|
||||
let shown = info.paths.len().min(MAX_DIRTY_FILES_SHOWN);
|
||||
for path in &info.paths[..shown] {
|
||||
out.push_str(&format!(" {path}\n"));
|
||||
}
|
||||
if info.paths.len() > MAX_DIRTY_FILES_SHOWN {
|
||||
let remaining = info.paths.len() - MAX_DIRTY_FILES_SHOWN;
|
||||
out.push_str(&format!(" ...and {remaining} more\n"));
|
||||
}
|
||||
out
|
||||
format!(" Working tree: {summary} (uncommitted)\n")
|
||||
}
|
||||
|
||||
/// Shared lookup tables passed to [`render_item_line`] to keep the argument count manageable.
|
||||
|
||||
@@ -1232,10 +1232,10 @@ fn status_shows_working_tree_info_when_coder_has_uncommitted_changes() {
|
||||
output.contains("(uncommitted)"),
|
||||
"working tree line should say '(uncommitted)': {output}"
|
||||
);
|
||||
// Should list the dirty files.
|
||||
// Overview must NOT list individual file paths — those belong in `status N`.
|
||||
assert!(
|
||||
output.contains("README.md") || output.contains("new_feature.rs"),
|
||||
"status should list at least one dirty file: {output}"
|
||||
!output.contains("README.md") && !output.contains("new_feature.rs"),
|
||||
"overview must not list individual dirty file paths: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1309,8 +1309,13 @@ fn status_dirty_files_capped_at_twenty_with_overflow_line() {
|
||||
let agents = AgentPool::new_test(3000);
|
||||
let output = build_status_from_items(project_root, &agents, &items);
|
||||
|
||||
// Overview shows only the summary line — no path listing, no overflow.
|
||||
assert!(
|
||||
output.contains("...and 5 more"),
|
||||
"overflow line should appear when more than 20 files: {output}"
|
||||
!output.contains("...and 5 more"),
|
||||
"overview must not show overflow line — paths belong in triage view: {output}"
|
||||
);
|
||||
assert!(
|
||||
output.contains("Working tree:") && output.contains("(uncommitted)"),
|
||||
"overview should still show the summary line when dirty: {output}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user