Goal 3: Re-ordering the list
Where we are now
When you tick a todo item, it gets saved and crossed out straight away. But it stays where it is in the list, mixed in with the items you still need to do.
User story
As a user, when I tick off a todo item, it should move to the bottom of the list. When I un-tick it, it should move back up with the other unfinished items. This way I can focus on what still needs to be done.
Technically speaking
The server needs to sort the todo items so the unfinished ones come first. When the user clicks a checkbox, one item changing can move every item, so the server needs to send back the whole re-rendered list, not just one item. Then HTMX swaps the new list into the page in place of the old one.