diff --git a/crates/maestro-tui/src/sidebar.rs b/crates/maestro-tui/src/sidebar.rs index a773a99..1dc702f 100644 --- a/crates/maestro-tui/src/sidebar.rs +++ b/crates/maestro-tui/src/sidebar.rs @@ -259,7 +259,7 @@ impl Sidebar { pad_to_width(spans, width, base) } - /// The adaptive second line: `[] [] [ | exited] `, + /// The adaptive second line: `[] [] [ | exited]`, /// led by the activity rail (docs/SIDEBAR.md). fn meta_row(&self, s: &Session, width: usize, focused: bool) -> Vec> { let now = Utc::now(); @@ -329,8 +329,8 @@ impl Sidebar { budget, )); } - spans.extend(tail); spans.extend(fit_to_width(vec![command], command_w)); + spans.extend(tail); spans } } @@ -927,9 +927,11 @@ mod tests { let all = rows(&draw(&sb, 28, 8)); let idx = all.iter().position(|l| l.contains("claude")).unwrap(); let meta = content(&all[idx + 1]); + let ellipsis = meta.find('…').expect("truncated command must contain …"); + let tail = meta.find("~120").expect("diff stat must survive: {meta:?}"); assert!( - meta.trim_end().ends_with('…'), - "truncated command must end with …: {meta:?}" + ellipsis < tail, + "command must truncate before the diff stat: {meta:?}" ); assert!( content(&all[idx + 2]).trim().is_empty(), @@ -1131,7 +1133,7 @@ mod tests { } #[test] - fn blocked_warning_survives_before_a_truncated_command() { + fn blocked_warning_survives_after_a_truncated_command() { let mut s = session_named(1, "name"); s.command = "a-program-name-that-cannot-fit".into(); s.blocked_work = Some(InTheWay { @@ -1146,7 +1148,12 @@ mod tests { let all = rows(&draw(&sb, 29, 6)); assert!(all[3].contains("~1"), "{:?}", all[3]); let meta = content(&all[3]); - assert!(meta.ends_with('…'), "command must truncate: {meta:?}"); + let ellipsis = meta.find('…').expect("command must truncate"); + let tail = meta.find("~1").unwrap(); + assert!( + ellipsis < tail, + "diff stat must follow the truncated command: {meta:?}" + ); } #[test] diff --git a/docs/SIDEBAR.md b/docs/SIDEBAR.md index b3ee4ad..dfbd3be 100644 --- a/docs/SIDEBAR.md +++ b/docs/SIDEBAR.md @@ -37,7 +37,7 @@ itself is not. Line 2 reads left to right: ``` -[] [] [ | exited] +[] [] [ | exited] ``` Its minimum content is therefore just the command. @@ -83,7 +83,7 @@ fragment; it no longer decides whether line 2 exists. while an agent-reported state is in force (see Precedence): when the report lapses at its TTL or is replaced, the detail goes with it. The detail truncates with `…` ahead of the trailing fragments — a long detail never -pushes ``, `exited`, or `` off the line, and neither +pushes ``, ``, or `exited` off the line, and neither client ever lets it wrap. `` is the blocked-work breakdown (#83) in diff notation, replacing diff --git a/web/src/catalog.ts b/web/src/catalog.ts index 0a0a77c..6a041d9 100644 --- a/web/src/catalog.ts +++ b/web/src/catalog.ts @@ -90,9 +90,9 @@ function metaLine(s: Session, now: number): string { s.activity_detail ? `${escapeHtml(s.activity_detail)}` : "", + commandFragment(s.command), blockers ? blockedFragment(blockers) : "", dead ? `exited` : "", - commandFragment(s.command), ]; return `${fragments.join("")}`; }