Repository navigation
Conversation
display_by_date sorted its group keys with a plain string compare. The
keys are display strings ("Wed Oct 21 2026", the %a %b %d %Y format items
are created with), so tb --timeline and tb --archive ordered days by
weekday name, then month name, despite the comment saying the order was
chronological. Wed Oct 21 came before Sat Jan 02 of the next year.
Parse each key with the same format and sort newest first. A key that
does not parse (hand-edited storage) sorts after every dated key, in the
descending string order it had before.
Ordering by the newest item timestamp in each group was the other option;
parsing keeps the order a property of the keys alone, so it does not
depend on what the group holds.
The order of items inside a group is a separate HashMap-order issue,
handled by taskbook-sh#66; this change touches only the order of the groups.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
alycda
marked this pull request as ready for review
November 8, 2026 04:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tb --timelineandtb --archivelist days out of order.Render::display_by_datesorts its group keys with a string compare, and the keys are display strings in the%a %b %d %Yformat items are created with ("Wed Oct 21 2026"). So days are ordered by weekday name, then month name:Wed Oct 21 2026is listed aboveSat Jan 02 2027. The comment above the sort says it is chronological; it is not.Change
dates_newest_firstinrender.rsparses each key with the same format (chrono::NaiveDate::parse_from_str) and sorts newest first.The TUI timeline already sorts by timestamp (
tui/app.rs), so this makes the CLI match it.Not in this PR
The order of items inside a date group comes from
HashMapiteration and changes between runs. #66 fixes that (ID order within board and date groups); this PR only touches the order of the groups, and the two don't conflict.🤖 Generated with Claude Code