Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: Maintain selection when non-selected note is deleted #2290

Merged
merged 4 commits into from
Jan 18, 2020

Conversation

miciasto
Copy link
Contributor

@miciasto miciasto commented Jan 11, 2020

Issue
The issue was raised here: forum thread

The issue is that in the note list, when a note is selected and another is deleted, the selection is changed.

In my opinion, it should not. The selection should only change if the selected note/s is deleted.

Solution
The change is implemented by adjusting the logic in the reducer's handleItemDelete. As a result, this change addresses the same issue that exists for notes, notebooks and tags.

Testing
No unit tests existed for the reducer so new unit tests are created here. These unit tests only cover the functionality affected by this change. Manual testing was done on the desktop client.

Alternative solution
An alternative solution would be to change the behaviour of the right-click action so that right-clicking on a note selects it (in addition to the usual function of displaying the context menu).

@laurent22
Copy link
Owner

Makes complete sense and works as expected. Thanks for the fix @mic704b! And also thanks for adding all these tests as it's true the reducer wasn't tested at all before, so this is definitely going to improve code quality.

@laurent22 laurent22 merged commit 65cbb6e into laurent22:master Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants