diff --git a/frontend/src/app/canvas/CanvasMenubar.tsx b/frontend/src/app/canvas/CanvasMenubar.tsx index 3215ed5..7a5a2eb 100644 --- a/frontend/src/app/canvas/CanvasMenubar.tsx +++ b/frontend/src/app/canvas/CanvasMenubar.tsx @@ -1,5 +1,5 @@ /** - * Menubar for the canvas page: Project (Import/Export), Edit (Undo/Redo, Duplicate/Copy/Paste, Rename), View (Fit View, Theme). + * Menubar for the canvas page: Project (Import/Export), Edit (Undo/Redo, Duplicate/Copy/Paste, Rename), View (Fit View, Minimap). */ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' @@ -17,9 +17,8 @@ import { MenubarCheckboxItem, } from '@/components/ui/menubar' import { Kbd, KbdGroup } from '@/components/ui/kbd' -import { useTheme } from '@/lib/themeContext' import { usePlatform } from '@/app/platform/platformContext' -import { ArrowLeft, ClipboardPaste, Copy, CopyPlus, Download, FolderOpen, Moon, Pencil, Redo2, Sun, Undo2 } from 'lucide-react' +import { ArrowLeft, ClipboardPaste, Copy, CopyPlus, Download, FolderOpen, Pencil, Redo2, Undo2 } from 'lucide-react' import { Input } from '@/components/ui/input' export type CanvasMenubarProps = { @@ -63,7 +62,6 @@ export function CanvasMenubar({ showMinimap = false, onToggleMinimap, }: CanvasMenubarProps) { - const { theme, setTheme } = useTheme() const { projectId } = useParams<{ projectId: string }>() const { projects, renameProject } = usePlatform() const projectName = useMemo( @@ -235,28 +233,6 @@ export function CanvasMenubar({ )} - {onFitView && } - - Theme - - setTheme('light')} - className="gap-2" - > - - Light - - setTheme('dark')} - className="gap-2" - > - - Dark - - - {onToggleMinimap != null && ( <> diff --git a/frontend/src/app/platform/AppSidebar.tsx b/frontend/src/app/platform/AppSidebar.tsx index 059a6b4..87766b0 100644 --- a/frontend/src/app/platform/AppSidebar.tsx +++ b/frontend/src/app/platform/AppSidebar.tsx @@ -17,12 +17,13 @@ import { SidebarRail, SidebarTrigger, } from '@/components/ui/sidebar' -import { Plus, ListTodo } from 'lucide-react' +import { Plus, ListTodo, Settings } from 'lucide-react' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { useSidebar } from '@/components/ui/sidebar' import { usePlatform } from './platformContext' import { getProjectIcon } from '../../lib/iconMap' import { NewProjectDialog } from './NewProjectDialog' +import { SettingsDialog } from './SettingsDialog' import type { Project } from './types' export function AppSidebar() { @@ -178,7 +179,20 @@ export function AppSidebar() { - + + + + + + Settings + + } + /> + + + diff --git a/frontend/src/app/platform/SettingsDialog.tsx b/frontend/src/app/platform/SettingsDialog.tsx new file mode 100644 index 0000000..3631f8b --- /dev/null +++ b/frontend/src/app/platform/SettingsDialog.tsx @@ -0,0 +1,111 @@ +/** + * Settings dialog with sidebar-style nav (Appearance, AI). Reference: shadcn sidebar-13. + */ + +import React, { useState } from 'react' +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from '@/components/ui/dialog' +import { Button } from '@/components/ui/button' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import { useTheme } from '@/lib/themeContext' +import type { Theme } from '@/lib/themeContext' +import { Sun, Sparkles } from 'lucide-react' + +type SettingsSection = 'appearance' | 'ai' + +export function SettingsDialog({ + trigger, +}: { + trigger: React.ReactNode +}) { + const [open, setOpen] = useState(false) + const [section, setSection] = useState('appearance') + const { theme, setTheme } = useTheme() + + return ( + + {trigger} + + + Settings + +
+ +
+ {section === 'appearance' && ( +
+

Appearance

+
+ + +
+
+ )} + {section === 'ai' && ( +
+

AI

+
+ + AI settings + + + Coming soon + +
+
+ )} +
+
+
+
+ ) +}