feat: allow to delete the last note#174
Merged
naveensingh merged 13 commits intoFossifyOrg:mainfrom Jul 13, 2025
Merged
Conversation
naveensingh
requested changes
Jul 6, 2025
Member
naveensingh
left a comment
There was a problem hiding this comment.
The delete button should still be hidden for the default empty note that appears after all notes are deleted.
Ideally, there would be a placeholder when there are no notes, but this works too!
app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt
Outdated
Show resolved
Hide resolved
Contributor
Author
|
The wildcard imports are not from me, should we change this or let detekt fail? |
Member
|
See 73eacc5 :) |
Member
I still see it. We can use |
…ot the empty default one
naveensingh
requested changes
Jul 13, 2025
Member
naveensingh
left a comment
There was a problem hiding this comment.
When I delete all notes and restart the app once or twice, the Delete note option comes back. No text was added.
app/src/main/kotlin/org/fossify/notes/activities/MainActivity.kt
Outdated
Show resolved
Hide resolved
…en it wasn't and now is
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of change(s)
What changed and why
The menu now always proposes to delete the current note, even if it is the last note.
The function refreshNotes now accepts a null note, in which case it will select the current note as the item 0 of the mNotes list. This note was just created by NotesHelper when it saw that the note list was empty
Before/After Screenshots/Screen Record
On that screenshot, you can see that only one list exists and that the menu option is visible. This was the easy part to fix, but the rest cannot really be shown in a screenshot.

Fixes the following issue(s)
Checklist
CHANGELOG.md(if applicable).