feat(ui): add enhanced user popover + rearrange sidebar (#1246)

Co-authored-by: brios <127139797+balazs-szucs@users.noreply.github.com>
This commit is contained in:
Alex
2026-05-10 14:23:55 +01:00
committed by GitHub
co-authored by brios
parent 868e8e6262
commit 1042cad74a
12 changed files with 579 additions and 140 deletions
@@ -6,7 +6,7 @@ import { LibraryShelfMenuService } from '../../../features/book/service/library-
import { SortPref } from '../sidebar-sort-preferences';
import { SidebarLeaf, SidebarSection } from '../navigation/nav-item.model';
import { buildHomeNavItems } from '../navigation/nav-catalog';
import { buildHomeNavItems, findPageNavItem, ShellNavPermissions } from '../navigation/nav-catalog';
export interface HomeCounts {
allBooks: number;
@@ -60,6 +60,27 @@ export function buildHomeSection(translate: TranslateFn, counts: HomeCounts): Si
}];
}
export function buildToolsSection(
translate: TranslateFn,
permissions: ShellNavPermissions,
): SidebarSection[] {
const items = [
findPageNavItem('libraryStats', translate, permissions),
findPageNavItem('metadataManager', translate, permissions),
findPageNavItem('bookdrop', translate, permissions),
].filter((item): item is SidebarLeaf => !!item);
if (items.length === 0) return [];
return [{
id: 'tools',
menuKey: 'tools',
label: translate('layout.menu.tools'),
expandable: true,
items,
}];
}
function homeItemBookCount(itemId: string, counts: HomeCounts): number | undefined {
switch (itemId) {
case 'allBooks': return counts.allBooks;