feat(sidebar): show empty folders and create folders from the sidebar (#999)

Empty folders (tracked in the scan-recorded all_folders list, same source
the move/download destination picker uses) can now be surfaced in the
folder sidebar via a view-options toggle, dimmed when their subtree holds
no models. Folders can be created directly from the sidebar through a new
POST /api/lm/{prefix}/create-folder endpoint with library-root
containment checks; the scanner records the new directory incrementally
so the tree reflects it without a rescan.

The sidebar header moves its view toggles (tree/list, recursive, empty
folders) into a "..." menu to fit the new create-folder button.
This commit is contained in:
Will Miao
2026-09-15 15:14:56 +08:00
parent 2ceb1e2850
commit 9734df15b4
24 changed files with 1260 additions and 173 deletions
+15 -6
View File
@@ -1246,15 +1246,23 @@
"sidebar": {
"modelRoot": "שורש",
"collapseAll": "כווץ את כל התיקיות",
"collapseAllDisabled": "[TODO: Translate] Not available in list view",
"hideOnThisPage": "הסתר סרגל צד בדף זה",
"showSidebar": "הצג סרגל צד",
"sidebarHiddenNotification": "סרגל הצד מוסתר בדף {page}",
"switchToListView": "עבור לתצוגת רשימה",
"switchToTreeView": "תצוגת עץ",
"viewOptions": "[TODO: Translate] View options",
"treeView": "[TODO: Translate] Tree view",
"listView": "[TODO: Translate] List view",
"recursiveOn": "כלול תיקיות משנה",
"recursiveOff": "רק התיקייה הנוכחית",
"recursiveUnavailable": "חיפוש רקורסיבי זמין רק בתצוגת עץ",
"collapseAllDisabled": "לא זמין בתצוגת רשימה",
"createFolder": "[TODO: Translate] New folder",
"newSubfolder": "[TODO: Translate] New subfolder",
"showEmptyFolders": "[TODO: Translate] Show empty folders",
"createFolderResult": {
"success": "[TODO: Translate] Folder \"{name}\" created",
"failed": "[TODO: Translate] Failed to create folder: {message}",
"unsupported": "[TODO: Translate] Folder creation is not supported on this page",
"noRoot": "[TODO: Translate] No model root is configured"
},
"dragDrop": {
"unableToResolveRoot": "לא ניתן לקבוע את נתיב היעד להעברה.",
"moveUnsupported": "העברה אינה נתמכת עבור פריט זה.",
@@ -1267,7 +1275,8 @@
},
"empty": {
"noFolders": "לא נמצאו תיקיות",
"dragHint": "גרור פריטים לכאן כדי ליצור תיקיות"
"dragHint": "גרור פריטים לכאן כדי ליצור תיקיות",
"createHint": "[TODO: Translate] Click the New Folder button above, or drag items here to create folders"
},
"folderUpdateCheck": {
"label": "בדוק עדכונים בתיקייה זו",