fix(layout): hoist TooltipProvider to wrap full sidebar tree
The collapsed-state user-footer renders a Tooltip that was outside the TooltipProvider — the provider only wrapped the nav. Once the sidebar toggled to collapsed, the footer Tooltip threw "Tooltip must be used within TooltipProvider", surfacing as console errors in exhaustive click-through tests. Move TooltipProvider up one level so every Tooltip in the sidebar tree (nav items + user footer) is covered. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -199,6 +199,7 @@ function SidebarContent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<TooltipProvider delayDuration={0}>
|
||||||
<div className="flex flex-col h-full bg-[#1e2844]">
|
<div className="flex flex-col h-full bg-[#1e2844]">
|
||||||
{/* Logo area */}
|
{/* Logo area */}
|
||||||
<div
|
<div
|
||||||
@@ -220,7 +221,6 @@ function SidebarContent({
|
|||||||
|
|
||||||
{/* Nav */}
|
{/* Nav */}
|
||||||
<ScrollArea className="flex-1 py-2">
|
<ScrollArea className="flex-1 py-2">
|
||||||
<TooltipProvider delayDuration={0}>
|
|
||||||
<nav className="px-2 space-y-4">
|
<nav className="px-2 space-y-4">
|
||||||
{sections.map((section) => {
|
{sections.map((section) => {
|
||||||
if (section.adminRequired && !hasAdminAccess) return null;
|
if (section.adminRequired && !hasAdminAccess) return null;
|
||||||
@@ -266,7 +266,6 @@ function SidebarContent({
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</nav>
|
</nav>
|
||||||
</TooltipProvider>
|
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|
||||||
{/* User footer */}
|
{/* User footer */}
|
||||||
@@ -304,6 +303,7 @@ function SidebarContent({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</TooltipProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user