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

Delete note if the content is completely removed #1216

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

charliescheer
Copy link
Contributor

Fix

In issue #1064 it was brought up that if a note is empty we leave it in the note list and it would be nice if they deleted themselves. I thought about this for a bit and decided that I agreed, but I wanted to make sure that we only moved the notes to the trash, that way the history for the note still exists and a user could reclaim the lost content if they wanted. So in this PR I have done that.

iOS already deleted new notes that were empty, so it made sense to me that we should have the same behavior in SNMac, and that we should update it to also delete notes that have become empty, not just new notes.

fixes #1064

Test

Confirm new notes with content are not deleted

  1. Create a new note and add some content to it
  2. Close the editor
  • Confirm your new note continues to exist
  • Relaunch the app and confirm your new note was saved to the DB

Confirm new notes without content are deleted

  1. Create a new note, do not add content to it
  2. Close the editor
  • Confirm that your new note was deleted

Confirm an existing note that has all it's content removed, will be deleted

  1. Go to a note you don't mind losing.
  2. Delete all of the text content in the note
  3. Exit the editor.
  • Confirm that your note is deleted from the notes list
  1. Go to the note trash, find the top note labeled "New Note..." restore it
  2. Go to the regular notes list, open the note you restored, go to the notes history
  • Confirm you can restore that notes history

Review

(Required) Add instructions for reviewers. For example:

Only one developer is required to review these changes, but anyone can perform the review.

Release

(Required) Add a concise statement to RELEASE-NOTES.txt if the changes should be included in release notes. Include details about updating the notes in this section. For example:

These changes do not require release notes.

@charliescheer charliescheer added [feature] editor Anything related to the editor. [feature] note list Anything related to the note list. labels Oct 19, 2024
@charliescheer charliescheer added this to the Future milestone Oct 19, 2024
@charliescheer charliescheer self-assigned this Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[feature] editor Anything related to the editor. [feature] note list Anything related to the note list.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically delete a note when it's content is empty
1 participant