Problem occurs often:
- I open the app, with nothing selected and I see all the notes
- I search for something, then I clear the search bar.
- all notes disappear.
- I click “All Notes” and I see all the notes.
Yes, But did you search notes when nothing being selected?
Correct, nothing selected, but initially I see all the notes.
The state changes seem to be these:
a) open the app and “All Notes” is implicitly selected.
b) search then clear the search bar, then no notes are seen.
c) explicitly click All Notes and all the notes are there.
- when opening the app there should be no notes until you explicitly click All Notes
- when opening the app it should remember the previous selection and reapply that selection when you clear the search bar.
Do you follow?
Essentially in some states the app implicitly selects all the notes, but in other states it implicitly selects no notes at all.
So, the question is really: what selection should the app implicitly select if there is no explicit selection?
I would suggest that the rule should be:
- show the last selected notebook.
- if there is no selected notebook, or if the selected notebook has been deleted by another instance, then set selected notebook to All Notes.
Pretty clear to me that you’re not catching the situation where no notebook was explicitly selected.
Take at look at your logic regarding clearing the search bar.
What does it do if there is no notebook selected?