From 53e1ea9766630bb181d1b10b64260eb1b0d30988 Mon Sep 17 00:00:00 2001 From: "Dhanji R. Prasanna" Date: Tue, 20 Jan 2026 22:24:13 +0530 Subject: [PATCH] Strikethrough completed TODO items in todo_read/todo_write output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completed items (- [x]) now display with strikethrough text: ■ ~~Write tests~~ Incomplete items remain unchanged: □ Implement feature --- crates/g3-cli/src/ui_writer_impl.rs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/crates/g3-cli/src/ui_writer_impl.rs b/crates/g3-cli/src/ui_writer_impl.rs index b252e0b..25d84d2 100644 --- a/crates/g3-cli/src/ui_writer_impl.rs +++ b/crates/g3-cli/src/ui_writer_impl.rs @@ -623,12 +623,20 @@ impl UiWriter for ConsoleUiWriter { let is_last = i == last_idx; let prefix = if is_last { "└" } else { "│" }; - // Convert checkboxes to styled symbols - let styled_line = line - .replace("- [x]", "■") - .replace("- [X]", "■") - .replace("- [ ]", "□"); - + // Convert checkboxes to styled symbols and strikethrough completed items + let is_completed = line.contains("- [x]") || line.contains("- [X]"); + let styled_line = if is_completed { + // Replace checkbox and apply strikethrough to the task text + let task_text = line + .replace("- [x]", "") + .replace("- [X]", "") + .trim_start() + .to_string(); + format!("■ \x1b[9m{}\x1b[0m\x1b[2m", task_text) // \x1b[9m is strikethrough + } else { + line.replace("- [ ]", "□") + }; + // Dim the line content println!(" \x1b[2m{} {}\x1b[0m", prefix, styled_line); }