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: Fixes #10236: Fix note disappears while editing during search #10568

Conversation

personalizedrefrigerator
Copy link
Collaborator

Summary

This pull request fixes a bug in the updated logic for NOTE_UPDATE_ONE introduced in d63615b.

Prior to d63615b, a note was considered "in the same folder" if it had the same parent_id. With the introduction of a virtual trash folder, a note's parent_id property might not be its displayed parent folder.1 When the trash folder is selected, restoring a folder doesn't change its parent_id, but does change its displayed parent ID. The UI should show that a restored item is no longer in the trash folder. d63615b handled this by checking whether the note was still displayed in selectedFolderId. This, however, was problematic when a search or tag, rather than a folder, was selected.

Rather than comparing the new display parent ID with selectedFolderId, this pull request compares the old display parent ID with the new display parent ID.

Fixes #10388.
Fixes #10236.

Testing

This pull request includes an automated regression test. However, for now, it doesn't verify that 1) restoring from trash still works and 2) editing a note after selecting a tag still works. These have been tested manually by:

  1. Opening a notebook.
  2. Selecting a tag.
  3. Selecting a note not in the notebook selected in step 1.
  4. Editing the note.
  5. Verifying that the note doesn't disappear.
  6. Sort by "updated date" with most recent first.
  7. Edit a different note.
  8. Verify that it is moved to the top of the note list.
  9. Delete a note.
  10. Open the trash folder and restore the note.
  11. Verify that the note disappears from the trash.

Footnotes

  1. Previously, this was also the case for conflicts. However, those are handled differently.

@laurent22 laurent22 merged commit 7d0cc67 into laurent22:dev Jun 12, 2024
10 checks passed
@Julrob199 Julrob199 mentioned this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants