Conversation
The visibility check compared the selected category against only the first segment of the note's category, so an open note was hidden whenever the selected category was itself nested — for example after renaming a category into a nested path. Match the note against the selected category and its descendants, as the notes store already does when filtering. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: ppardi <6176270+ppardi@users.noreply.github.com>
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.
When a note is selected, the current code's visibility check only compared the category the user selected with the first segment of the note's category (if the category is
Work/Clients, the check would only compare againstWork). The current navigation only shows top-level categories (Work) so the comparison holds under normal circumstances and the bug doesn't manifest.But if the category gets nested due to a rename (if the user renames the
Workcategory toPersonal/Workfor example), the note visible in the pane will be hidden because the note's category was moved toPersonal/Work. But therootCategory()function reduces the note's category to justPersonal. This no longer matches so the note is seen to be outside its own category.This fix matches the note against the category the user selected and its descendants. This already is being done by the store when the note list is filtered by the selected category.
I was able to reproduce this on a live NextCloud 35 instance. I watched the note disappear when I renamed a category and made it nested.
Also 87 unit tests passed and ESLint reports no new problems. The new cases cover: exact match, descendants, nested exact match (the regression), the
WorkshopvsWorkprefix trap, null selection, and Uncategorized.This change was developed with AI assistance (Claude Code). I reviewed the diff and verified the reproduction and the fix myself on a live instance.