(null)
const nodesRef = useRef(nodes)
nodesRef.current = nodes
@@ -570,8 +571,6 @@ export function CanvasPage({ projectId }: CanvasPageProps) {
canDuplicate={selectedNodes.length > 0}
canCopy={selectedNodes.length === 1}
onFitView={() => flowActionsRef.current?.fitView?.()}
- showMinimap={showMinimap}
- onToggleMinimap={setShowMinimap}
/>
{apiTodosCount !== null && (
diff --git a/frontend/src/app/platform/SettingsDialog.tsx b/frontend/src/app/platform/SettingsDialog.tsx
index 3631f8b..5b71b70 100644
--- a/frontend/src/app/platform/SettingsDialog.tsx
+++ b/frontend/src/app/platform/SettingsDialog.tsx
@@ -18,8 +18,10 @@ import {
SelectTrigger,
SelectValue,
} from '@/components/ui/select'
+import { Switch } from '@/components/ui/switch'
import { useTheme } from '@/lib/themeContext'
import type { Theme } from '@/lib/themeContext'
+import { usePlatform } from './platformContext'
import { Sun, Sparkles } from 'lucide-react'
type SettingsSection = 'appearance' | 'ai'
@@ -32,6 +34,7 @@ export function SettingsDialog({
const [open, setOpen] = useState(false)
const [section, setSection] = useState('appearance')
const { theme, setTheme } = useTheme()
+ const { showMinimap, setShowMinimap } = usePlatform()
return (
+
+
+ Canvas
+
+
+
+
+
+
)}
{section === 'ai' && (
diff --git a/frontend/src/app/platform/platformContext.tsx b/frontend/src/app/platform/platformContext.tsx
index df64d25..232c097 100644
--- a/frontend/src/app/platform/platformContext.tsx
+++ b/frontend/src/app/platform/platformContext.tsx
@@ -11,8 +11,24 @@ import { PROJECT_VERSION } from './projectGraphStorage'
const STORAGE_KEY = 'zui_platform_projects'
const ORDER_STORAGE_KEY = 'zui_platform_project_order'
const RECENT_STORAGE_KEY = 'zui_platform_recent_project_ids'
+const CANVAS_MINIMAP_KEY = 'zui_canvas_show_minimap'
const RECENT_MAX = 5
+function loadShowMinimap(): boolean {
+ try {
+ const raw = localStorage.getItem(CANVAS_MINIMAP_KEY)
+ if (raw === 'true') return true
+ if (raw === 'false') return false
+ } catch {}
+ return false
+}
+
+function saveShowMinimap(value: boolean) {
+ try {
+ localStorage.setItem(CANVAS_MINIMAP_KEY, JSON.stringify(value))
+ } catch {}
+}
+
function loadOrder(): string[] {
try {
const raw = localStorage.getItem(ORDER_STORAGE_KEY)
@@ -107,6 +123,9 @@ export type PlatformContextValue = {
updateLastEdited: (id: string) => void
reorderProjects: (orderedIds: string[]) => void
restoreProject: (project: Project, graphSnapshot: GraphSnapshot | null) => void
+ /** Canvas: show React Flow minimap (persisted) */
+ showMinimap: boolean
+ setShowMinimap: (value: boolean) => void
}
const PlatformContext = createContext(null)
@@ -115,6 +134,12 @@ export function PlatformProvider({ children }: { children: React.ReactNode }) {
const [projects, setProjects] = useState(loadProjects)
const [projectOrder, setProjectOrder] = useState(loadOrder)
const [recentProjectIds, setRecentProjectIds] = useState(loadRecentIds)
+ const [showMinimap, setShowMinimapState] = useState(loadShowMinimap)
+
+ const setShowMinimap = useCallback((value: boolean) => {
+ setShowMinimapState(value)
+ saveShowMinimap(value)
+ }, [])
const persist = useCallback((next: Project[]) => {
setProjects(next)
@@ -220,6 +245,8 @@ export function PlatformProvider({ children }: { children: React.ReactNode }) {
updateLastEdited,
reorderProjects,
restoreProject,
+ showMinimap,
+ setShowMinimap,
}),
[
projects,
@@ -234,6 +261,8 @@ export function PlatformProvider({ children }: { children: React.ReactNode }) {
updateLastEdited,
reorderProjects,
restoreProject,
+ showMinimap,
+ setShowMinimap,
]
)