thombruce / toodles

✅ A super simple todo app
https://toodles.thombruce.com/
GNU General Public License v3.0
0 stars 0 forks source link

Add comments to todos #36

Closed thombruce closed 1 year ago

thombruce commented 1 year ago

Comments should work a lot like intervals and tallies already do. The user should be able to add comments to a list shown when they navigate to the todo. This list should sort the joined values of intervals, tallies, comments and whatever else by date.

Whatever else? Maybe the completion time of child todos if they are marked as completed. I envision the child todos as showing at the top of the page just under the parent (maybe collapsible so that the lower information can be made quickly visible), but there's no denying that if any one of them gets marked off before the completion of the parent that it is a part of the todo's history... which is what the list beneath the todo view is becoming; a chronological log of the todo's history.

The difficulty is that the todos are a separate thing altogether and don't have a dateOf value with an ISO-8601 date. That's something to think about. While we can cast values to dates and sort them that way, it would be quicker (especially at scale) to have a column that was sortable without type casting.

Intervals and tallies already have this (dateOf). Todos do not, and comments really don't need the ability those other items have to customise the comment date... but I guess that's what we're now considering.

Sorry, this is out of scope for the request of this issue, but... Clearly it would be of benefit for all items to have an easily comparable, arbitrary precision ISO-8601 attribute. At present, createdAt and updatedAt are integers (unnecessary ones, at that; Loki actually stores its own which we can look into how to access instead).

Alright... DO add comments to todos.

DO ALSO add an issue to create an arbitrary precision ISO-8601 attribute on any entities we think ought to be shown in a todos history (this includes the todo itself and is a relevant attribute on comments).

thombruce commented 1 year ago

https://github.com/thombruce/toodles/issues/33#issuecomment-1556517544

We want to add comments ahead of combining lists, but we will of course make sure an ISO-8601 value is present on comments at this stage. It will always be set to new Date() for comments initially, however. We'll then think about how we combine the three interfaces into a single component, whilst - I would hope - not sacrificing lean HTML and future a11y considerations.