Checklist are not working correctly #1880

Closed
opened 2021-11-30 08:31:52 +00:00 by keeper · 8 comments

On try:

https://i.imgur.com/mgx6ImD.gif

On try: ![https://i.imgur.com/mgx6ImD.gif](https://i.imgur.com/mgx6ImD.gif)
konrad added the
kind/bug
label 2021-11-30 20:28:46 +00:00
Owner

@dpschen Another editor bug to add to the list...

@dpschen Another editor bug to add to the list...
Owner

Fixed in bba9a8e008 - please check if it fixes your error with a new unstable build or on try once the CI released it, in ~30 min.

Fixed in https://kolaente.dev/vikunja/frontend/commit/bba9a8e0080d78c7ee6134d7940083a355a03295 - please check if it fixes your error with a new unstable build or on try once the CI released it, in ~30 min.
Member

@konrad Unsure:

Shouldn't it be sort((a, b) => b - a) so that the result can also be 0 => same list position (might also be a - b, I always have to test those two :D )

Even after that: I think the problem will still exist for list entries with identical names. The reason: the original order is destroyed when we extract them in two arrays (checked and unchecked) and it is impossible to regain the original order by sorting them again. But maybe I have some wrong understanding of what is actually happening.

@konrad Unsure: Shouldn't it be `sort((a, b) => b - a)` so that the result can also be `0` => same list position (might also be `a - b`, I always have to test those two :D ) Even after that: I think the problem will still exist for list entries with identical names. The reason: the original order is destroyed when we extract them in two arrays (checked and unchecked) and it is impossible to regain the original order by sorting them again. But maybe I have some wrong understanding of what is actually happening.
Owner

@dpschen actually, the case you're describing can never happen. That's because the function returns the character index in the text that has a checkbox. Two checkboxes can never be on the same index in the text. That's why sorting them from the lowest to the highest index is the way to fix this issue because then recording "click on the 2nd checkbox" only requires one array lookup to get the position of that checkbox in the text. But the array has to be sorted correctly for that.

@dpschen actually, the case you're describing can never happen. That's because the function returns the character index in the text that has a checkbox. Two checkboxes can never be on the same index in the text. That's why sorting them from the lowest to the highest index is the way to fix this issue because then recording "click on the 2nd checkbox" only requires one array lookup to get the position of that checkbox in the text. But the array has to be sorted correctly for that.
Owner

I mean, it should work, feel free to check it if you have an idea how to break it 🙂

I mean, it should work, feel free to check it if you have an idea how to break it 🙂

Ehm this might be obvious but how do I add a checklist to a task? Or what do you mean here about checklist? Thanks!

Ehm this might be obvious but how do I add a checklist to a task? Or what do you mean here about checklist? Thanks!
Member

@vitobotta:

the task description supports markdown. So you can create a checklist by adding e.g. to the description:

- [ ] Item 1
- [ ] Item 2
- [x] Item 3

@vitobotta: the task description supports markdown. So you can create a checklist by adding e.g. to the description: ```md - [ ] Item 1 - [ ] Item 2 - [x] Item 3 ```

That's awesome, thanks a lot!

That's awesome, thanks a lot!
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/vikunja#1880
No description provided.