kanriapp / kanri

🪐 Modern offline Kanban board app for Windows, MacOS and Linux. Built with simplicity and user experience in mind.
https://kanriapp.com
GNU General Public License v3.0
745 stars 61 forks source link

Cant/shouldnt edit cards while search text is filtering view #712

Open MoonRubles opened 1 week ago

MoonRubles commented 1 week ago

Describe the bug

If you enter text into the "search for cards..." box, and then click on a card to edit it, the wrong card will be edited. Worse, if you delete a card while filtering, the wrong card will be deleted irreversibly.

To Reproduce Make 2 cards in a column named "1" and "2" Search for "2". you will see only the "2" card. Right click and delete. It will say "are you sure you want to delete card '1'?". If you proceed, it will delete 1 instead of 2. So it seems to be using the filtered index of the card in the nonfiltered list.

Now instead of trying to delete card 2, edit it instead. Click on card 2 to open the edit box, which correctly has the title "2". Change this to "3" and close. You will see only card "2" in the filtered view. Remove the search text. Now you will see cards "3" and "2". So it edited the wrong card (probably index problem again), but surprisingly this time it opened the correct card to edit -- it said "2"

trobonox commented 1 week ago

Thanks for reporting this issue. This is very likely a leftover where I use the index of a card to mutate it instead of the ID. I have been using the ID in some places, but it seems like I need to replace indexes completely in order to resolve these issues.