From 33d9d402a55d4e42ee20be7f9aeab6762d486b6c Mon Sep 17 00:00:00 2001 From: xhon-pelushi Date: Wed, 12 Aug 2026 01:33:21 -0400 Subject: [PATCH] fix(categories): hide dot-prefixed folders from category list The Text editor creates hidden ".attachments." folders alongside notes to store inline images. gatherNoteFiles() treated every subfolder as a user category, so these implementation-detail folders showed up as empty categories in the sidebar and reappeared after being deleted. Skip folders whose name starts with "." when walking the notes tree. Fixes #1866 Signed-off-by: xhon-pelushi --- lib/Service/NotesService.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Service/NotesService.php b/lib/Service/NotesService.php index 644b61f0c..f2c042c7c 100644 --- a/lib/Service/NotesService.php +++ b/lib/Service/NotesService.php @@ -250,6 +250,12 @@ private static function gatherNoteFiles( $nodes = $folder->getDirectoryListing(); foreach ($nodes as $node) { if ($node->getType() === FileInfo::TYPE_FOLDER && $node instanceof Folder) { + // hidden folders (e.g. the ".attachments." folders the Text + // editor creates for inline images) are not user-created + // categories and must not show up as such + if (str_starts_with($node->getName(), '.')) { + continue; + } $subCategory = $categoryPrefix . $node->getName(); $data['categories'][] = $subCategory; $data_sub = self::gatherNoteFiles($customExtension, $node, $subCategory . '/');