Skip to content

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.

feat(settings,onboarding,create): tabs, P14 install UI, P4 starter trim

purple65aaf0764a42
diff --git a/src/components/create/CreateView.tsx b/src/components/create/CreateView.tsx
index d5453bb0..31afae7d 100644
--- a/src/components/create/CreateView.tsx
+++ b/src/components/create/CreateView.tsx
@@ -126,6 +126,15 @@ export function CreateView() {
const [installing, setInstalling] = useState(false)
const [installLogs, setInstallLogs] = useState<string[]>([])
const [installError, setInstallError] = useState('')
+ // P14: same Python pre-flight as the onboarding ComfyUI step. On a fresh
+ // Windows box `python` is the Microsoft Store stub which exit-1's
+ // `pip install`, leaving a half-cloned ComfyUI dir on disk. The Install
+ // button below now runs python_check first, kicks off install_python via
+ // winget if needed, and only then triggers install_comfyui.
+ const [pyInstalling, setPyInstalling] = useState(false)
+ const [pyInstallLogs, setPyInstallLogs] = useState<string[]>([])
+ const [pyInstallError, setPyInstallError] = useState('')
+ const pyInstallPollRef = useRef<ReturnType<typeof setInterval> | null>(null)
const [showConnected, setShowConnected] = useState(true)
const [i2vUploading, setI2vUploading] = useState(false)
const [i2vDragOver, setI2vDragOver] = useState(false)
@@ -267,8 +276,10 @@ export function CreateView() {
return (
<div className="h-full flex flex-col">
- {/* Setup wizard */}
- {notFound && !installing && (
+ {/* Setup wizard. Also hidden during Python install so the user
+ doesn't see the "ComfyUI not found" panel flickering above the
+ Python progress card. */}
+ {notFound && !installing && !pyInstalling && (
<div className="border-b border-red-500/20">
<div className="p-4 bg-red-500/5 space-y-3">
<div className="flex items-center gap-2 text-red-400 text-sm font-medium">
@@ -280,6 +291,48 @@ export function CreateView() {
<p className="text-[10px] text-gray-500 uppercase tracking-wider mb-2">Auto-install</p>
<button
onClick={async () => {
+ // P14 pre-flight: ensure Python is installed before
+ // ComfyUI's pip install. Newbies on a fresh Windows
+ // hit the Microsoft Store stub otherwise.
+ setPyInstallError('')
+ let pythonOk = false
+ try {
+ const probe: any = await backendCall('python_check')
+ pythonOk = !!probe?.available
+ } catch { pythonOk = false }
+
+ if (!pythonOk) {
+ setPyInstalling(true)
+ setPyInstallLogs(['Installing Python 3.12 via winget…'])
+ try {
+ await backendCall('install_python')
+ } catch (err) {
+ setPyInstalling(false)
+ setPyInstallError(err instanceof Error ? err.message : 'Could not start Python install')
+ return
+ }
+ pythonOk = await new Promise<boolean>((resolve) => {
+ pyInstallPollRef.current = setInterval(async () => {
+ try {
+ const data: any = await backendCall('install_python_status')
+ setPyInstallLogs(data.logs || [])
+ if (data.status === 'complete' || data.status === 'already_installed') {
+ if (pyInstallPollRef.current) clearInterval(pyInstallPollRef.current)
+ setPyInstalling(false)
+ resolve(true)
+ } else if (data.status === 'error') {
+ if (pyInstallPollRef.current) clearInterval(pyInstallPollRef.current)
+ setPyInstalling(false)
+ const lastLog = (data.logs?.length ? data.logs[data.logs.length - 1] : '') as string
+ setPyInstallError(lastLog || 'Python install failed')
+ resolve(false)
+ }
+ } catch { /* keep polling */ }
+ }, 2000)
+ })
+ if (!pythonOk) return
+ }
+
setInstalling(true)
setInstallError('')
setInstallLogs([])
@@ -353,6 +406,28 @@ export function CreateView() {
</div>
)}
+ {/* P14: Installing Python — shown while winget pulls Python.Python.3.12.
+ Sits above the ComfyUI install card so the dependency chain (Python
+ → ComfyUI) is visible from a single click. */}
+ {pyInstalling && (
+ <div className="border-b border-white/5">
+ <div className="p-3 bg-white/5 space-y-2">
+ <div className="flex items-center gap-2 text-gray-300 text-xs">
+ <Loader2 size={12} className="animate-spin" />
+ Installing Python 3.12 (~30 MB)...
+ </div>
+ {pyInstallLogs.length > 0 && (
+ <div className="bg-black rounded-lg p-2 max-h-32 overflow-y-auto font-mono text-[10px] text-gray-500">
+ {pyInstallLogs.slice(-10).map((log, i) => <div key={i} className="truncate">{log}</div>)}
+ </div>
+ )}
+ </div>
+ </div>
+ )}
+ {pyInstallError && !pyInstalling && (
+ <div className="border-b border-white/5 px-3 py-2 text-[10px] text-red-400 whitespace-pre-line">{pyInstallError}</div>
+ )}
+
{/* Installing */}
{installing && (
<div className="border-b border-white/5">
diff --git a/src/components/onboarding/Onboarding.tsx b/src/components/onboarding/Onboarding.tsx
index faaa4073..ea6e02cf 100644
--- a/src/components/onboarding/Onboarding.tsx
+++ b/src/components/onboarding/Onboarding.tsx
@@ -59,9 +59,12 @@ export function Onboarding() {
const [selectedBackend, setSelectedBackend] = useState<string>('')
const { setProviderConfig } = useProviderStore()
- // ComfyUI step state
+ // ComfyUI step state. `comfyFound.complete` distinguishes a working
+ // install from a half-cloned carcass — see is_comfyui_install_complete in
+ // process.rs. UI uses `complete:false` to surface a Re-install option
+ // instead of "ComfyUI detected, Continue".
const [comfyDetecting, setComfyDetecting] = useState(false)
- const [comfyFound, setComfyFound] = useState<{ found: boolean; path?: string } | null>(null)
+ const [comfyFound, setComfyFound] = useState<{ found: boolean; path?: string; complete?: boolean } | null>(null)
const [comfyInstalling, setComfyInstalling] = useState(false)
const [comfyInstallLogs, setComfyInstallLogs] = useState<string[]>([])
const [comfyInstallError, setComfyInstallError] = useState('')
@@ -70,6 +73,18 @@ export function Onboarding() {
const [comfyDownloadProgress, setComfyDownloadProgress] = useState(0)
const [comfyDownloadTotal, setComfyDownloadTotal] = useState(0)
const [comfyDownloadSpeed, setComfyDownloadSpeed] = useState(0)
+
+ // P14: Python install state. On a fresh Windows box `python` is the
+ // Microsoft Store stub which exit-1's `pip install`. The ComfyUI install
+ // pre-flight runs `python_check`; if Python is missing we kick off
+ // `install_python` (winget Python.Python.3.12) and poll its status here
+ // before re-firing `install_comfyui`.
+ const [pythonInstalling, setPythonInstalling] = useState(false)
+ const [pythonInstallLogs, setPythonInstallLogs] = useState<string[]>([])
+ const [pythonInstallError, setPythonInstallError] = useState('')
+ const [pythonReady, setPythonReady] = useState(false)
+ const [pythonStartTime, setPythonStartTime] = useState<number | null>(null)
+ const [pythonElapsed, setPythonElapsed] = useState(0)
const [systemVRAM, setSystemVRAM] = useState<number | null>(null)
const [modelSubTab, setModelSubTab] = useState<'uncensored' | 'mainstream'>('uncensored')
const [installStartTime, setInstallStartTime] = useState<number | null>(null)
@@ -253,13 +268,10 @@ export function Onboarding() {
useEffect(() => { getSystemVRAM().then(v => setSystemVRAM(v)).catch(() => {}) }, [])
// Count models the user already has installed across all backends. Used to
- // suppress the "Recommended" starter pick when the user is clearly an
- // experienced reinstaller — the previous version slapped "Recommended" on
- // half a dozen 5–16 GB models for everyone, which was both noisy and a bad
- // suggestion if you already had your own preferences. Failing the call
- // returns 0 (no Ollama running yet → genuinely fresh install → recommend
- // away).
- const [existingModelCount, setExistingModelCount] = useState<number>(0)
+ // skip the model-picker step entirely when they're not a fresh install —
+ // a reinstaller / upgrader doesn't need a starter recommendation, and
+ // showing one is just nagging.
+ const [existingModelCount, setExistingModelCount] = useState<number | null>(null)
useEffect(() => {
if (step !== 'models') return
let cancelled = false
@@ -270,6 +282,17 @@ export function Onboarding() {
)
return () => { cancelled = true }
}, [step])
+
+ // Auto-skip the model step when the user already has installed models
+ // (P4 LU-Aufgaben: "Nur wenn der User noch gar kein Modell installiert hat.
+ // Sonst nirgendwo mehr 'Recommended'-Empfehlungen"). null = still loading,
+ // 0 = fresh, >0 = experienced — only the first two should see the picker.
+ useEffect(() => {
+ if (step === 'models' && existingModelCount !== null && existingModelCount > 0) {
+ setStep('done')
+ }
+ }, [step, existingModelCount])
+
const showRecommendedBadge = existingModelCount === 0
// Elapsed timer for ComfyUI installation
@@ -293,20 +316,84 @@ export function Onboarding() {
return () => clearInterval(timer)
}, [lmstudioStartTime])
- // Auto-detect ComfyUI when entering the comfyui step
+ // Elapsed timer for Python installation (P14). winget pulls the Python
+ // 3.12 installer (~30 MB) and runs it silently; on a typical home
+ // connection this is ~30–60 s, but slow links can take a few minutes.
+ useEffect(() => {
+ if (!pythonStartTime) return
+ const timer = setInterval(() => setPythonElapsed(Math.floor((Date.now() - pythonStartTime) / 1000)), 1000)
+ return () => clearInterval(timer)
+ }, [pythonStartTime])
+
+ // Auto-detect ComfyUI when entering the comfyui step. We mark the install
+ // as "ready" (=> Continue button) only when both `found` AND `complete`
+ // are true. A `found && !complete` carcass (P14) keeps the install option
+ // visible so the user can re-trigger and let LU rebuild torch/deps.
useEffect(() => {
if (step === 'comfyui' && !comfyFound && !comfyDetecting) {
setComfyDetecting(true)
- backendCall<{ found: boolean; path?: string }>('find_comfyui')
+ backendCall<{ found: boolean; path?: string; complete?: boolean }>('find_comfyui')
.then(result => {
setComfyFound(result)
- if (result.found) setComfyReady(true)
+ if (result.found && result.complete !== false) setComfyReady(true)
})
- .catch(() => setComfyFound({ found: false }))
+ .catch(() => setComfyFound({ found: false, complete: false }))
.finally(() => setComfyDetecting(false))
}
}, [step])
+ // P14 pre-flight: ensure Python is on the box before triggering ComfyUI's
+ // pip install. On fresh Windows, `python` is the Microsoft Store stub
+ // and pip silently exit-1's, leaving a carcass on disk and a
+ // "not responding" message in the UI. Returns true once Python is ready.
+ // If Python is already installed, this is a no-op single round trip.
+ const ensurePythonInstalled = async (): Promise<boolean> => {
+ try {
+ const probe = await backendCall<{ available: boolean; path?: string | null }>('python_check')
+ if (probe?.available) return true
+ } catch {
+ // Treat as "not available" and continue to install.
+ }
+
+ setPythonInstalling(true)
+ setPythonInstallError('')
+ setPythonInstallLogs(['Installing Python 3.12 via winget…'])
+ setPythonStartTime(Date.now())
+ setPythonElapsed(0)
+
+ try {
+ await backendCall('install_python')
+ } catch (err) {
+ setPythonInstalling(false)
+ setPythonStartTime(null)
+ setPythonInstallError(err instanceof Error ? err.message : 'Python install failed to start')
+ return false
+ }
+
+ return await new Promise<boolean>((resolve) => {
+ const poll = setInterval(async () => {
+ try {
+ const status: any = await backendCall('install_python_status')
+ setPythonInstallLogs(status.logs || [])
+ if (status.status === 'complete' || status.status === 'already_installed') {
+ clearInterval(poll)
+ setPythonInstalling(false)
+ setPythonReady(true)
+ setPythonStartTime(null)
+ resolve(true)
+ } else if (status.status === 'error') {
+ clearInterval(poll)
+ setPythonInstalling(false)
+ setPythonStartTime(null)
+ const lastLog = status.logs?.[status.logs.length - 1] || 'Python install failed'
+ setPythonInstallError(lastLog)
+ resolve(false)
+ }
+ } catch { /* keep polling */ }
+ }, 2000)
+ })
+ }
+
// GGUF download progress from downloadStore
const currentModel = pullingModel ? ONBOARDING_MODELS.find(m => m.name === pullingModel) : null
const currentDownload = currentModel?.filename ? downloads[currentModel.filename] : null
@@ -798,8 +885,9 @@ export function Onboarding() {
</div>
)}
- {/* Found */}
- {comfyFound?.found && !comfyInstalling && (
+ {/* Found AND complete (a working install). The carcass case
+ is handled in the install-options block below. */}
+ {comfyFound?.found && comfyFound.complete !== false && !comfyInstalling && (
<div className={`p-3 rounded-lg border ${isDark ? 'bg-green-500/10 border-green-500/20' : 'bg-green-50 border-green-200'}`}>
<div className="flex items-center gap-2 justify-center">
<Check size={14} className="text-green-400" />
@@ -809,11 +897,28 @@ export function Onboarding() {
</div>
)}
- {/* Not found — install options */}
- {comfyFound && !comfyFound.found && !comfyInstalling && !comfyReady && (
+ {/* Not found OR found-but-incomplete — install options.
+ P14: a found-but-incomplete dir is the ComfyUI carcass case;
+ the same install button restarts the flow (Python pre-flight
+ + git pull + pip install). */}
+ {comfyFound && (!comfyFound.found || comfyFound.complete === false) && !comfyInstalling && !pythonInstalling && !comfyReady && (
<div className="space-y-2">
+ {comfyFound.found && comfyFound.complete === false && (
+ <div className={`p-2.5 rounded-lg border ${isDark ? 'bg-amber-500/10 border-amber-500/20' : 'bg-amber-50 border-amber-200'} text-left`}>
+ <p className={`text-[0.6rem] ${isDark ? 'text-amber-300' : 'text-amber-800'}`}>
+ Found a previous ComfyUI install at <code className="font-mono">{comfyFound.path}</code> but it's missing PyTorch — looks like a previous install was interrupted. Click below to finish it.
+ </p>
+ </div>
+ )}
<button
onClick={async () => {
+ // P14 pre-flight — install Python first if missing,
+ // then proceed with the original ComfyUI flow. Both
+ // progress cards animate from this single click; the
+ // user never has to interact mid-flight.
+ const pythonOk = await ensurePythonInstalled()
+ if (!pythonOk) return
+
setComfyInstalling(true)
setComfyInstallError('')
setComfyInstallLogs(['Starting ComfyUI installation...'])
@@ -902,6 +1007,36 @@ export function Onboarding() {
</div>
)}
+ {/* P14: Python install progress card. Animates while winget
+ pulls Python.Python.3.12 (~30 MB) and runs the silent
+ installer. Sits ABOVE the ComfyUI install card so the user
+ can see the dependency chain (Python → ComfyUI) when both
+ run back-to-back from a single click. */}
+ {pythonInstalling && (
+ <div className={`p-3 rounded-lg border ${cardClass} text-left`}>
+ <div className="flex items-center justify-between mb-2">
+ <div className="flex items-center gap-2">
+ <Loader2 size={14} className="animate-spin text-purple-400" />
+ <span className="text-[0.7rem] font-medium">Installing Python 3.12...</span>
+ </div>
+ <span className={`text-[0.55rem] font-mono ${isDark ? 'text-gray-500' : 'text-gray-400'}`}>
+ {Math.floor(pythonElapsed / 60)}:{String(pythonElapsed % 60).padStart(2, '0')}
+ </span>
+ </div>
+ <p className={`text-[0.55rem] mb-2 ${isDark ? 'text-gray-500' : 'text-gray-400'}`}>
+ ComfyUI needs Python to run pip. We're installing it via winget — about 30 MB and 30–60 s on a typical connection.
+ </p>
+ <div className={`text-[0.55rem] font-mono max-h-24 overflow-y-auto space-y-0.5 ${isDark ? 'text-gray-500' : 'text-gray-400'}`}>
+ {pythonInstallLogs.slice(-6).map((log, i) => (
+ <p key={i}>{log}</p>
+ ))}
+ </div>
+ </div>
+ )}
+ {pythonInstallError && !pythonInstalling && (
+ <p className="text-[0.65rem] text-red-400 whitespace-pre-line">{pythonInstallError}</p>
+ )}
+
{/* Installing progress */}
{comfyInstalling && (
<div className={`p-3 rounded-lg border ${cardClass} text-left`}>
@@ -952,7 +1087,10 @@ export function Onboarding() {
)}
<div className="flex items-center justify-center gap-2 pt-1">
- {(comfyFound?.found || comfyReady) && (
+ {/* Continue only when ComfyUI is actually usable. A
+ found-but-incomplete carcass shouldn't qualify — that
+ install will fail at first generation. */}
+ {((comfyFound?.found && comfyFound.complete !== false) || comfyReady) && (
<button
onClick={() => setStep('models')}
className={primaryBtn}
@@ -960,15 +1098,15 @@ export function Onboarding() {
Continue <ArrowRight size={14} />
</button>
)}
- {!comfyInstalling && !comfyFound?.found && !comfyReady && (
+ {!comfyInstalling && !pythonInstalling && (!comfyFound?.found || comfyFound.complete === false) && !comfyReady && (
<>
<button
onClick={() => {
setComfyDetecting(true)
setComfyFound(null)
- backendCall<{ found: boolean; path?: string }>('find_comfyui')
- .then(result => { setComfyFound(result); if (result.found) setComfyReady(true) })
- .catch(() => setComfyFound({ found: false }))
+ backendCall<{ found: boolean; path?: string; complete?: boolean }>('find_comfyui')
+ .then(result => { setComfyFound(result); if (result.found && result.complete !== false) setComfyReady(true) })
+ .catch(() => setComfyFound({ found: false, complete: false }))
.finally(() => setComfyDetecting(false))
}}
className={secondaryBtn}
@@ -997,23 +1135,27 @@ export function Onboarding() {
exit={{ opacity: 0, y: -20 }}
>
<div className="text-center mb-3">
- <h2 className="text-base font-semibold mb-1">Choose your models</h2>
+ <h2 className="text-base font-semibold mb-1">Pick a starter model</h2>
<p className={`text-[0.7rem] ${isDark ? 'text-gray-400' : 'text-gray-500'}`}>
- {systemVRAM ? `Showing models for your ${systemVRAM} GB GPU.` : 'Select models to install.'} You can add more later.
+ One small model to get you running. You can browse and install more from the Discover tab in Model Manager once you're in.
</p>
</div>
- {/* Uncensored / Mainstream tabs */}
- <div className="flex gap-4 justify-center">
- <button onClick={() => setModelSubTab('uncensored')} className={`flex items-center gap-2 transition-all ${modelSubTab === 'uncensored' ? 'opacity-100' : 'opacity-40 hover:opacity-70'}`}>
- <div className={`w-1 h-4 rounded-full ${modelSubTab === 'uncensored' ? 'bg-red-500' : 'bg-red-500/50'}`} />
- <span className="text-[0.65rem] font-semibold uppercase tracking-wider">Uncensored</span>
- </button>
- <button onClick={() => setModelSubTab('mainstream')} className={`flex items-center gap-2 transition-all ${modelSubTab === 'mainstream' ? 'opacity-100' : 'opacity-40 hover:opacity-70'}`}>
- <div className={`w-1 h-4 rounded-full ${modelSubTab === 'mainstream' ? 'bg-blue-500' : 'bg-blue-500/50'}`} />
- <span className="text-[0.65rem] font-semibold uppercase tracking-wider">Mainstream</span>
- </button>
- </div>
+ {/* Uncensored / Mainstream tabs — only meaningful when both
+ categories have entries. With the curated single-starter list
+ (P4) the tabs are hidden; reintroduce only if the list grows. */}
+ {ONBOARDING_MODELS.some(m => m.uncensored) && ONBOARDING_MODELS.some(m => !m.uncensored) && (
+ <div className="flex gap-4 justify-center">
+ <button onClick={() => setModelSubTab('uncensored')} className={`flex items-center gap-2 transition-all ${modelSubTab === 'uncensored' ? 'opacity-100' : 'opacity-40 hover:opacity-70'}`}>
+ <div className={`w-1 h-4 rounded-full ${modelSubTab === 'uncensored' ? 'bg-red-500' : 'bg-red-500/50'}`} />
+ <span className="text-[0.65rem] font-semibold uppercase tracking-wider">Uncensored</span>
+ </button>
+ <button onClick={() => setModelSubTab('mainstream')} className={`flex items-center gap-2 transition-all ${modelSubTab === 'mainstream' ? 'opacity-100' : 'opacity-40 hover:opacity-70'}`}>
+ <div className={`w-1 h-4 rounded-full ${modelSubTab === 'mainstream' ? 'bg-blue-500' : 'bg-blue-500/50'}`} />
+ <span className="text-[0.65rem] font-semibold uppercase tracking-wider">Mainstream</span>
+ </button>
+ </div>
+ )}
{isDownloading && pullingModel && (
<div className={`p-2.5 rounded-lg border ${cardClass}`}>
diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsx
index 57a488b5..adb9c184 100644
--- a/src/components/settings/SettingsPage.tsx
+++ b/src/components/settings/SettingsPage.tsx
@@ -1,5 +1,5 @@
import { useState, useEffect, type ReactNode } from 'react'
-import { ArrowLeft, RotateCcw, Sun, Moon, Mic, Volume2, Check, X, Loader2, Shield, ChevronRight, GraduationCap, Lock } from 'lucide-react'
+import { ArrowLeft, RotateCcw, Sun, Moon, Mic, Volume2, Check, X, Loader2, Shield, ChevronRight, GraduationCap, Lock, Sliders, Plug, Bot, Phone } from 'lucide-react'
import { motion, AnimatePresence } from 'framer-motion'
import { useSettingsStore } from '../../stores/settingsStore'
import { useUIStore } from '../../stores/uiStore'
@@ -153,7 +153,7 @@ function HfDownloadPathSetting() {
// ── ComfyUI Settings ────────────────────────────────────────────
function ComfyUISettings() {
- const [status, setStatus] = useState<{ running: boolean; found: boolean; path?: string; port?: number; host?: string; isLocal?: boolean; starting?: boolean } | null>(null)
+ const [status, setStatus] = useState<{ running: boolean; found: boolean; complete?: boolean; path?: string; port?: number; host?: string; isLocal?: boolean; starting?: boolean } | null>(null)
const [loading, setLoading] = useState(true)
const [customPath, setCustomPath] = useState('')
const [pathError, setPathError] = useState('')
@@ -163,6 +163,10 @@ function ComfyUISettings() {
const [customHost, setCustomHost] = useState('')
const [hostError, setHostError] = useState('')
const [hostSuccess, setHostSuccess] = useState(false)
+ // P14 Python install state for the Settings Install-ComfyUI flow.
+ const [installPhase, setInstallPhase] = useState<'idle' | 'python' | 'comfyui' | 'error'>('idle')
+ const [installLogs, setInstallLogs] = useState<string[]>([])
+ const [installErr, setInstallErr] = useState('')
useEffect(() => {
let cancelled = false
@@ -352,19 +356,99 @@ function ComfyUISettings() {
Restart
</button>
)}
- {!status?.found && (
+ {(!status?.found || status?.complete === false) && installPhase === 'idle' && (
<button
onClick={async () => {
+ const { backendCall } = await import('../../api/backend')
+ setInstallErr('')
+ setInstallLogs([])
+
+ // P14 pre-flight: ensure Python is on the box before
+ // pip-installing ComfyUI. The carcass case (status.complete
+ // === false) lands here too — Python may still be missing
+ // and the previous run died on the Microsoft Store stub.
+ let pythonOk = false
+ try {
+ const probe: any = await backendCall('python_check')
+ pythonOk = !!probe?.available
+ } catch { pythonOk = false }
+
+ if (!pythonOk) {
+ setInstallPhase('python')
+ setInstallLogs(['Installing Python 3.12 via winget…'])
+ try {
+ await backendCall('install_python')
+ } catch (err) {
+ setInstallPhase('error')
+ setInstallErr(err instanceof Error ? err.message : 'Could not start Python install')
+ return
+ }
+ pythonOk = await new Promise<boolean>((resolve) => {
+ const poll = setInterval(async () => {
+ try {
+ const data: any = await backendCall('install_python_status')
+ setInstallLogs(data.logs || [])
+ if (data.status === 'complete' || data.status === 'already_installed') {
+ clearInterval(poll); resolve(true)
+ } else if (data.status === 'error') {
+ clearInterval(poll)
+ const lastLog = (data.logs?.length ? data.logs[data.logs.length - 1] : '') as string
+ setInstallErr(lastLog || 'Python install failed')
+ resolve(false)
+ }
+ } catch { /* keep polling */ }
+ }, 2000)
+ })
+ if (!pythonOk) { setInstallPhase('error'); return }
+ }
+
+ setInstallPhase('comfyui')
+ setInstallLogs(['Installing ComfyUI…'])
try {
- const { backendCall } = await import('../../api/backend')
await backendCall('install_comfyui')
- } catch {}
+ const poll = setInterval(async () => {
+ try {
+ const data: any = await backendCall('install_comfyui_status')
+ setInstallLogs(data.logs || [])
+ if (data.status === 'complete') {
+ clearInterval(poll)
+ setInstallPhase('idle')
+ } else if (data.status === 'error') {
+ clearInterval(poll)
+ const lastLog = (data.logs?.length ? data.logs[data.logs.length - 1] : '') as string
+ setInstallErr(lastLog || 'ComfyUI install failed')
+ setInstallPhase('error')
+ }
+ } catch { /* keep polling */ }
+ }, 2000)
+ } catch (err) {
+ setInstallPhase('error')
+ setInstallErr(err instanceof Error ? err.message : 'Failed to start')
+ }
}}
className="px-2 py-1 rounded text-[0.6rem] bg-purple-500/10 text-purple-400 hover:bg-purple-500/20 transition-colors"
>
- Install ComfyUI
+ {status?.complete === false ? 'Re-install ComfyUI' : 'Install ComfyUI'}
</button>
)}
+ {installPhase !== 'idle' && (
+ <div className="w-full mt-2 space-y-1">
+ <div className="flex items-center gap-1.5 text-[0.6rem] text-gray-400">
+ {installPhase !== 'error' && <Loader2 size={10} className="animate-spin" />}
+ <span>
+ {installPhase === 'python' && 'Installing Python 3.12 (~30 MB)…'}
+ {installPhase === 'comfyui' && 'Installing ComfyUI…'}
+ {installPhase === 'error' && 'Install failed'}
+ </span>
+ </div>
+ {installLogs.length > 0 && (
+ <div className="bg-black/50 rounded p-1.5 max-h-24 overflow-y-auto font-mono text-[0.5rem] text-gray-500 space-y-0.5">
+ {installLogs.slice(-6).map((log, i) => <div key={i} className="truncate">{log}</div>)}
+ </div>
+ )}
+ {installErr && <p className="text-[0.55rem] text-red-400 whitespace-pre-line">{installErr}</p>}
+ </div>
+ )}
</div>
)}
</div>
@@ -438,6 +522,28 @@ function ClaudeCodeSettings() {
// ── Main Component ──────────────────────────────────────────────
+// P5 settings refactor: Top-level tabs replace the previous flat scroll of
+// 17 collapsibles. Each tab groups conceptually related Sections so users
+// don't have to scan the whole list to find one toggle. Mapping (kept in
+// sync with LU-Aufgaben.md / IMPLEMENTATION_NOTES.md):
+//
+// General → Appearance · Generation · Privacy · Onboarding · Updates
+// AI Backends → Providers · Model Storage · ComfyUI
+// Agent → Personas · Memory · Claude Code · Agent Permissions ·
+// Agent Workflows · MCP Servers · Search Provider
+// Voice & Remote → Speech · Remote Access
+//
+// Tab choice is persisted in localStorage so the user's last-used view
+// survives reloads.
+type SettingsTab = 'general' | 'backends' | 'agent' | 'voice-remote'
+const SETTINGS_TAB_KEY = 'lu-settings-tab'
+const SETTINGS_TABS: { id: SettingsTab; label: string; icon: ReactNode }[] = [
+ { id: 'general', label: 'General', icon: <Sliders size={11} /> },
+ { id: 'backends', label: 'AI Backends', icon: <Plug size={11} /> },
+ { id: 'agent', label: 'Agent', icon: <Bot size={11} /> },
+ { id: 'voice-remote', label: 'Voice & Remote', icon: <Phone size={11} /> },
+]
+
export function SettingsPage() {
const { settings, updateSettings, resetSettings } = useSettingsStore()
const { setView } = useUIStore()
@@ -445,6 +551,18 @@ export function SettingsPage() {
const [voices, setVoices] = useState<SpeechSynthesisVoice[]>([])
const [whisperStatus, setWhisperStatus] = useState<{ available: boolean; backend: string | null; error?: string } | null>(null)
const [whisperLoading, setWhisperLoading] = useState(true)
+ const [tab, setTab] = useState<SettingsTab>(() => {
+ if (typeof window === 'undefined') return 'general'
+ const stored = window.localStorage.getItem(SETTINGS_TAB_KEY)
+ return (stored === 'general' || stored === 'backends' || stored === 'agent' || stored === 'voice-remote')
+ ? stored
+ : 'general'
+ })
+ useEffect(() => {
+ if (typeof window !== 'undefined') {
+ try { window.localStorage.setItem(SETTINGS_TAB_KEY, tab) } catch {}
+ }
+ }, [tab])
const ttsSupported = typeof window !== 'undefined' && 'speechSynthesis' in window
@@ -477,215 +595,248 @@ export function SettingsPage() {
<h1 className="text-[0.8rem] font-semibold text-gray-800 dark:text-gray-200">Settings</h1>
</div>
- <Section title="Appearance">
- <div className="flex items-center justify-between">
- <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Theme</span>
- <div className="flex gap-1">
+ {/* P5: top-level tabs. Sticky so the user can switch tabs from
+ anywhere in a long Section without scrolling back up. */}
+ <div className="sticky top-0 z-10 -mx-4 px-4 pb-2 mb-2 bg-white/80 dark:bg-[#0a0a0a]/80 backdrop-blur supports-[backdrop-filter]:bg-white/60 dark:supports-[backdrop-filter]:bg-[#0a0a0a]/60 border-b border-gray-100 dark:border-white/[0.04]">
+ <div className="flex items-center gap-1 overflow-x-auto scrollbar-thin">
+ {SETTINGS_TABS.map(t => (
<button
- onClick={() => updateSettings({ theme: 'light' })}
- className={`flex items-center gap-1 px-2 py-1 rounded text-[0.65rem] transition-colors ${
- settings.theme === 'light' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'
+ key={t.id}
+ onClick={() => setTab(t.id)}
+ className={`shrink-0 inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-[0.65rem] font-medium transition-colors ${
+ tab === t.id
+ ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white'
+ : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-white/[0.04]'
}`}
>
- <Sun size={11} /> Light
+ {t.icon}
+ {t.label}
</button>
- <button
- onClick={() => updateSettings({ theme: 'dark' })}
- className={`flex items-center gap-1 px-2 py-1 rounded text-[0.65rem] transition-colors ${
- settings.theme === 'dark' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'
- }`}
- >
- <Moon size={11} /> Dark
- </button>
- </div>
+ ))}
</div>
- </Section>
-
- <Section title="Generation">
- <SliderControl label="Temperature" value={settings.temperature} min={0} max={2} step={0.1} onChange={(v) => updateSettings({ temperature: v })} />
- <SliderControl label="Top P" value={settings.topP} min={0} max={1} step={0.05} onChange={(v) => updateSettings({ topP: v })} />
- <SliderControl label="Top K" value={settings.topK} min={1} max={100} step={1} onChange={(v) => updateSettings({ topK: v })} />
- <div className="flex items-center justify-between">
- <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Max Tokens</span>
- <input
- type="number"
- value={settings.maxTokens}
- onChange={(e) => updateSettings({ maxTokens: parseInt(e.target.value) || 0 })}
- min={0}
- placeholder="0"
- className="w-20 px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-right text-gray-300 font-mono focus:outline-none focus:border-white/20"
- />
- </div>
- </Section>
-
- <Section title="Personas">
- <PersonaPanel />
- </Section>
-
- <Section title="Memory">
- <MemorySettings />
- </Section>
-
- <Section title="Providers">
- <ProviderSettings />
- </Section>
-
- <Section title="Model Storage">
- <HfDownloadPathSetting />
- </Section>
-
- <Section title="ComfyUI (Image & Video)">
- <ComfyUISettings />
- </Section>
-
- <Section title="Claude Code">
- <ClaudeCodeSettings />
- </Section>
-
- {FEATURE_FLAGS.AGENT_MODE && (
- <Section title="Agent Permissions">
- <PermissionSettings />
- <button
- onClick={() => useAgentModeStore.getState().resetTutorial()}
- className="text-[0.6rem] text-gray-500 hover:text-gray-300 transition-colors"
- >
- Reset tutorial
- </button>
- </Section>
- )}
+ </div>
- {FEATURE_FLAGS.AGENT_WORKFLOWS && (
- <Section title="Agent Workflows">
- <WorkflowSection />
+ {/* ── General tab ──────────────────────────────── */}
+ {tab === 'general' && (<>
+ <Section title="Appearance">
+ <div className="flex items-center justify-between">
+ <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Theme</span>
+ <div className="flex gap-1">
+ <button
+ onClick={() => updateSettings({ theme: 'light' })}
+ className={`flex items-center gap-1 px-2 py-1 rounded text-[0.65rem] transition-colors ${
+ settings.theme === 'light' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'
+ }`}
+ >
+ <Sun size={11} /> Light
+ </button>
+ <button
+ onClick={() => updateSettings({ theme: 'dark' })}
+ className={`flex items-center gap-1 px-2 py-1 rounded text-[0.65rem] transition-colors ${
+ settings.theme === 'dark' ? 'bg-gray-200 dark:bg-white/10 text-gray-900 dark:text-white' : 'text-gray-500 hover:text-gray-700 dark:hover:text-gray-300'
+ }`}
+ >
+ <Moon size={11} /> Dark
+ </button>
+ </div>
+ </div>
</Section>
- )}
- {FEATURE_FLAGS.AGENT_MODE && (
- <Section title="MCP Servers">
- <MCPServerSettings />
+ <Section title="Generation">
+ <SliderControl label="Temperature" value={settings.temperature} min={0} max={2} step={0.1} onChange={(v) => updateSettings({ temperature: v })} />
+ <SliderControl label="Top P" value={settings.topP} min={0} max={1} step={0.05} onChange={(v) => updateSettings({ topP: v })} />
+ <SliderControl label="Top K" value={settings.topK} min={1} max={100} step={1} onChange={(v) => updateSettings({ topK: v })} />
+ <div className="flex items-center justify-between">
+ <span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Max Tokens</span>
+ <input
+ type="number"
+ value={settings.maxTokens}
+ onChange={(e) => updateSettings({ maxTokens: parseInt(e.target.value) || 0 })}
+ min={0}
+ placeholder="0"
+ className="w-20 px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-right text-gray-300 font-mono focus:outline-none focus:border-white/20"
+ />
+ </div>
</Section>
- )}
- {FEATURE_FLAGS.AGENT_MODE && (
- <Section title="Search Provider">
- <div className="space-y-3">
- <div>
- <span className="text-[0.6rem] text-gray-500 block mb-1">Provider for Agent web_search</span>
- <div className="flex gap-1.5">
- {(['auto', 'brave', 'tavily'] as const).map(p => (
- <button
- key={p}
- onClick={() => updateSettings({ searchProvider: p })}
- className={`px-2.5 py-1 rounded-md text-[0.6rem] font-medium transition-all ${
- settings.searchProvider === p
- ? 'bg-white dark:bg-white/10 text-gray-900 dark:text-white shadow-sm border border-gray-200 dark:border-white/15'
- : 'text-gray-500 hover:text-gray-700 dark:hover:text-white bg-gray-100 dark:bg-white/5'
- }`}
- >
- {p === 'auto' ? 'Auto (SearXNG > DDG)' : p === 'brave' ? 'Brave Search' : 'Tavily'}
- </button>
- ))}
+ <Section title="Privacy">
+ <div className="space-y-2 py-1 text-[0.65rem] text-gray-500 dark:text-gray-400 leading-relaxed">
+ <div className="flex items-start gap-2">
+ <Lock size={12} className="mt-0.5 shrink-0 text-emerald-500" />
+ <div>
+ <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">100% local by default.</p>
+ <p>Chat, agent runs, image &amp; video generation all execute on your machine. No telemetry, no analytics, no model pings home. The only network calls LU makes unless you explicitly opt in are: update checks against GitHub Releases, and cloud provider APIs (OpenAI, Anthropic, etc.) that you configure yourself with your own API keys.</p>
</div>
</div>
- <div>
- <label className="text-[0.6rem] text-gray-500 block mb-1">Brave Search API Key</label>
- <input
- type="password"
- value={settings.braveApiKey}
- onChange={(e) => updateSettings({ braveApiKey: e.target.value })}
- placeholder="BSA-..."
- className="w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-[0.65rem] text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:border-gray-400 dark:focus:border-white/25"
- />
- <span className="text-[0.5rem] text-gray-500 mt-0.5 block">Free tier: 2000 queries/month. Get key at brave.com/search/api</span>
- </div>
- <div>
- <label className="text-[0.6rem] text-gray-500 block mb-1">Tavily API Key</label>
- <input
- type="password"
- value={settings.tavilyApiKey}
- onChange={(e) => updateSettings({ tavilyApiKey: e.target.value })}
- placeholder="tvly-..."
- className="w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-[0.65rem] text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:border-gray-400 dark:focus:border-white/25"
- />
- <span className="text-[0.5rem] text-gray-500 mt-0.5 block">AI-optimized search. Free tier: 1000 queries/month. Get key at tavily.com</span>
+ <div className="flex items-start gap-2 pt-1.5">
+ <Shield size={12} className="mt-0.5 shrink-0 text-emerald-500" />
+ <div>
+ <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">You own your data.</p>
+ <p>Conversations, memories, and generated media live in <code className="px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 font-mono text-[0.6rem]">%APPDATA%/Locally Uncensored</code> on Windows (or the equivalent on Linux/macOS). Back up the folder, move it between machines, or delete it — LU writes nothing else.</p>
+ </div>
</div>
</div>
</Section>
- )}
- <Section title="Speech">
- <div className="flex items-center gap-3 text-[0.65rem]">
- <span className="flex items-center gap-1">
- {whisperLoading ? <Loader2 size={10} className="animate-spin text-gray-500" /> : whisperStatus?.available ? <Check size={10} className="text-green-500" /> : <X size={10} className="text-red-500" />}
- <span className="text-gray-500">STT</span>
- </span>
- <span className="flex items-center gap-1">
- {ttsSupported ? <Check size={10} className="text-green-500" /> : <X size={10} className="text-red-500" />}
- <span className="text-gray-500">TTS</span>
- </span>
- </div>
- <InlineToggle label="TTS Enabled" enabled={voiceSettings.ttsEnabled} onChange={() => voiceSettings.updateVoiceSettings({ ttsEnabled: !voiceSettings.ttsEnabled })} icon={<Volume2 size={11} className="text-gray-500" />} />
- <div className="flex items-center justify-between">
- <span className="text-[0.7rem] text-gray-500">Voice</span>
- <select
- value={voiceSettings.ttsVoice}
- onChange={(e) => voiceSettings.updateVoiceSettings({ ttsVoice: e.target.value })}
- className="max-w-[180px] px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-gray-300 focus:outline-none"
- >
- <option value="">Default</option>
- {voices.map((v) => <option key={v.name} value={v.name}>{v.name}</option>)}
- </select>
- </div>
- <SliderControl label="Rate" value={voiceSettings.ttsRate} min={0.5} max={2} step={0.1} onChange={(v) => voiceSettings.updateVoiceSettings({ ttsRate: v })} />
- <SliderControl label="Pitch" value={voiceSettings.ttsPitch} min={0.5} max={2} step={0.1} onChange={(v) => voiceSettings.updateVoiceSettings({ ttsPitch: v })} />
- <InlineToggle label="Auto-send on Transcribe" enabled={voiceSettings.autoSendOnTranscribe} onChange={() => voiceSettings.updateVoiceSettings({ autoSendOnTranscribe: !voiceSettings.autoSendOnTranscribe })} icon={<Mic size={11} className="text-gray-500" />} />
- </Section>
-
- <Section title="Remote Access">
- <RemoteAccessSettings />
- </Section>
-
- <UpdateSection />
-
- <Section title="Privacy">
- <div className="space-y-2 py-1 text-[0.65rem] text-gray-500 dark:text-gray-400 leading-relaxed">
- <div className="flex items-start gap-2">
- <Lock size={12} className="mt-0.5 shrink-0 text-emerald-500" />
- <div>
- <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">100% local by default.</p>
- <p>Chat, agent runs, image &amp; video generation all execute on your machine. No telemetry, no analytics, no model pings home. The only network calls LU makes unless you explicitly opt in are: update checks against GitHub Releases, and cloud provider APIs (OpenAI, Anthropic, etc.) that you configure yourself with your own API keys.</p>
+ <Section title="Onboarding">
+ <div className="flex items-center justify-between py-1">
+ <div className="flex items-start gap-2">
+ <GraduationCap size={12} className="mt-0.5 shrink-0 text-gray-500" />
+ <div className="text-[0.65rem] text-gray-600 dark:text-gray-400 leading-relaxed">
+ Run the first-launch setup wizard again (hardware scan, recommended models, tool-calling tour).
+ </div>
</div>
+ <button
+ onClick={async () => {
+ useSettingsStore.getState().updateSettings({ onboardingDone: false })
+ try { await backendCall('set_onboarding_done', { done: false }) } catch {}
+ window.location.reload()
+ }}
+ className="ml-3 shrink-0 px-2.5 py-1 rounded-md text-[0.6rem] font-medium bg-white dark:bg-white/10 text-gray-800 dark:text-white hover:bg-gray-100 dark:hover:bg-white/15 border border-gray-200 dark:border-white/15 transition-colors"
+ >
+ Re-run onboarding
+ </button>
</div>
- <div className="flex items-start gap-2 pt-1.5">
- <Shield size={12} className="mt-0.5 shrink-0 text-emerald-500" />
- <div>
- <p className="text-gray-700 dark:text-gray-300 font-medium mb-0.5">You own your data.</p>
- <p>Conversations, memories, and generated media live in <code className="px-1 py-0.5 rounded bg-black/5 dark:bg-white/5 font-mono text-[0.6rem]">%APPDATA%/Locally Uncensored</code> on Windows (or the equivalent on Linux/macOS). Back up the folder, move it between machines, or delete it — LU writes nothing else.</p>
+ </Section>
+
+ <UpdateSection />
+ </>)}
+
+ {/* ── AI Backends tab ──────────────────────────── */}
+ {tab === 'backends' && (<>
+ <Section title="Providers" defaultOpen>
+ <ProviderSettings />
+ </Section>
+
+ <Section title="Model Storage">
+ <HfDownloadPathSetting />
+ </Section>
+
+ <Section title="ComfyUI (Image & Video)">
+ <ComfyUISettings />
+ </Section>
+ </>)}
+
+ {/* ── Agent tab ─────────────────────────────────── */}
+ {tab === 'agent' && (<>
+ <Section title="Personas">
+ <PersonaPanel />
+ </Section>
+
+ <Section title="Memory">
+ <MemorySettings />
+ </Section>
+
+ <Section title="Claude Code">
+ <ClaudeCodeSettings />
+ </Section>
+
+ {FEATURE_FLAGS.AGENT_MODE && (
+ <Section title="Agent Permissions">
+ <PermissionSettings />
+ <button
+ onClick={() => useAgentModeStore.getState().resetTutorial()}
+ className="text-[0.6rem] text-gray-500 hover:text-gray-300 transition-colors"
+ >
+ Reset tutorial
+ </button>
+ </Section>
+ )}
+
+ {FEATURE_FLAGS.AGENT_WORKFLOWS && (
+ <Section title="Agent Workflows">
+ <WorkflowSection />
+ </Section>
+ )}
+
+ {FEATURE_FLAGS.AGENT_MODE && (
+ <Section title="MCP Servers">
+ <MCPServerSettings />
+ </Section>
+ )}
+
+ {FEATURE_FLAGS.AGENT_MODE && (
+ <Section title="Search Provider">
+ <div className="space-y-3">
+ <div>
+ <span className="text-[0.6rem] text-gray-500 block mb-1">Provider for Agent web_search</span>
+ <div className="flex gap-1.5">
+ {(['auto', 'brave', 'tavily'] as const).map(p => (
+ <button
+ key={p}
+ onClick={() => updateSettings({ searchProvider: p })}
+ className={`px-2.5 py-1 rounded-md text-[0.6rem] font-medium transition-all ${
+ settings.searchProvider === p
+ ? 'bg-white dark:bg-white/10 text-gray-900 dark:text-white shadow-sm border border-gray-200 dark:border-white/15'
+ : 'text-gray-500 hover:text-gray-700 dark:hover:text-white bg-gray-100 dark:bg-white/5'
+ }`}
+ >
+ {p === 'auto' ? 'Auto (SearXNG > DDG)' : p === 'brave' ? 'Brave Search' : 'Tavily'}
+ </button>
+ ))}
+ </div>
+ </div>
+ <div>
+ <label className="text-[0.6rem] text-gray-500 block mb-1">Brave Search API Key</label>
+ <input
+ type="password"
+ value={settings.braveApiKey}
+ onChange={(e) => updateSettings({ braveApiKey: e.target.value })}
+ placeholder="BSA-..."
+ className="w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-[0.65rem] text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:border-gray-400 dark:focus:border-white/25"
+ />
+ <span className="text-[0.5rem] text-gray-500 mt-0.5 block">Free tier: 2000 queries/month. Get key at brave.com/search/api</span>
+ </div>
+ <div>
+ <label className="text-[0.6rem] text-gray-500 block mb-1">Tavily API Key</label>
+ <input
+ type="password"
+ value={settings.tavilyApiKey}
+ onChange={(e) => updateSettings({ tavilyApiKey: e.target.value })}
+ placeholder="tvly-..."
+ className="w-full px-2.5 py-1.5 rounded-lg bg-gray-100 dark:bg-white/5 border border-gray-200 dark:border-white/10 text-[0.65rem] text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:border-gray-400 dark:focus:border-white/25"
+ />
+ <span className="text-[0.5rem] text-gray-500 mt-0.5 block">AI-optimized search. Free tier: 1000 queries/month. Get key at tavily.com</span>
+ </div>
</div>
+ </Section>
+ )}
+ </>)}
+
+ {/* ── Voice & Remote tab ────────────────────────── */}
+ {tab === 'voice-remote' && (<>
+ <Section title="Speech" defaultOpen>
+ <div className="flex items-center gap-3 text-[0.65rem]">
+ <span className="flex items-center gap-1">
+ {whisperLoading ? <Loader2 size={10} className="animate-spin text-gray-500" /> : whisperStatus?.available ? <Check size={10} className="text-green-500" /> : <X size={10} className="text-red-500" />}
+ <span className="text-gray-500">STT</span>
+ </span>
+ <span className="flex items-center gap-1">
+ {ttsSupported ? <Check size={10} className="text-green-500" /> : <X size={10} className="text-red-500" />}
+ <span className="text-gray-500">TTS</span>
+ </span>
</div>
- </div>
- </Section>
-
- <Section title="Onboarding">
- <div className="flex items-center justify-between py-1">
- <div className="flex items-start gap-2">
- <GraduationCap size={12} className="mt-0.5 shrink-0 text-gray-500" />
- <div className="text-[0.65rem] text-gray-600 dark:text-gray-400 leading-relaxed">
- Run the first-launch setup wizard again (hardware scan, recommended models, tool-calling tour).
- </div>
+ <InlineToggle label="TTS Enabled" enabled={voiceSettings.ttsEnabled} onChange={() => voiceSettings.updateVoiceSettings({ ttsEnabled: !voiceSettings.ttsEnabled })} icon={<Volume2 size={11} className="text-gray-500" />} />
+ <div className="flex items-center justify-between">
+ <span className="text-[0.7rem] text-gray-500">Voice</span>
+ <select
+ value={voiceSettings.ttsVoice}
+ onChange={(e) => voiceSettings.updateVoiceSettings({ ttsVoice: e.target.value })}
+ className="max-w-[180px] px-1.5 py-0.5 rounded bg-transparent border border-white/8 text-[0.65rem] text-gray-300 focus:outline-none"
+ >
+ <option value="">Default</option>
+ {voices.map((v) => <option key={v.name} value={v.name}>{v.name}</option>)}
+ </select>
</div>
- <button
- onClick={async () => {
- useSettingsStore.getState().updateSettings({ onboardingDone: false })
- try { await backendCall('set_onboarding_done', { done: false }) } catch {}
- window.location.reload()
- }}
- className="ml-3 shrink-0 px-2.5 py-1 rounded-md text-[0.6rem] font-medium bg-white dark:bg-white/10 text-gray-800 dark:text-white hover:bg-gray-100 dark:hover:bg-white/15 border border-gray-200 dark:border-white/15 transition-colors"
- >
- Re-run onboarding
- </button>
- </div>
- </Section>
+ <SliderControl label="Rate" value={voiceSettings.ttsRate} min={0.5} max={2} step={0.1} onChange={(v) => voiceSettings.updateVoiceSettings({ ttsRate: v })} />
+ <SliderControl label="Pitch" value={voiceSettings.ttsPitch} min={0.5} max={2} step={0.1} onChange={(v) => voiceSettings.updateVoiceSettings({ ttsPitch: v })} />
+ <InlineToggle label="Auto-send on Transcribe" enabled={voiceSettings.autoSendOnTranscribe} onChange={() => voiceSettings.updateVoiceSettings({ autoSendOnTranscribe: !voiceSettings.autoSendOnTranscribe })} icon={<Mic size={11} className="text-gray-500" />} />
+ </Section>
+
+ <Section title="Remote Access">
+ <RemoteAccessSettings />
+ </Section>
+ </>)}
{/* ── Reset ──────────────────────────────────── */}
<div className="pt-3 pb-6">
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 43c39f08..24f98705 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -239,36 +239,11 @@ export interface OnboardingModel {
const HF_OB = (repo: string, file: string) => `https://huggingface.co/${repo}/resolve/main/${file}`
export const ONBOARDING_MODELS: OnboardingModel[] = [
- // The single curated "Recommended" pick — a tiny (~400 MB) instruct model
- // that fits on any machine, downloads in seconds, and gives the user a
- // working chat to verify their setup. Marking only ONE model as
- // recommended is intentional: the previous list had 6 large models all
- // tagged "Recommended", which made the badge meaningless and pushed
- // newcomers toward 5–16 GB downloads they didn't ask for. See LU-Aufgaben
- // P4. The pill is hidden in the UI when the user already has installed
- // models (they don't need a starter recommendation any more).
- { name: 'qwen2.5-0.5b', label: 'Qwen 2.5 0.5B (Starter)', description: 'Tiny instant-chat model — 400 MB, runs on anything. Great for first-test.', size: '0.4 GB', vram: '1 GB', vramGB: 1, recommended: true, agent: false, downloadUrl: HF_OB('bartowski/Qwen2.5-0.5B-Instruct-GGUF', 'Qwen2.5-0.5B-Instruct-Q4_K_M.gguf'), filename: 'Qwen2.5-0.5B-Instruct-Q4_K_M.gguf', sizeGB: 0.4 },
- // Uncensored (abliterated) — all GGUF downloads from HuggingFace
- { name: 'llama3.1-8b-abliterated-q5', label: 'Llama 3.1 8B', description: 'Fast & reliable all-rounder', size: '6 GB', vram: '6 GB', vramGB: 6, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/Meta-Llama-3.1-8B-Instruct-abliterated-GGUF', 'Meta-Llama-3.1-8B-Instruct-abliterated-Q5_K_M.gguf'), filename: 'Meta-Llama-3.1-8B-Instruct-abliterated-Q5_K_M.gguf', sizeGB: 6 },
- { name: 'qwen3-8b-abliterated', label: 'Qwen3 8B', description: 'Latest Qwen, great for coding', size: '5 GB', vram: '6 GB', vramGB: 6, uncensored: true, agent: true, downloadUrl: HF_OB('mradermacher/Qwen3-8B-abliterated-GGUF', 'Qwen3-8B-abliterated.Q4_K_M.gguf'), filename: 'Qwen3-8B-abliterated.Q4_K_M.gguf', sizeGB: 5 },
- { name: 'qwen3-14b-abliterated', label: 'Qwen3 14B', description: 'Very smart, fits 12GB GPU', size: '9 GB', vram: '12 GB', vramGB: 12, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/huihui-ai_Qwen3-14B-abliterated-GGUF', 'huihui-ai_Qwen3-14B-abliterated-Q4_K_M.gguf'), filename: 'huihui-ai_Qwen3-14B-abliterated-Q4_K_M.gguf', sizeGB: 9 },
- { name: 'gemma3-12b-abliterated', label: 'Gemma 3 12B', description: 'Google model, vision support', size: '8 GB', vram: '12 GB', vramGB: 12, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/mlabonne_gemma-3-12b-it-abliterated-GGUF', 'mlabonne_gemma-3-12b-it-abliterated-Q4_K_M.gguf'), filename: 'mlabonne_gemma-3-12b-it-abliterated-Q4_K_M.gguf', sizeGB: 8 },
- { name: 'mistral-nemo-abliterated', label: 'Mistral Nemo 12B', description: 'Strong multilingual model', size: '7 GB', vram: '8 GB', vramGB: 8, uncensored: true, downloadUrl: HF_OB('QuantFactory/Mistral-Nemo-Instruct-2407-abliterated-GGUF', 'Mistral-Nemo-Instruct-2407-abliterated.Q4_K_M.gguf'), filename: 'Mistral-Nemo-Instruct-2407-abliterated.Q4_K_M.gguf', sizeGB: 7 },
- { name: 'deepseek-r1-8b-abliterated', label: 'DeepSeek R1 8B', description: 'Reasoning & chain-of-thought', size: '5 GB', vram: '6 GB', vramGB: 6, uncensored: true, downloadUrl: HF_OB('mradermacher/DeepSeek-R1-Distill-Qwen-7B-abliterated-v2-GGUF', 'DeepSeek-R1-Distill-Qwen-7B-abliterated-v2.Q4_K_M.gguf'), filename: 'DeepSeek-R1-Distill-Qwen-7B-abliterated-v2.Q4_K_M.gguf', sizeGB: 5 },
- { name: 'phi4-abliterated', label: 'Phi-4 14B', description: 'Microsoft, great at math & logic', size: '9 GB', vram: '12 GB', vramGB: 12, uncensored: true, downloadUrl: HF_OB('mradermacher/phi-4-abliterated-GGUF', 'phi-4-abliterated.Q4_K_M.gguf'), filename: 'phi-4-abliterated.Q4_K_M.gguf', sizeGB: 8 },
- { name: 'mistral-small-abliterated', label: 'Mistral Small 24B', description: 'Powerful, needs 16GB+ VRAM', size: '14 GB', vram: '16 GB', vramGB: 16, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/huihui-ai_Mistral-Small-24B-Instruct-2501-abliterated-GGUF', 'huihui-ai_Mistral-Small-24B-Instruct-2501-abliterated-Q4_K_M.gguf'), filename: 'huihui-ai_Mistral-Small-24B-Instruct-2501-abliterated-Q4_K_M.gguf', sizeGB: 14 },
- { name: 'glm4.6-9b-abliterated', label: 'GLM 4.6 9B', description: 'Newest model, strong coding', size: '6 GB', vram: '8 GB', vramGB: 8, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/glm-4-9b-chat-abliterated-GGUF', 'glm-4-9b-chat-abliterated-Q4_K_M.gguf'), filename: 'glm-4-9b-chat-abliterated-Q4_K_M.gguf', sizeGB: 5 },
- { name: 'qwen2.5-7b-abliterated', label: 'Qwen 2.5 7B', description: 'Lightweight & capable', size: '5 GB', vram: '6 GB', vramGB: 6, uncensored: true, agent: true, downloadUrl: HF_OB('QuantFactory/Qwen2.5-7B-Instruct-abliterated-v2-GGUF', 'Qwen2.5-7B-Instruct-abliterated-v2.Q4_K_M.gguf'), filename: 'Qwen2.5-7B-Instruct-abliterated-v2.Q4_K_M.gguf', sizeGB: 5 },
- { name: 'llama3.3-70b-abliterated', label: 'Llama 3.3 70B', description: 'Maximum intelligence, needs 48GB', size: '42 GB', vram: '48 GB', vramGB: 48, uncensored: true, agent: true, downloadUrl: HF_OB('bartowski/Llama-3.3-70B-Instruct-abliterated-GGUF', 'Llama-3.3-70B-Instruct-abliterated-Q4_K_M.gguf'), filename: 'Llama-3.3-70B-Instruct-abliterated-Q4_K_M.gguf', sizeGB: 42 },
- // Mainstream (official, not abliterated) — all GGUF downloads
- { name: 'llama3.1-8b', label: 'Llama 3.1 8B', description: 'Meta general-purpose model', size: '5 GB', vram: '6 GB', vramGB: 6, agent: true, downloadUrl: HF_OB('bartowski/Meta-Llama-3.1-8B-Instruct-GGUF', 'Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf'), filename: 'Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf', sizeGB: 5 },
- { name: 'qwen3-8b', label: 'Qwen3 8B', description: 'Latest Qwen, coding & reasoning', size: '5 GB', vram: '6 GB', vramGB: 6, agent: true, downloadUrl: HF_OB('unsloth/Qwen3-8B-GGUF', 'Qwen3-8B-Q4_K_M.gguf'), filename: 'Qwen3-8B-Q4_K_M.gguf', sizeGB: 5 },
- { name: 'gemma3-12b', label: 'Gemma 3 12B', description: 'Google model, vision support', size: '8 GB', vram: '12 GB', vramGB: 12, agent: true, downloadUrl: HF_OB('unsloth/gemma-3-12b-it-GGUF', 'gemma-3-12b-it-Q4_K_M.gguf'), filename: 'gemma-3-12b-it-Q4_K_M.gguf', sizeGB: 8 },
- { name: 'phi4-14b', label: 'Phi-4 14B', description: 'Microsoft, math & logic', size: '9 GB', vram: '12 GB', vramGB: 12, downloadUrl: HF_OB('bartowski/phi-4-GGUF', 'phi-4-Q4_K_M.gguf'), filename: 'phi-4-Q4_K_M.gguf', sizeGB: 9 },
- { name: 'deepseek-r1-8b', label: 'DeepSeek R1 8B', description: 'Reasoning & chain-of-thought', size: '5 GB', vram: '6 GB', vramGB: 6, downloadUrl: HF_OB('unsloth/DeepSeek-R1-0528-Qwen3-8B-GGUF', 'DeepSeek-R1-0528-Qwen3-8B-Q4_K_M.gguf'), filename: 'DeepSeek-R1-0528-Qwen3-8B-Q4_K_M.gguf', sizeGB: 5 },
- { name: 'gemma4-e4b', label: 'Gemma 4 E4B', description: 'Google latest, lightweight MoE', size: '5 GB', vram: '4 GB', vramGB: 4, agent: true, downloadUrl: HF_OB('unsloth/gemma-4-E4B-it-GGUF', 'gemma-4-E4B-it-Q4_K_M.gguf'), filename: 'gemma-4-E4B-it-Q4_K_M.gguf', sizeGB: 5 },
- { name: 'gemma4-27b', label: 'Gemma 4 27B', description: 'Google flagship, native tools + vision', size: '16 GB', vram: '16 GB', vramGB: 16, agent: true, downloadUrl: HF_OB('unsloth/gemma-4-27b-it-GGUF', 'gemma-4-27b-it-Q4_K_M.gguf'), filename: 'gemma-4-27b-it-Q4_K_M.gguf', sizeGB: 16 },
- { name: 'qwen3.5-9b', label: 'Qwen 3.5 9B', description: 'Newest Qwen, strong reasoning + coding', size: '6 GB', vram: '8 GB', vramGB: 8, agent: true, downloadUrl: HF_OB('unsloth/Qwen3.5-9B-GGUF', 'Qwen3.5-9B-Q4_K_M.gguf'), filename: 'Qwen3.5-9B-Q4_K_M.gguf', sizeGB: 6 },
- { name: 'qwen3.5-9b-abliterated', label: 'Qwen 3.5 9B', description: 'Uncensored Qwen 3.5, strong reasoning', size: '6 GB', vram: '8 GB', vramGB: 8, uncensored: true, agent: true, downloadUrl: HF_OB('mradermacher/Qwen3.5-9B-abliterated-GGUF', 'Qwen3.5-9B-abliterated.Q4_K_M.gguf'), filename: 'Qwen3.5-9B-abliterated.Q4_K_M.gguf', sizeGB: 6 },
- { name: 'gemma4-27b-abliterated', label: 'Gemma 4 27B', description: 'Google flagship uncensored, tools + vision', size: '16 GB', vram: '16 GB', vramGB: 16, uncensored: true, agent: true, downloadUrl: HF_OB('LiconStudio/Gemma-4-27B-it-abliterated-GGUF', 'gemma-4-27B-it-abliterated-Q4_K_M.gguf'), filename: 'gemma-4-27B-it-abliterated-Q4_K_M.gguf', sizeGB: 16 },
+ // P4 / LU-Aufgaben: ONBOARDING shows exactly ONE model — the tiny ~400 MB
+ // Qwen 2.5 0.5B starter. The previous list of 22 entries (5–42 GB) was
+ // pure noise on first launch. Discoverability for everything else lives
+ // in the Model Manager → Discover tab (curated list + HuggingFace
+ // search). Onboarding is "give the user a working chat in 30 seconds";
+ // anything heavier comes after they've made it past the wizard.
+ { name: 'qwen2.5-0.5b', label: 'Qwen 2.5 0.5B (Starter)', description: 'Tiny instant-chat model — 400 MB, runs on anything. Great to verify your setup; pick bigger models from the Discover tab once you\'re in.', size: '0.4 GB', vram: '1 GB', vramGB: 1, recommended: true, agent: false, downloadUrl: HF_OB('bartowski/Qwen2.5-0.5B-Instruct-GGUF', 'Qwen2.5-0.5B-Instruct-Q4_K_M.gguf'), filename: 'Qwen2.5-0.5B-Instruct-Q4_K_M.gguf', sizeGB: 0.4 },
]