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
feat(models): LM Studio in the local list is one slim line
purple99ca2b92c884
diff --git a/e2e/modellwahl-bilder.spec.ts b/e2e/modellwahl-bilder.spec.tsnew file mode 100644index 00000000..d891323d--- /dev/null+++ b/e2e/modellwahl-bilder.spec.ts@@ -0,0 +1,130 @@+import { test, expect, type Page } from '@playwright/test'+import { tauriMockInit, DEFAULT_ASSISTANT_REPLY, DEFAULT_MODEL_NAME, type TauriMockOptions } from './support/tauri-mock'+import { routeCloud, seedOnboardingDone, signInViaGate, cloudSwitch } from './support/cloud-mock'+import { mockModelsAnswer } from './support/chat-catalogue'++/**+ * Pictures of the built model pickers, for showing someone the result rather+ * than describing it. Nothing is asserted about the product here beyond what+ * a picture needs (the thing is on screen), so the spec skips unless a folder+ * is named:+ *+ * CI=1 LU_E2E_PORT=5311 LU_E2E_SHOT_DIR=/path/to/folder npx playwright test e2e/modellwahl-bilder.spec.ts+ *+ * Each state is written twice: the whole window, and the menu alone+ * (`-nur-menue`).+ */++const OUT = process.env.LU_E2E_SHOT_DIR+test.skip(!OUT, 'set LU_E2E_SHOT_DIR to write the pictures')++const OPTS: TauriMockOptions = {+ assistantReply: DEFAULT_ASSISTANT_REPLY,+ modelName: DEFAULT_MODEL_NAME,+ platform: 'windows',+}++type Theme = 'dark' | 'light'++async function setTheme(page: Page, theme: Theme) {+ if (theme === 'dark') return+ await page.addInitScript(() => {+ const key = 'chat-settings'+ const stored = JSON.parse(localStorage.getItem(key) || '{}')+ if (stored?.state?.settings) {+ stored.state.settings.theme = 'light'+ localStorage.setItem(key, JSON.stringify(stored))+ }+ })+}++async function bootIntoCloud(page: Page, theme: Theme, extra: Record<string, unknown> = {}) {+ await page.addInitScript(tauriMockInit, OPTS)+ await seedOnboardingDone(page)+ await setTheme(page, theme)+ await routeCloud(page, { license: 'active', access: true, mediaLive: true, paidPlan: true, ...extra })+ await page.route('**/api/inference/v1/models', (route) =>+ route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify(mockModelsAnswer()) }))+ await page.goto('/')+ await expect(cloudSwitch(page)).toBeVisible({ timeout: 30_000 })+ await signInViaGate(page)+ await expect(cloudSwitch(page)).toBeChecked({ timeout: 30_000 })+}++const trigger = (page: Page) => page.getByRole('button', { name: 'Select chat model', exact: true })+const menu = (page: Page) => page.getByTestId('model-picker-menu')++async function openChatPicker(page: Page) {+ await trigger(page).click()+ await expect(menu(page)).toBeVisible()+ await expect.poll(() => menu(page).evaluate((el) => getComputedStyle(el).opacity)).toBe('1')+}++async function shoot(page: Page, name: string, part = menu(page)) {+ // Let the open animation and the fonts settle.+ await page.waitForTimeout(400)+ await page.screenshot({ path: `${OUT}/${name}.png` })+ await part.screenshot({ path: `${OUT}/${name}-nur-menue.png` })+}++for (const theme of ['dark', 'light'] as const) {+ test(`cloud picker, ${theme}`, async ({ page }) => {+ await bootIntoCloud(page, theme)+ await openChatPicker(page)+ await expect(menu(page).getByRole('option').first()).toBeVisible()+ await shoot(page, `cloud-${theme}-kein-modell`)++ // With a model picked: the accent bar on the selected row, no hint line.+ await menu(page).getByRole('button', { name: /Qwen 3\.6 27B/ }).click()+ await openChatPicker(page)+ await shoot(page, `cloud-${theme}`)++ // The rates of one model.+ await menu(page).getByRole('option').filter({ hasText: 'Qwen 3.6 27B' }).getByRole('button', { name: 'Credit rates' }).click()+ await expect(page.getByTestId('model-rate-popover')).toBeVisible()+ await shoot(page, `cloud-${theme}-raten`)+ await page.keyboard.press('Escape')++ // A search and a pressed tag.+ await page.getByTestId('model-picker-search').fill('qwen 3')+ await shoot(page, `cloud-${theme}-suche`)+ await page.getByTestId('model-picker-search').fill('')+ await menu(page).locator('[data-chip="marked"]').click()+ await shoot(page, `cloud-${theme}-tag`)+ })+}++test('cloud picker in a small window', async ({ page }) => {+ await page.setViewportSize({ width: 640, height: 400 })+ await bootIntoCloud(page, 'dark')+ await openChatPicker(page)+ await shoot(page, 'cloud-dark-kleines-fenster-640x400')+})++for (const theme of ['dark', 'light'] as const) {+ test(`local list with the LM Studio line, ${theme}`, async ({ page }) => {+ await page.addInitScript(tauriMockInit, {+ ...OPTS,+ ollamaModels: ['qwen3:14b', 'gemma3:12b', 'llama3.1:8b', 'hermes3:8b', 'mistral-nemo:12b', 'deepseek-r1:14b'],+ } as TauriMockOptions)+ // LM Studio is on disk, its server is off.+ await page.addInitScript(() => {+ const w = window as unknown as { __TAURI_INTERNALS__: { invoke: (cmd: string, args: unknown, o: unknown) => Promise<unknown> } }+ const before = w.__TAURI_INTERNALS__.invoke+ w.__TAURI_INTERNALS__.invoke = (cmd, args, o) => {+ if (cmd === 'lmstudio_server_status') {+ return Promise.resolve({ running: false, port: 1234, lms_present: true, models_detected: true, model_count: 7 })+ }+ return before(cmd, args, o)+ }+ })+ await seedOnboardingDone(page)+ await setTheme(page, theme)+ await routeCloud(page, { license: 'none', access: false, mediaLive: true })+ await page.goto('/')+ await page.getByRole('button', { name: /New Chat/i }).first().click()+ await openChatPicker(page)+ await expect(page.getByTestId('lmstudio-status-line')).toBeVisible()+ await shoot(page, `lokal-lmstudio-zeile-${theme}`)+ })+}diff --git a/src/components/models/ModelSelector.tsx b/src/components/models/ModelSelector.tsxindex 9aa78893..1abdb9a0 100644--- a/src/components/models/ModelSelector.tsx+++ b/src/components/models/ModelSelector.tsx@@ -2,7 +2,7 @@ import { useState, useRef, useEffect } from 'react'import { usePopoverPlatz } from '../../hooks/usePopoverPlatz'import { useDismissOnEscape } from '../../hooks/useDismissOnEscape'import { motion, AnimatePresence } from 'framer-motion'-import { AlertTriangle, Ban, ChevronDown, Loader2, Power, PlayCircle, Settings as SettingsIcon, Wrench, X, Cloud } from 'lucide-react'+import { AlertTriangle, Ban, ChevronDown, Loader2, Power, Settings as SettingsIcon, Wrench, X, Cloud } from 'lucide-react'import { useModels } from '../../hooks/useModels'import { useModelStore } from '../../stores/modelStore'import { useProviderStore } from '../../stores/providerStore'@@ -175,23 +175,17 @@ export interface LmStudioServerStatus {model_count: number}-// Session-scope dismiss flag. Lives at module-level on purpose: the-// LmStudioServerHint component unmounts when the dropdown closes, so a-// useState reset would resurface the hint on every reopen. Module-// state survives unmount/remount within the same LU run, and resets to-// false when the user relaunches LU (the module reloads from scratch).-// Not persisted to localStorage so a forgotten-to-start server gets-// flagged again next launch.-let LM_HINT_DISMISSED_THIS_SESSION = false--function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {+// One line with a state dot, a short sentence and a text button (David,+// 05.10.2026). It used to be a box of three text blocks and a full-width+// button, about as tall as five model rows. What the click does is unchanged.+function LmStudioStatusLine({ onStarted }: { onStarted: () => void }) {const [status, setStatus] = useState<LmStudioServerStatus | null>(null)const [starting, setStarting] = useState(false)const [startError, setStartError] = useState('')- const [dismissed, setDismissed] = useState(LM_HINT_DISMISSED_THIS_SESSION)// Starting the server also hands LM Studio the local backend slot (see// lib/lmstudio-backend-adopt). When the built-in engine holds that slot the- // user learns it here, before the click, together with the way back.+ // user learns it before the click, together with the way back: in the+ // tooltip of the button, the line itself stays one line.const replacesBuiltinEngine = useProviderStore((s) => adoptionReplacesBuiltinEngine(s.providers.openai))useEffect(() => {@@ -206,7 +200,7 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {// running, models are already in the list; if neither lms.exe nor any// models are present, the user just doesn't have LM Studio.const detected = !!status && (status.lms_present || status.models_detected)- if (!status || status.running || !detected || dismissed) return null+ if (!status || status.running || !detected) return nullconst handleStart = async (e: React.MouseEvent) => {e.stopPropagation()@@ -216,7 +210,7 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {try {await backendCall('start_lmstudio_server')// The CLI takes a second or two to bind 1234, poll status- // briefly so the banner replaces itself with the models list+ // briefly so the line replaces itself with the models list// instead of leaving the spinner spinning forever.for (let i = 0; i < 8; i++) {await new Promise(r => setTimeout(r, 750))@@ -224,11 +218,11 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {if (fresh) {setStatus(fresh)if (fresh.running) {- // A running server is only half of what the sentence above- // promises. The picker lists ENABLED provider slots, so without- // this the models stay invisible and the button leads into a dead- // end (Nebenbefund 4, R8 re-measure). Same call the- // BackendSelector makes, no LM-Studio-only path.+ // A running server is only half of what the line promises. The+ // picker lists ENABLED provider slots, so without this the models+ // stay invisible and the button leads into a dead end+ // (Nebenbefund 4, R8 re-measure). Same call the BackendSelector+ // makes, no LM-Studio-only path.const update = lmStudioSlotUpdate(useProviderStore.getState().providers.openai)if (update) {useProviderStore.getState().setProviderConfig('openai', update)@@ -244,13 +238,11 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {}}} catch (e) {- // Hier stand `catch (e: any)` mit `e?.message`. Das las genau EINE Sorte- // Fehler: ein `Error`-Objekt. Tauris `invoke` lehnt aber mit einem STRING- // ab (die Rust-Seite gibt `Result<_, String>` zurueck), im ausgelieferten- // Programm hatte `e.message` deshalb nie einen Wert, und der Grund des- // Fehlschlags wurde jedes Mal durch das pauschale „Start failed" ersetzt.- // `detailOf` ist die Stelle, an der dieses Projekt genau diese Frage schon- // beantwortet (lib/error-text.ts): String, Error oder sonst etwas.+ // Tauris `invoke` lehnt mit einem STRING ab (die Rust-Seite gibt+ // `Result<_, String>` zurueck), ein `e.message` haette im ausgelieferten+ // Programm nie einen Wert. `detailOf` ist die Stelle, an der dieses+ // Projekt genau diese Frage beantwortet (lib/error-text.ts): String,+ // Error oder sonst etwas.const detail = detailOf(e)setStartError(detail ? detail.slice(0, 80) : 'Start failed')} finally {@@ -258,39 +250,48 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {}}+ const sentence = lmStudioLineText(status.model_count, starting, startError !== '')return (- <div className="relative px-2.5 py-2 border-b border-black/[0.06] dark:border-white/[0.04] bg-black/[0.03] dark:bg-white/[0.03]">- <button- onClick={(e) => { e.stopPropagation(); LM_HINT_DISMISSED_THIS_SESSION = true; setDismissed(true) }}- aria-label="Dismiss (returns on next launch)"- title="Dismiss (returns on next launch)"- className="absolute top-1 right-1 p-1 rounded text-gray-500 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-black/[0.06] dark:hover:bg-white/[0.08] transition-colors"- >- <X size={10} />- </button>- <p className="t-micro text-gray-600 dark:text-gray-300 leading-snug mb-1.5 pr-5">- LM Studio is installed ({status.model_count} model{status.model_count === 1 ? '' : 's'} on disk) but its server isn't running. Start it to pick LM Studio models here.- </p>- <button- onClick={handleStart}- disabled={starting}- className="w-full flex items-center justify-center gap-1.5 px-2 py-1 rounded t-micro bg-black/[0.06] dark:bg-white/[0.06] hover:bg-black/[0.1] dark:hover:bg-white/[0.12] text-gray-700 dark:text-gray-200 transition-colors disabled:opacity-50"- >- {starting ? <Loader2 size={10} className="animate-spin" /> : <PlayCircle size={10} />}- <span>{starting ? 'Starting LM Studio server…' : 'Start LM Studio Server'}</span>- </button>- {replacesBuiltinEngine && (- <p className="text-[0.55rem] text-gray-500 dark:text-gray-400 mt-1 leading-snug">- This also makes LM Studio your local chat backend in place of the LU Engine. You can switch back under Settings, AI Backends, Providers.- </p>- )}- {startError && (- <p className="text-[0.55rem] text-red-600/80 dark:text-red-300/70 mt-1 leading-snug">{startError}</p>+ <div+ data-testid="lmstudio-status-line"+ data-state={starting ? 'starting' : startError ? 'failed' : 'off'}+ className={`lu-picker-service${startError ? ' is-err' : ''}`}+ >+ {starting+ ? <Loader2 size={8} className="shrink-0 animate-spin" />+ : <span className={`lu-picker-dot${startError ? ' is-err' : ''}`} />}+ {/* Why the start failed, in the server's own words, behind the line. */}+ <span className="st" title={startError || sentence}>{sentence}</span>+ {!starting && (+ <button+ type="button"+ className="lu-picker-text-btn"+ onClick={handleStart}+ title={lmStudioStartTitle(replacesBuiltinEngine)}+ >+ {startError ? 'Retry' : 'Start'}+ </button>)}</div>)}+/** What the LM Studio line reads in each of its three states. */+export function lmStudioLineText(modelCount: number, starting: boolean, failed: boolean): string {+ if (starting) return 'LM Studio server starting'+ if (failed) return 'LM Studio server did not start'+ return `LM Studio server off, ${modelCount} ${modelCount === 1 ? 'model' : 'models'} on disk`+}++/** The tooltip of "Start". The consequence of the click stands here and+ * nowhere in the line: with the LU Engine in the local slot, starting LM+ * Studio takes that slot over. */+export function lmStudioStartTitle(replacesBuiltinEngine: boolean): string {+ return replacesBuiltinEngine+ ? 'Start the LM Studio server to pick its models here. This also makes LM Studio your local chat backend in place of the LU Engine. You can switch back under Settings, AI Backends, Providers.'+ : 'Start the LM Studio server to pick its models here.'+}+// ── Badge configs ─────────────────────────────────────────────const TYPE_COLOR: Record<string, string> = {@@ -1548,10 +1549,12 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy</div>)}- {/* Bug Q v2.4.7, surface "Start LM Studio Server" inline when- LM Studio is on disk but its server is off. wakeywakeynow's- "can't choose any models i have installed" symptom. */}- <LmStudioServerHint onStarted={fetchModels} />+ {/* Bug Q v2.4.7: LM Studio is on disk but its server is off.+ wakeywakeynow's "can't choose any models i have installed"+ symptom. One line with a "Start" button. Local mode only: in+ Cloud the list shows hosted models, and what the line promises+ (pick LM Studio models here) would not come true there. */}+ <LmStudioStatusLine onStarted={fetchModels} />{/* K6: grouping threw and was caught above instead of crashing thewhole chat view. Says so, in the dropdown itself, with a waydiff --git a/src/components/models/__tests__/lmstudio-status-line.test.tsx b/src/components/models/__tests__/lmstudio-status-line.test.tsxnew file mode 100644index 00000000..316c95fe--- /dev/null+++ b/src/components/models/__tests__/lmstudio-status-line.test.tsx@@ -0,0 +1,180 @@+// @vitest-environment jsdom+/**+ * LM Studio in the local model list is one slim line.+ *+ * David, 05.10.2026: the box with three text blocks and a full-width button+ * (about 145 px, as tall as five model rows) becomes a single line: a state+ * dot, a short sentence, a small "Start" button. That starting it makes LM+ * Studio the local chat backend is said in the tooltip of the button only.+ * What the button does is unchanged.+ *+ * Run: npx vitest run src/components/models/__tests__/lmstudio-status-line.test.tsx+ */+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'+import { createElement } from 'react'+import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'+import type { AIModel } from '../../../types/models'+import type { ProviderConfig } from '../../../api/providers/types'++const MODELS: AIModel[] = [{+ name: 'qwen3:8b', model: 'qwen3:8b', size: 0, type: 'text', provider: 'ollama', providerName: 'Ollama',+} as AIModel]++const fetchModels = vi.fn(async () => {})+vi.mock('../../../hooks/useModels', () => ({+ useModels: () => ({ models: MODELS, activeModel: 'qwen3:8b', setActiveModel: vi.fn(), fetchModels }),+}))+vi.mock('../../../api/lmstudio', () => ({+ loadLmStudioModel: vi.fn(async () => {}),+ unloadLmStudioModel: vi.fn(async () => {}),+ listLoadedLmStudioModels: vi.fn(async () => [] as string[]),+}))+vi.mock('../../../api/ollama', () => ({+ listRunningModels: vi.fn(async () => [] as string[]),+ loadModel: vi.fn(async () => {}),+ unloadModel: vi.fn(async () => {}),+ unloadAllModels: vi.fn(async () => {}),+}))+const backendCall = vi.fn(async (_cmd: string): Promise<unknown> => null)+vi.mock('../../../api/backend', () => ({ backendCall: (cmd: string) => backendCall(cmd) }))+vi.mock('../../../api/builtin-ensure', () => ({ diagnoseBuiltinEngine: vi.fn(async () => null) }))++const { ModelSelector, lmStudioLineText, lmStudioStartTitle } = await import('../ModelSelector')+const { useProviderStore } = await import('../../../stores/providerStore')+const { useSettingsStore } = await import('../../../stores/settingsStore')+const { useModelStore } = await import('../../../stores/modelStore')+const { DEFAULT_SETTINGS } = await import('../../../lib/constants')++const OFF = { running: false, port: 1234, lms_present: true, models_detected: true, model_count: 7 }+const RUNNING = { ...OFF, running: true }++const slot = (extra: Partial<ProviderConfig>): ProviderConfig => ({+ id: 'openai', name: 'LU Engine', enabled: true, baseUrl: 'http://127.0.0.1:8127/v1',+ apiKey: '', isLocal: true, managed: true, ...extra,+})+const setSlot = (config: ProviderConfig) =>+ useProviderStore.setState((s) => ({ providers: { ...s.providers, openai: config } }))++const line = () => screen.queryByTestId('lmstudio-status-line')+const startButton = () => screen.getByRole('button', { name: 'Start' })++/** Open the menu and let the status probe answer. */+async function open(status: unknown, mode: 'local' | 'cloud' = 'local') {+ let serverStatus = status+ backendCall.mockImplementation(async (cmd) => (cmd === 'lmstudio_server_status' ? serverStatus : null))+ useSettingsStore.setState({ settings: { ...DEFAULT_SETTINGS, appMode: mode } })+ render(createElement(ModelSelector))+ await act(async () => { fireEvent.click(screen.getByLabelText('Select chat model')) })+ return { setStatus: (s: unknown) => { serverStatus = s } }+}++beforeEach(() => {+ cleanup()+ backendCall.mockReset()+ fetchModels.mockClear()+ useModelStore.setState({ foldedRows: null, inventoryLoaded: true } as never)+ setSlot(slot({}))+ useProviderStore.setState({ engineOptedOut: false })+})+afterEach(() => { vi.useRealTimers(); cleanup() })++describe('the sentence', () => {+ it('names the state and what is on disk, in one short line', () => {+ expect(lmStudioLineText(7, false, false)).toBe('LM Studio server off, 7 models on disk')+ expect(lmStudioLineText(1, false, false)).toBe('LM Studio server off, 1 model on disk')+ expect(lmStudioLineText(7, true, false)).toBe('LM Studio server starting')+ expect(lmStudioLineText(7, false, true)).toBe('LM Studio server did not start')+ })++ it('says what "Start" replaces only in the tooltip, and only when it replaces something', () => {+ expect(lmStudioStartTitle(true)).toContain('This also makes LM Studio your local chat backend in place of the LU Engine.')+ expect(lmStudioStartTitle(true)).toContain('You can switch back under Settings, AI Backends, Providers.')+ expect(lmStudioStartTitle(false)).toBe('Start the LM Studio server to pick its models here.')+ })+})++describe('the line in the local list', () => {+ it('is one line: a dot, the sentence, a small Start button', async () => {+ await open(OFF)+ const el = line()!+ expect(el.className).toContain('lu-picker-service')+ expect(el.getAttribute('data-state')).toBe('off')+ expect(el.querySelector('.lu-picker-dot')).toBeTruthy()+ expect(el.querySelector('.st')!.textContent).toBe('LM Studio server off, 7 models on disk')+ expect(el.querySelectorAll('button')).toHaveLength(1)+ expect(startButton().className).toContain('lu-picker-text-btn')+ // Nothing of the old box: no paragraphs, no wide button, no dismiss.+ expect(el.querySelectorAll('p')).toHaveLength(0)+ expect(el.textContent).toBe('LM Studio server off, 7 models on disk' + 'Start')+ expect(screen.queryByLabelText(/Dismiss \(returns on next launch\)/)).toBeNull()+ })++ it('keeps the backend sentence out of the line and in the tooltip of the button', async () => {+ await open(OFF)+ expect(line()!.textContent).not.toMatch(/chat backend/)+ expect(startButton().getAttribute('title')).toContain('This also makes LM Studio your local chat backend')+ })++ it('does not threaten a takeover when the LU Engine does not hold the slot', async () => {+ setSlot(slot({ name: 'LM Studio', managed: false, baseUrl: 'http://localhost:1234/v1' }))+ await open(OFF)+ expect(startButton().getAttribute('title')).toBe('Start the LM Studio server to pick its models here.')+ })++ it('stays away when the server runs, and when LM Studio is not on this machine', async () => {+ await open(RUNNING)+ expect(line()).toBeNull()+ cleanup()+ await open({ running: false, port: 1234, lms_present: false, models_detected: false, model_count: 0 })+ expect(line()).toBeNull()+ })++ it('stays away in Cloud mode, where the list holds hosted models only', async () => {+ await open(OFF, 'cloud')+ expect(line()).toBeNull()+ })++ it('leaves the local list itself as it was: rows as buttons under it', async () => {+ await open(OFF)+ const menu = screen.getByTestId('model-picker-menu')+ expect(menu.getAttribute('data-picker')).toBe('local')+ expect(menu.querySelectorAll('[role="button"]')).toHaveLength(1)+ expect(menu.querySelector('[role="option"]')).toBeNull()+ expect(screen.queryByTestId('model-picker-search')).toBeNull()+ })+})++describe('Start', () => {+ it('starts the server, hands LM Studio the slot and reloads the list, as before', async () => {+ vi.useFakeTimers()+ const probe = await open(OFF)+ probe.setStatus(RUNNING)+ await act(async () => { fireEvent.click(startButton()) })+ expect(backendCall).toHaveBeenCalledWith('start_lmstudio_server')+ expect(line()!.getAttribute('data-state')).toBe('starting')+ expect(line()!.querySelector('.st')!.textContent).toBe('LM Studio server starting')+ expect(screen.queryByRole('button', { name: 'Start' })).toBeNull()+ await act(async () => { await vi.advanceTimersByTimeAsync(800) })+ expect(fetchModels).toHaveBeenCalled()+ const openai = useProviderStore.getState().providers.openai+ expect(openai.managed).toBe(false)+ expect(openai.baseUrl).toContain('1234')+ // The server runs: the line has done its job and is gone.+ expect(line()).toBeNull()+ })++ it('turns red and offers Retry when the start fails, with the reason behind the sentence', async () => {+ await open(OFF)+ backendCall.mockImplementation(async (cmd) => {+ if (cmd === 'start_lmstudio_server') throw 'lms: command not found'+ return OFF+ })+ await act(async () => { fireEvent.click(startButton()) })+ const el = line()!+ expect(el.getAttribute('data-state')).toBe('failed')+ expect(el.className).toContain('is-err')+ expect(el.querySelector('.st')!.textContent).toBe('LM Studio server did not start')+ expect(el.querySelector('.st')!.getAttribute('title')).toBe('lms: command not found')+ expect(screen.getByRole('button', { name: 'Retry' })).toBeTruthy()+ })+})diff --git a/src/index.css b/src/index.cssindex 23a6d927..dce52059 100644--- a/src/index.css+++ b/src/index.css@@ -1017,10 +1017,11 @@ input:is(plus the one accent, state dots in green, grey and red, no yellow. Boththemes are set here through variables, so neither component names a colourof its own. Same classes and values as the web app (globals.css). */-/* The rate popover is lifted out to the body, so it brings the palette- along. So does a tag. */+/* The service line stands in the local list and the rate popover is lifted+ out to the body, so each brings the palette along. So does a tag. */.lu-picker,.lu-picker-tag,+.lu-picker-service,.lu-picker-rate {--pk-sheet: var(--color-lu-overlay);--pk-edge: rgba(255, 255, 255, 0.08);@@ -1040,6 +1041,7 @@ input:is(}.light .lu-picker,.light .lu-picker-tag,+.light .lu-picker-service,.light .lu-picker-rate {--pk-sheet: #ffffff;--pk-edge: rgba(0, 0, 0, 0.1);@@ -1188,6 +1190,23 @@ input:is(.lu-picker-head .n { margin-left: auto; font-variant-numeric: tabular-nums; opacity: 0.8; }div + div > .lu-picker-head { margin-top: 2px; }+/* A local service in one line: state dot, a short sentence, a text button.+ Stands above the local model list, which keeps its own look. */+.lu-picker-service {+ flex: none;+ min-height: 24px;+ display: flex;+ align-items: center;+ gap: 7px;+ padding: 0 8px 0 12px;+ border-bottom: 1px solid var(--pk-hair);+ font-size: var(--text-label);+ color: var(--pk-t2);+}+.lu-picker-service .st { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+.lu-picker-service.is-err .st { color: var(--pk-err); }+.lu-picker-service .lu-picker-text-btn { border: 1px solid var(--pk-edge); color: var(--pk-t1); }+.lu-picker-row {position: relative;display: flex;