Closed
Conversation
kostmo
approved these changes
Feb 21, 2026
| objList = intercalate [Spacer] $ map f $ M.toList categorizedObjs | ||
| f (h, xs) = Header h : map (Goal h) (NE.toList xs) | ||
| categoryDisplayOrder :: [GoalStatus] | ||
| categoryDisplayOrder = [Active, Upcoming, Completed, Failed] |
Member
There was a problem hiding this comment.
Would prefer that we had the protection of exhaustiveness checking.
What about a manual implementation of Ord? Then the docstring of that instance could explain the purpose, and additions to the enum would not silently break the display order.
Personally I'd be fine with option 1 plus a docstring.
Member
Author
There was a problem hiding this comment.
Hmm, good point. Yes, a manual implementation of Ord is a good idea too, I didn't think of that.
Member
Author
There was a problem hiding this comment.
But maybe you're right, option 1 is fine as long as we carefully document what is going on, especially since that's the only place we use that particular data type.
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.
Closes #1169, by implementing the second idea I listed there: fix an order in which to display goal categories and update the display code so it explicitly uses that order, rather than implicitly relying on the order in which the
GoalStatusconstructors were declared. The downside is that if we were to ever add a new type ofGoalStatuswe would need to manually update that list in order to display those goals. However, if someone adds a new goal type it should be obvious if those goals are not being displayed.To see the difference, try first running
and note that the first highlighted goal is "Upcoming":

Then, after applying this patch, run the same command; the first highlighted goal is now one of the "Active" ones:
