Hi, itâs easily reproducible on my system (Ubuntu), see previous animated gif.
The problem resolves when I reapply âAll Notesâ.
ie: whenever I see no notes, I re-select âAll notesâ, then I see the notes again.
Iâm guessing you have a âcurrently selectedâ variable which is supposed to default to âAll notesâ, but in some cases getâs set to null instead.
So, if you can make sure that the currently selected node in the note tree can never be null, but instead âAll notesâ instead of null, then the problem will be fixed.
The odd thing is that I never select anything else, ever, Iâm always on âAll Notesâ.
Iâm a bit confused, but could you exactly explain how you did it step by step?
Yes, But did you search notes when nothing being selected?
The app remembers the last opened note with the note list state.
Because it assumes that you always start searching when you are seeing some notes on the list with a selection.
If you were viewing an empty notebook, it could happen though.
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.
So, either
when opening the app there should be no notes until you explicitly click All Notes
(bad solution).
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?
Thatâs weird. In the latest version, it should restore the last editing state.
I mean, it should reopen the last editing note.
What does your config look like in config.cson which is stored in here?
It should be like:
When you quit the app, it saves the editing note ID.
Nothing selected means that the app is failing to restore it or the config doesnât have core. lastNavigationState .editingNoteId.
Clearing the search bar restores back to the last editing state (editing note, sidebar, and note list query).
But if there is no state to go back, it shows nothing as you get.
Thatâs the main cause of the problem, but I donât understand that you get no selections on the app launch.
Itâs easy to change that to show all notes though, Iâd like to clarify it.
It might be a race condition or something.
Just happened again, here is a screenshot.
On the left is the config.cson
On the right you can see that the notes have disappeared.
Comments:
a) editingNoteId is not blank.
b) searchKeyword is âdockerâ yet Iâve not typed in that search term for several days!
Did you get the blank editor (not opened anything) when launched the app?
With editingNoteId has a value, does the app open the last editing note when launched or not?
The core.lastNavigationState is saved only when you quit the app.
Looks like editingNoteId hasnât changed since the last report.
When you quit it, does the config value get updated?
I still donât understand whatâs exactly going wrong.
See attached animated gif.
On the left in the config file open in VSCode.
On the right is Inkdrop.
When I open / close notebooks, the config file behaves correctly.
When I edit a note, editingNoteId does not change at, not even if I save the note.
Looks like core.lastNavigationState is saved sometimes, other times not.
I think the problem occurs in this state:
a) All Notebooks selected
b) close Inkdrop, open again, and create/edit/delete notes without clicking on any notebooks, ie: using the All notebooks state from the previous session.
c) Close and Open Indrop again, also not clicking on any notebooks, so now the state is also All Notebooks, but it wasnât persisted into the 3rd session.
Thanks for letting me know.
The config value is not saved sometimes. I guess thatâs because there is no difference from the previous session because you did nothing.
At the step c), what state did you get in the 3rd session? All Notebooks is not selected? No note is opened? If so, what does core.lastNavigationState look like?
Also, I want you to answer those remained questions:
I have to clarify the condition that the app doesnât open anything when launched.