diff --git a/web/components/sidebar.tsx b/web/components/sidebar.tsx index d3614fd..c320807 100644 --- a/web/components/sidebar.tsx +++ b/web/components/sidebar.tsx @@ -155,12 +155,13 @@ export function Sidebar({ open, mobileOpen = false, onToggle, onCloseMobile, onQ ) } -function GroupHeader({ label, expanded, onToggle, action, action2 }: { +function GroupHeader({ label, expanded, onToggle, action, action2, alwaysVisibleActions = false }: { label: string expanded: boolean onToggle: () => void action?: { label: string; onClick: () => void; icon?: React.ComponentType<{ className?: string }> } action2?: { label: string; onClick: () => void; icon?: React.ComponentType<{ className?: string }> } + alwaysVisibleActions?: boolean }) { const renderAction = (a?: { label: string; onClick: () => void; icon?: React.ComponentType<{ className?: string }> }) => { if (!a) return null @@ -170,7 +171,10 @@ function GroupHeader({ label, expanded, onToggle, action, action2 }: { onClick={a.onClick} title={a.label} aria-label={a.label} - className="shrink-0 rounded p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground group-hover/header:opacity-100 focus-visible:opacity-100" + className={cn( + 'shrink-0 rounded p-1 text-muted-foreground transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100', + alwaysVisibleActions ? 'opacity-100' : 'opacity-0 group-hover/header:opacity-100' + )} > @@ -722,6 +726,7 @@ function SidebarNav({ open, pathname, isAdmin = false }: { open: boolean; pathna onToggle={() => setPagesExpanded(!pagesExpanded)} action={{ label: 'New folder', onClick: () => void createFolder(), icon: FolderPlus }} action2={{ label: 'New page', onClick: () => void createPage() }} + alwaysVisibleActions /> {pagesExpanded && ( <>