summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2025-11-09 09:25:40 -0500
committerBen Sima <ben@bsima.me>2025-11-09 09:25:40 -0500
commit9a1177a87b0c58168b2975705f1adf08f1a70251 (patch)
tree094d15f9bec19c97b33d42de1b0a0def0ed098e0
parentb2767b50b8a0d7987eef419709c8d5b467f8e33e (diff)
Move namespace label between status and title in tree view
Changed tree output format from: t-abc123 [ ] Task title [Omni/Task.hs] To: t-abc123 [ ] [Omni/Task.hs] Task title This makes the namespace more prominent and groups all metadata (status + namespace) together before the title.
-rw-r--r--Omni/Task/Core.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index ef60ead..b322ea9 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -289,15 +289,15 @@ showTaskTree maybeId = do
Done -> "[✓]"
nsStr = case taskNamespace task of
Nothing -> ""
- Just ns -> " [" <> ns <> "]"
+ 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 + 3
+ usedWidth = T.length prefix + T.length (taskId task) + T.length typeStr + 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 <> " " <> truncatedTitle <> nsStr
+ putText <| prefix <> taskId task <> " " <> typeStr <> statusStr <> " " <> nsStr <> truncatedTitle
-- Find and print children (tasks with this task as parent)
let children = filter (\t -> taskParent t == Just (taskId task)) allTasks