-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Problem
The current output of todo list
is not column-aligned, making it harder to scan visually — especially when working with long lists or variable-width fields like:
- Task ID
- Priority (
!
,!!
, etc.) - Date/time (particularly when
humanize
is enabled)
Example (content hidden for clarity):
[ ] 9 ! 2025-04-23 ...
[ ] 16 !! 2025-04-25 ...
[ ] 4 ! 2025-04-23 ...
Misaligned fields make it more difficult to quickly compare tasks.
Goal
Make the output easier to read by aligning the key fields: ID, priority, and date/time.
Proposed Solutions
Option 1: Fully automatic alignment
- How: Read all rows first to determine the max width of each field before formatting output.
- Pros: Cleanest and most flexible — adapts perfectly to the actual data.
- Cons: Requires two passes — one to measure, one to render. However, this overhead is negligible in practice, as we're already assuming the data set is small enough to fit in
stdout
.
Option 2: Field-specific width estimation (no full scan)
- How: Avoid reading all lines by estimating widths per field:
- ID: Only need the max task ID.
- Priority: Assume a max width (e.g. 3 chars:
!!!
). - Datetime: The width of formatted or humanized datetime can be calculated from the format string.
- Pros: Single-pass output, more efficient.
- Cons: Slight risk of over/under-aligning in edge cases (e.g. if importance ever exceeds assumed width).
I’m happy to help implement this if there's interest in improving the task list formatting.
Metadata
Metadata
Assignees
Labels
No labels