Put settings in the sidebar and let the sidebar frost composite
The footer was a user card with the theme picker and log out buried in its dropdown. It is now two plain entries, Settings and Log Out, and the theme moved into the settings page as its own tab. The dark sidebar never matched the canvas because _canvas.tsx painted bg-card across the whole viewport underneath it, so the floating panel's bg-card/80 resolved to card over card and its gutter was card too. Nothing there should paint a surface; the panel now reads the same as the other frosted chrome. The superuser guard sliced the first three tabs, which silently changed meaning when a fourth arrived. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KkmeRiyeYmVZqJVwuyHq9o
This commit is contained in:
co-authored by
Claude Opus 5
parent
ca7a16c8bc
commit
6b73ca3645
@@ -1,6 +1,6 @@
|
||||
import { Monitor, Moon, Sun } from "lucide-react"
|
||||
|
||||
import { type Theme, useTheme } from "@/components/theme-provider"
|
||||
import { useTheme } from "@/components/theme-provider"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -8,63 +8,6 @@ import {
|
||||
DropdownMenuItem,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu"
|
||||
import {
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
useSidebar,
|
||||
} from "@/components/ui/sidebar"
|
||||
|
||||
type LucideIcon = React.FC<React.SVGProps<SVGSVGElement>>
|
||||
|
||||
const ICON_MAP: Record<Theme, LucideIcon> = {
|
||||
system: Monitor,
|
||||
light: Sun,
|
||||
dark: Moon,
|
||||
}
|
||||
|
||||
export const SidebarAppearance = () => {
|
||||
const { isMobile } = useSidebar()
|
||||
const { setTheme, theme } = useTheme()
|
||||
const Icon = ICON_MAP[theme]
|
||||
|
||||
return (
|
||||
<SidebarMenuItem>
|
||||
<DropdownMenu modal={false}>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<SidebarMenuButton tooltip="Appearance" data-testid="theme-button">
|
||||
<Icon className="size-4 text-muted-foreground" />
|
||||
<span>Appearance</span>
|
||||
<span className="sr-only">Toggle theme</span>
|
||||
</SidebarMenuButton>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent
|
||||
side={isMobile ? "top" : "right"}
|
||||
align="end"
|
||||
className="w-(--radix-dropdown-menu-trigger-width) min-w-56"
|
||||
>
|
||||
<DropdownMenuItem
|
||||
data-testid="light-mode"
|
||||
onClick={() => setTheme("light")}
|
||||
>
|
||||
<Sun className="mr-2 h-4 w-4" />
|
||||
Light
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
data-testid="dark-mode"
|
||||
onClick={() => setTheme("dark")}
|
||||
>
|
||||
<Moon className="mr-2 h-4 w-4" />
|
||||
Dark
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setTheme("system")}>
|
||||
<Monitor className="mr-2 h-4 w-4" />
|
||||
System
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</SidebarMenuItem>
|
||||
)
|
||||
}
|
||||
|
||||
export const Appearance = () => {
|
||||
const { setTheme } = useTheme()
|
||||
|
||||
Reference in New Issue
Block a user