From 253fdc93cb3e79983de69e0875c69efa77660aac Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sun, 9 Nov 2025 09:32:39 -0500 Subject: Show epic progress count instead of Epic label and checkbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed epic display in tree view from: t-PpXWsU [Epic] [ ] Task Manager Improvements To: t-PpXWsU [6/11] Task Manager Improvements The [6/11] shows completed/total child tasks, giving immediate visual feedback on epic progress. Regular tasks still use checkbox indicators: [ ] open, [~] in-progress, [✓] done. --- Omni/Task/Core.hs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'Omni') diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index b322ea9..0351cf4 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -279,28 +279,30 @@ showTaskTree maybeId = do printTreeNode :: [Task] -> Task -> Int -> IO () printTreeNode allTasks task indent = do let prefix = T.pack (replicate (indent * 2) ' ') - -- Only show type label for epics - typeStr = case taskType task of - Epic -> "[Epic] " - WorkTask -> "" - statusStr = case taskStatus task of - Open -> "[ ]" - InProgress -> "[~]" - Done -> "[✓]" + children = filter (\t -> taskParent t == Just (taskId task)) allTasks + -- For epics, show progress count [completed/total]; for tasks, show status checkbox + statusStr = case taskType task of + Epic -> + let total = length children + completed = length <| filter (\t -> taskStatus t == Done) children + in "[" <> T.pack (show completed) <> "/" <> T.pack (show total) <> "]" + WorkTask -> case taskStatus task of + Open -> "[ ]" + InProgress -> "[~]" + Done -> "[✓]" nsStr = case taskNamespace task of Nothing -> "" Just ns -> "[" <> ns <> "] " -- Calculate available width for title (80 cols - prefix - id - labels) - usedWidth = T.length prefix + T.length (taskId task) + T.length typeStr + T.length statusStr + T.length nsStr + 2 + usedWidth = T.length prefix + T.length (taskId task) + T.length statusStr + T.length nsStr + 2 availableWidth = max 20 (80 - usedWidth) truncatedTitle = if T.length (taskTitle task) > availableWidth then T.take (availableWidth - 3) (taskTitle task) <> "..." else taskTitle task - putText <| prefix <> taskId task <> " " <> typeStr <> statusStr <> " " <> nsStr <> truncatedTitle + putText <| prefix <> taskId task <> " " <> statusStr <> " " <> nsStr <> truncatedTitle - -- Find and print children (tasks with this task as parent) - let children = filter (\t -> taskParent t == Just (taskId task)) allTasks + -- Print children traverse_ (\child -> printTreeNode allTasks child (indent + 1)) children -- Helper to print a task -- cgit v1.2.3