diff --git a/apps/web/src/components/note/index.tsx b/apps/web/src/components/note/index.tsx index 14b009031..e60c8c64c 100644 --- a/apps/web/src/components/note/index.tsx +++ b/apps/web/src/components/note/index.tsx @@ -566,18 +566,24 @@ function colorsToMenuItems( type: "lazy-loader", async items() { const colors = await db.colors.all.items(); - return colors.map((color) => { - const isChecked = !!noteColor && noteColor.id === color.id; - return { - type: "button", - key: color.id, - title: color.title, - icon: Circle.path, - styles: { icon: { color: color.colorCode } }, - isChecked, - onClick: () => store.setColor(color.id, isChecked, ...ids) - } satisfies MenuItem; - }); + const menuItems: MenuItem[] = []; + if (colors.length > 0) + menuItems.push({ type: "separator", key: "sep" }); + menuItems.push( + ...colors.map((color) => { + const isChecked = !!noteColor && noteColor.id === color.id; + return { + type: "button", + key: color.id, + title: color.title, + icon: Circle.path, + styles: { icon: { color: color.colorCode } }, + isChecked, + onClick: () => store.setColor(color.id, isChecked, ...ids) + } satisfies MenuItem; + }) + ); + return menuItems; } } ]; @@ -611,22 +617,20 @@ function notebooksMenuItems(ids: string[]): MenuItem[] { const menuItems: MenuItem[] = []; if (notebooks.size > 0) - menuItems.push( - { - type: "button", - key: "remove-from-all-notebooks", - title: "Unlink from all", - icon: RemoveShortcutLink.path, - onClick: async () => { - await db.notes.removeFromAllNotebooks(...ids); - store.refresh(); - } - }, - { key: "sep", type: "separator" } - ); + menuItems.push({ + type: "button", + key: "remove-from-all-notebooks", + title: "Unlink from all", + icon: RemoveShortcutLink.path, + onClick: async () => { + await db.notes.removeFromAllNotebooks(...ids); + store.refresh(); + } + }); + + menuItems.push({ key: "sep3", type: "separator" }); if (notebookShortcuts.size > 0) { - menuItems.push({ key: "sep3", type: "separator" }); notebookShortcuts.forEach((notebook) => { menuItems.push({ type: "button", diff --git a/apps/web/src/components/sub-notebook/index.tsx b/apps/web/src/components/sub-notebook/index.tsx index bff1dbfa5..a5f506133 100644 --- a/apps/web/src/components/sub-notebook/index.tsx +++ b/apps/web/src/components/sub-notebook/index.tsx @@ -129,11 +129,7 @@ function SubNotebook(props: SubNotebookProps) { menuItems={subNotebookMenuItems} context={{ refresh }} sx={{ - paddingLeft: isExpandable - ? `${depth * 5}px` - : depth === 0 - ? 2 - : `${depth * 10}px` + paddingLeft: depth === 0 ? 0 : `${16 * depth}px` }} /> ); diff --git a/apps/web/src/views/notebook.tsx b/apps/web/src/views/notebook.tsx index 2bbcfc8b1..d6ff486d6 100644 --- a/apps/web/src/views/notebook.tsx +++ b/apps/web/src/views/notebook.tsx @@ -227,7 +227,14 @@ function SubNotebooks({ if (!rootId) return null; return ( - + ) { {title} )} - + {children} {/* {children} */} diff --git a/packages/ui/src/components/menu/menu-separator.tsx b/packages/ui/src/components/menu/menu-separator.tsx index 6c7de6c64..6e65ab3f1 100644 --- a/packages/ui/src/components/menu/menu-separator.tsx +++ b/packages/ui/src/components/menu/menu-separator.tsx @@ -24,7 +24,8 @@ export function MenuSeparator() {