format_loose_ends: align output text with rename (loose end(s) / no loose ends)

This commit is contained in:
damocles 2026-05-18 18:37:44 +02:00
parent 5c6c607e25
commit 59412452af

View file

@ -129,21 +129,22 @@ pub fn format_recv(resp: Result<SocketReply, anyhow::Error>) -> String {
}
/// Format helper for `get_loose_ends`: renders a short bulleted list
/// of pending approvals + questions. Empty list collapses to a clear
/// marker so claude doesn't go hunting for a payload that isn't there.
/// of pending approvals + questions + reminders. Empty list collapses
/// to a clear marker so claude doesn't go hunting for a payload that
/// isn't there.
pub fn format_loose_ends(resp: Result<SocketReply, anyhow::Error>) -> String {
use std::fmt::Write as _;
let threads = match resp {
let loose_ends = match resp {
Ok(SocketReply::LooseEnds(t)) => t,
Ok(SocketReply::Err(m)) => return format!("get_loose_ends failed: {m}"),
Ok(other) => return format!("get_loose_ends unexpected response: {other:?}"),
Err(e) => return format!("get_loose_ends transport error: {e:#}"),
};
if threads.is_empty() {
return "(no open threads)".to_owned();
if loose_ends.is_empty() {
return "(no loose ends)".to_owned();
}
let mut out = format!("{} open thread(s):\n", threads.len());
for t in &threads {
let mut out = format!("{} loose end(s):\n", loose_ends.len());
for t in &loose_ends {
match t {
hive_sh4re::LooseEnd::Approval {
id,