The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(settings): der ComfyUI-Hinweis bringt seinen Abschnitt aufgeklappt mit
purpleaacb93cf11a1
diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsxindex cc9fc588..aaf9b903 100644--- a/src/components/models/ModelManager.tsx+++ b/src/components/models/ModelManager.tsx@@ -54,7 +54,7 @@ export function ModelManager() {models, activeModel, setActiveModel, fetchModels, removeModel,categoryFilter, setCategoryFilter, inventoryLoaded, inventoryRefreshing,} = useModels()- const { setView } = useUIStore()+ const { setView, openSettingsAt } = useUIStore()const ollamaEnabled = useProviderStore(s => s.providers.ollama.enabled)const [pullOpen, setPullOpen] = useState(false)const [infoOpen, setInfoOpen] = useState(false)@@ -328,8 +328,13 @@ export function ModelManager() {{mode === 'image' ? 'Image' : 'Video'} models are served by ComfyUI, which isn't running right now, so the ones you've downloaded can't be listed yet. Open Settings, go to AI Backends, and press Start under ComfyUI (Image & Video), then come back.</p></div>+ {/* Nebenbefund 3, R8 re-measure: the sentence above names a+ Start button that sits inside a collapsed section, and+ said nothing about unfolding it. The button knows the+ whole route, so it walks all of it: Settings, the AI+ Backends tab, the ComfyUI section open. */}<button- onClick={() => setView('settings')}+ onClick={() => openSettingsAt({ tab: 'backends', section: 'comfyui' })}className="flex items-center gap-1.5 mt-1 px-3 py-1.5 rounded-md bg-gray-900 dark:bg-white/10 hover:bg-gray-800 dark:hover:bg-white/15 text-white text-[0.65rem] font-medium transition-colors"><SettingsIcon size={11} /> Open Settingsdiff --git a/src/components/models/__tests__/hints-name-real-controls.test.ts b/src/components/models/__tests__/hints-name-real-controls.test.tsindex 4580ee3a..5e7962fc 100644--- a/src/components/models/__tests__/hints-name-real-controls.test.ts+++ b/src/components/models/__tests__/hints-name-real-controls.test.ts@@ -57,8 +57,12 @@ describe('THE FIX: the ComfyUI-is-down hint names the control that exists', () =it('the button under the text goes where the text says', () => {// It used to read "Go to Create" and call setView('create'), which dropped- // the user on the tab that has no such control.- expect(modelManager).toMatch(/onClick=\{\(\) => setView\('settings'\)\}[\s\S]{0,400}Open Settings/)+ // the user on the tab that has no such control. Since round 9 it carries+ // the last step of the route too, the open ComfyUI section+ // (settings-deeplink-comfyui.test.ts holds that end of it).+ expect(modelManager).toMatch(+ /onClick=\{\(\) => openSettingsAt\(\{ tab: 'backends', section: 'comfyui' \}\)\}[\s\S]{0,400}Open Settings/,+ )expect(modelManager).not.toMatch(/Go to Create/)})})@@ -69,7 +73,7 @@ describe('the control the hint names is really there', () => {})it('with a ComfyUI (Image & Video) section', () => {- expect(settingsPage).toMatch(/<Section title="ComfyUI \(Image & Video\)">/)+ expect(settingsPage).toMatch(/<Section title="ComfyUI \(Image & Video\)"/)})it('and a Start button in it that really starts ComfyUI', () => {diff --git a/src/components/models/__tests__/settings-deeplink-comfyui.test.ts b/src/components/models/__tests__/settings-deeplink-comfyui.test.tsnew file mode 100644index 00000000..b0e4cdb7--- /dev/null+++ b/src/components/models/__tests__/settings-deeplink-comfyui.test.ts@@ -0,0 +1,104 @@+/**+ * Nebenbefund 3 of the R8 re-measure (2026-08-30, Windows box, installed+ * build). The ComfyUI-is-down hint in the Model Manager reads:+ *+ * "Open Settings, go to AI Backends, and press Start under ComfyUI+ * (Image & Video), then come back."+ *+ * Every station of that route exists, and the last one was hidden: the Start+ * button sits inside a collapsed section, so it only appears after a click on+ * the section header that the hint never mentions. Measured on both routes,+ * through the "Open Settings" button and through normal Settings navigation.+ *+ * The button is the fix, not the sentence: it already knew the tab, now it+ * carries the section as well. These hold that route from end to end.+ *+ * Run: npx vitest run src/components/models/__tests__/settings-deeplink-comfyui.test.ts+ */+import { describe, it, expect, beforeEach } from 'vitest'+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { dirname, resolve } from 'node:path'+import { useUIStore } from '../../../stores/uiStore'++const here = dirname(fileURLToPath(import.meta.url))+const repo = resolve(here, '../../../..')+const read = (rel: string) => readFileSync(resolve(repo, rel), 'utf8')++describe('uiStore settings deep link', () => {+ beforeEach(() => {+ useUIStore.setState({ currentView: 'models', sidebarOpen: true, settingsFocus: null })+ })++ it('openSettingsAt lands on Settings and says which section to unfold', () => {+ useUIStore.getState().openSettingsAt({ tab: 'backends', section: 'comfyui' })+ const s = useUIStore.getState()+ expect(s.currentView).toBe('settings')+ expect(s.settingsFocus).toEqual({ tab: 'backends', section: 'comfyui' })+ })++ it('a tab without a section is still a valid landing', () => {+ useUIStore.getState().openSettingsAt({ tab: 'agent' })+ expect(useUIStore.getState().settingsFocus).toEqual({ tab: 'agent' })+ })++ it('plain navigation afterwards drops the focus instead of firing it late', () => {+ useUIStore.getState().openSettingsAt({ tab: 'backends', section: 'comfyui' })+ useUIStore.getState().setView('chat')+ expect(useUIStore.getState().settingsFocus).toBeNull()+ })++ it('clearSettingsFocus is what SettingsPage uses to consume it', () => {+ useUIStore.getState().openSettingsAt({ tab: 'backends', section: 'comfyui' })+ useUIStore.getState().clearSettingsFocus()+ expect(useUIStore.getState().settingsFocus).toBeNull()+ // Consuming the focus must not bounce the user off the page.+ expect(useUIStore.getState().currentView).toBe('settings')+ })++ it('the focus is never persisted, it describes one navigation', () => {+ const uiStore = read('src/stores/uiStore.ts')+ const partialize = uiStore.slice(uiStore.indexOf('partialize:'))+ expect(partialize).not.toMatch(/settingsFocus/)+ })+})++describe('the hint button walks the whole route', () => {+ const modelManager = read('src/components/models/ModelManager.tsx')+ const settingsPage = read('src/components/settings/SettingsPage.tsx')++ it('Open Settings asks for the AI Backends tab AND the ComfyUI section', () => {+ // Pre-fix: setView('settings') and nothing more. The tab it landed on was+ // whatever localStorage remembered, which on the box happened to be the+ // right one, and the section was closed either way.+ expect(modelManager).toMatch(/openSettingsAt\(\{ tab: 'backends', section: 'comfyui' \}\)/)+ expect(modelManager).not.toMatch(/onClick=\{\(\) => setView\('settings'\)\}/)+ })++ it('SettingsPage opens on the tab the focus names', () => {+ expect(settingsPage).toMatch(/if \(entryFocus\) return entryFocus\.tab/)+ })++ it('and unfolds the ComfyUI section for it', () => {+ expect(settingsPage).toMatch(+ /<Section title="ComfyUI \(Image & Video\)" defaultOpen=\{entryFocus\?\.section === 'comfyui'\}>/,+ )+ })++ it('reads the focus once at mount, not through a live selector', () => {+ // defaultOpen is an INITIAL value. Reading the focus reactively would fold+ // the section back up on the very next render, the moment the store is+ // cleared, which is the whole failure this fix is about.+ expect(settingsPage).toMatch(/useState\(\(\) => useUIStore\.getState\(\)\.settingsFocus\)/)+ expect(settingsPage).toMatch(/useEffect\(\(\) => \{ useUIStore\.getState\(\)\.clearSettingsFocus\(\) \}, \[\]\)/)+ })++ it('NEGATIVE CONTROL: the section still opens closed for everybody else', () => {+ // A fix that just flipped defaultOpen on would be a false pass: the panel+ // is long, and the other sections on the tab stay folded. Only Providers+ // is open by default, and it was before.+ expect(settingsPage).toMatch(/<Section title="Providers" defaultOpen>/)+ expect(settingsPage).not.toMatch(/<Section title="ComfyUI \(Image & Video\)" defaultOpen>/)+ expect(settingsPage).toMatch(/<Section title="Model Storage">/)+ })+})diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsxindex 2ef992de..d81cfd69 100644--- a/src/components/settings/SettingsPage.tsx+++ b/src/components/settings/SettingsPage.tsx@@ -1068,7 +1068,14 @@ export function SettingsPage() {const [installedVoices, setInstalledVoices] = useState<string[]>([])const [voiceBusy, setVoiceBusy] = useState(false)const [voiceError, setVoiceError] = useState<string | null>(null)+ // Where the navigation that opened this page wanted to land. Read ONCE, at+ // mount, and held for this mount's whole life: `defaultOpen` below is an+ // initial value, so a focus that vanished from the store on the next render+ // would fold the section straight back up (Nebenbefund 3, R8 re-measure).+ const [entryFocus] = useState(() => useUIStore.getState().settingsFocus)+ useEffect(() => { useUIStore.getState().clearSettingsFocus() }, [])const [tab, setTab] = useState<SettingsTab>(() => {+ if (entryFocus) return entryFocus.tabif (typeof window === 'undefined') return 'general'const stored = window.localStorage.getItem(SETTINGS_TAB_KEY)return (stored === 'general' || stored === 'backends' || stored === 'agent' || stored === 'voice-remote')@@ -1495,7 +1502,11 @@ export function SettingsPage() {the MLX installer in its place; without it a fresh Mac has no wayto set up local image/video at all (MAC-3). */}{!isMlxImageHost() ? (- <Section title="ComfyUI (Image & Video)">+ // Arriving from the Models page's "Start ComfyUI to see your image+ // models" hint: the Start button it names lives in here, so the+ // section arrives open instead of costing one more click the hint+ // never mentioned.+ <Section title="ComfyUI (Image & Video)" defaultOpen={entryFocus?.section === 'comfyui'}>{settings.appMode === 'cloud' && (<p className="text-[0.55rem] text-gray-500 leading-snug pb-1">Local mode only. Cloud renders run on lu-labs.ai and never use ComfyUI.diff --git a/src/stores/uiStore.ts b/src/stores/uiStore.tsindex 090fa2f8..79db71ed 100644--- a/src/stores/uiStore.ts+++ b/src/stores/uiStore.ts@@ -1,8 +1,23 @@import { create } from 'zustand'import { persist } from 'zustand/middleware'+import type { SettingsTab } from '../lib/settings-reset'export type View = 'chat' | 'models' | 'settings' | 'create' | 'benchmark'+/** Which collapsible section of the Settings page a deep link wants open.+ * Only sections a hint elsewhere in the app sends people to. */+export type SettingsSection = 'comfyui'++/** Where a "go to Settings" button wants to land. Nebenbefund 3 of the R8+ * re-measure: the ComfyUI empty state says "press Start under ComfyUI (Image+ * & Video)", and that Start button sits inside a section that opens closed,+ * so the last step of the route was a click the hint never mentioned. A+ * button that already knows the tab can carry the section too. */+export interface SettingsFocus {+ tab: SettingsTab+ section?: SettingsSection+}+/** Which Cloud teaser sheet is open (Local-mode discovery, 2.5.8).* 'intent' = a locked Create tab (the cloud-only intents incl. the five* 2.5.8 categories); 'create-model' = a hosted model row in the Create@@ -42,7 +57,13 @@ interface UIState {explorerWidth: number/** Explorer panel collapsed to its rail, persisted. */explorerCollapsed: boolean+ /** Read once by SettingsPage when it mounts, then cleared. Never persisted:+ * it describes one navigation, not a preference. */+ settingsFocus: SettingsFocus | nullsetView: (view: View) => void+ /** Open Settings on a given tab, optionally with one section unfolded. */+ openSettingsAt: (focus: SettingsFocus) => void+ clearSettingsFocus: () => voidtoggleSidebar: () => voidsetSidebarOpen: (open: boolean) => voidsetCloudGateOpen: (open: boolean) => void@@ -60,11 +81,18 @@ export const useUIStore = create<UIState>()(cloudTeaser: null,explorerWidth: EXPLORER_DEFAULT_WIDTH,explorerCollapsed: false,+ settingsFocus: null,// Sidebar visibility follows the view: it's the conversation list, which// only makes sense in Chat. The hamburger toggle still works on other views;// it just resets to the view's default on the next setView() call.- setView: (view) => set({ currentView: view, sidebarOpen: view === 'chat' }),+ // A plain setView is somebody navigating by hand, so it drops any focus+ // a previous deep link left behind rather than firing it late.+ setView: (view) => set({ currentView: view, sidebarOpen: view === 'chat', settingsFocus: null }),++ openSettingsAt: (focus) =>+ set({ currentView: 'settings', sidebarOpen: false, settingsFocus: focus }),+ clearSettingsFocus: () => set({ settingsFocus: null }),toggleSidebar: () => set((state) => ({ sidebarOpen: !state.sidebarOpen })),setSidebarOpen: (open) => set({ sidebarOpen: open }),setCloudGateOpen: (open) => set({ cloudGateOpen: open }),