Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Move Assistant route controls to composer chrome
rcourtman3a58e6bff842
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex a9ceb56380..f2c2b68b99 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -705,6 +705,17 @@ runtime cost control, and shared AI transport surfaces.remain route-distinct: if the configured chat override resolves to the sameroute as the effective default or the already selected session model, thedrawer must not render a duplicate override action.+ Assistant route and control chrome belongs with the prompt surface, not the+ drawer title row. The referenced OpenCode source at commit+ `9ed17da55ab1f7360cc0e01075f763e27fa899e9`+ `packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx` derives the+ current provider label in `Prompt` lines 196-197 and renders agent, model,+ provider, and variant metadata in the prompt footer at lines 1452-1479; the+ session route injects that prompt through+ `packages/opencode/src/cli/cmd/tui/routes/session/index.tsx`+ `session_prompt` lines 1313-1333. Pulse adapts that by keeping the active+ model route selector, control-mode selector, and last-turn usage in composer+ chrome while the drawer header stays limited to drawer/session commands.Empty Assistant sessions are prompt-first transcript surfaces, not productmarketing or instruction panels. The referenced OpenCode source at commit`9ed17da55ab1f7360cc0e01075f763e27fa899e9`diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex a0a9655877..452e265fbf 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -1003,9 +1003,13 @@ not a replacement status card, CTA band, or page-local nested card.the current manual selection instead of rendering raw provider catalogs asplain select options. The picker must also constrain its dropdown andinternal result list to the available viewport height so settings model- catalogs remain usable on mobile and tablet layouts with bottom navigation.- Chat-owned selectors must reuse this shared picker instead of carrying a- parallel dropdown implementation. Recent/priority model sections, external+ catalogs remain usable on mobile and tablet layouts with bottom navigation,+ and it must flip above its trigger when prompt/composer chrome leaves+ insufficient room below. Caller-owned alignment may choose left or right+ anchoring, but the shared picker still owns the fixed-position dropdown,+ viewport cap, search shell, and result list sizing. Chat-owned selectors+ must reuse this shared picker instead of carrying a parallel dropdown+ implementation. Recent/priority model sections, externalopen-and-focus requests, selected older model visibility, route labels, andexplicit `provider:model` custom-route validation belong to the sharedpicker so Assistant, settings, and future model-selection surfaces do notdiff --git a/frontend-modern/src/components/AI/Chat/ModelSelector.tsx b/frontend-modern/src/components/AI/Chat/ModelSelector.tsxindex 61c6aa78d0..7100f80201 100644--- a/frontend-modern/src/components/AI/Chat/ModelSelector.tsx+++ b/frontend-modern/src/components/AI/Chat/ModelSelector.tsx@@ -92,9 +92,10 @@ export const ModelSelector: Component<ModelSelectorProps> = (props) => {error={props.error}openRequest={props.openRequest}onRefresh={props.onRefresh}+ align="left"buttonClass="flex flex-shrink-0 items-center gap-1.5 rounded-md border border-border bg-surface px-2.5 py-1.5 text-[11px] text-muted transition-colors hover:border-border hover:text-base-content"buttonLabelClass="max-w-[90px] truncate font-medium sm:max-w-[180px]"- dropdownClass="w-80"+ dropdownClass="w-80 max-w-[calc(100vw-2rem)]"/>);};diff --git a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsxindex 77e48f1219..a5598530e8 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx+++ b/frontend-modern/src/components/AI/Chat/__tests__/AIChat.test.tsx@@ -1245,18 +1245,25 @@ describe('AIChat', () => {expect(screen.getByLabelText('Close Pulse Assistant')).toBeInTheDocument();});- it('keeps the phone close button outside the scrollable assistant header actions', () => {+ it('keeps phone route controls in the composer chrome instead of the header actions', () => {setViewportWidth(375);renderChat();const closeButton = screen.getByRole('button', { name: 'Close Pulse Assistant' });const headerActions = screen.getByTestId('assistant-header-actions');+ const routeControls = screen.getByTestId('assistant-composer-route-controls');+ const modelSelector = screen.getByTestId('model-selector');+ const controlButton = screen.getByTitle('Control mode');expect(closeButton).toHaveClass('order-2');expect(headerActions).toHaveClass('order-3');expect(headerActions).toHaveClass('w-full');- expect(headerActions).toHaveClass('overflow-x-auto');+ expect(headerActions).not.toHaveClass('overflow-x-auto');expect(headerActions).not.toContainElement(closeButton);+ expect(headerActions).not.toContainElement(modelSelector);+ expect(headerActions).not.toContainElement(controlButton);+ expect(routeControls).toContainElement(modelSelector);+ expect(routeControls).toContainElement(controlButton);});});diff --git a/frontend-modern/src/components/AI/Chat/__tests__/ModelSelector.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/ModelSelector.test.tsxindex 9fd4399ace..8346f18dc8 100644--- a/frontend-modern/src/components/AI/Chat/__tests__/ModelSelector.test.tsx+++ b/frontend-modern/src/components/AI/Chat/__tests__/ModelSelector.test.tsx@@ -135,6 +135,17 @@ describe('ModelSelector', () => {expect(screen.getByPlaceholderText('Search or enter model ID')).toBeInTheDocument();});+ it('left-aligns the dropdown for composer chrome placement', () => {+ render(() => <ModelSelector models={SAMPLE_MODELS} selectedModel="" onModelSelect={vi.fn()} />);++ fireEvent.click(screen.getByTitle('Select model for this chat'));++ const dropdown = document.querySelector('[data-ai-model-picker] .fixed') as HTMLElement;+ expect(dropdown.style.left).toBe('0px');+ expect(dropdown.style.right).toBe('');+ expect(dropdown.className).toContain('max-w-[calc(100vw-2rem)]');+ });+it('opens dropdown and focuses search when an external recovery action requests it', async () => {const [openRequest, setOpenRequest] = createSignal(0);render(() => (diff --git a/frontend-modern/src/components/AI/Chat/index.tsx b/frontend-modern/src/components/AI/Chat/index.tsxindex d50673b814..11628efc99 100644--- a/frontend-modern/src/components/AI/Chat/index.tsx+++ b/frontend-modern/src/components/AI/Chat/index.tsx@@ -2183,7 +2183,7 @@ export const AIChat: Component<AIChatProps> = (props) => {</h2><div- class="order-3 -mx-1 flex w-full min-w-0 items-center gap-1.5 overflow-x-auto px-1 pb-0.5 sm:order-none sm:mx-0 sm:w-auto sm:flex-none sm:overflow-visible sm:px-0 sm:pb-0"+ class="order-3 flex w-full min-w-0 items-center gap-1.5 sm:order-none sm:w-auto sm:flex-none"data-testid="assistant-header-actions">{/* New chat */}@@ -2203,84 +2203,6 @@ export const AIChat: Component<AIChatProps> = (props) => {<span class="font-medium">{AI_CHAT_NEW_SESSION_SHORT_LABEL}</span></button>- {/* Model selector */}- <ModelSelector- models={aiRuntimeModels()}- selectedModel={chat.model()}- defaultModel={defaultModel()}- defaultModelLabel={defaultModelLabel()}- chatOverrideModel={chatOverrideModel()}- chatOverrideLabel={chatOverrideLabel()}- recentModelIds={recentModelIds()}- isLoading={aiRuntimeModelsLoading()}- error={aiRuntimeModelsError()}- openRequest={modelSelectorOpenRequest()}- onModelSelect={selectModel}- onRefresh={() => loadModels(true)}- />-- {/* Control mode toggle */}- <div class="relative" data-dropdown>- <button- onClick={() => setShowControlMenu(!showControlMenu())}- class={`flex flex-shrink-0 items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium rounded-md border transition-colors ${controlPresentation().pillClassName} ${controlSaving() ? 'opacity-70 cursor-wait' : 'hover:opacity-90'}`}- title="Control mode"- disabled={controlSaving()}- >- <span class={`h-1.5 w-1.5 rounded-full ${controlPresentation().dotClassName}`} />- <span>{controlPresentation().label}</span>- <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">- <path- stroke-linecap="round"- stroke-linejoin="round"- stroke-width="2"- d="M19 9l-7 7-7-7"- />- </svg>- </button>-- <Show when={showControlMenu()}>- <div class="absolute right-0 mt-2 w-60 rounded-md border border-border bg-surface shadow-sm z-50 overflow-hidden">- <div class="px-3 py-2 text-[11px] text-muted border-b border-border">- Default control mode- </div>- <button- class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'read_only' ? getAIChatControlLevelPresentation('read_only').selectedClassName : ''}`}- onClick={() => updateControlLevel('read_only')}- >- <div class="font-medium text-base-content">- {getAIChatControlLevelPresentation('read_only').label}- </div>- <div class="text-[11px] text-muted">- {getAIChatControlLevelPresentation('read_only').description}- </div>- </button>- <button- class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'controlled' ? getAIChatControlLevelPresentation('controlled').selectedClassName : ''}`}- onClick={() => updateControlLevel('controlled')}- >- <div class="font-medium text-base-content">- {getAIChatControlLevelPresentation('controlled').label}- </div>- <div class="text-[11px] text-muted">- {getAIChatControlLevelPresentation('controlled').description}- </div>- </button>- <button- class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'autonomous' ? getAIChatControlLevelPresentation('autonomous').selectedClassName : ''}`}- onClick={() => updateControlLevel('autonomous')}- >- <div class="font-medium text-base-content">- {getAIChatControlLevelPresentation('autonomous').label}- </div>- <div class="text-[11px] text-muted">- {getAIChatControlLevelPresentation('autonomous').description}- </div>- </button>- </div>- </Show>- </div>-{/* Session picker */}<div class="relative" data-dropdown><button@@ -2835,19 +2757,105 @@ export const AIChat: Component<AIChatProps> = (props) => {</div></div></form>- <Show when={lastAssistantUsage()}>- {(usage) => (- <div- class="mt-1.5 flex min-h-4 min-w-0 items-center justify-end gap-1.5 text-[10px] font-medium text-muted"- aria-label={usage().title}- title={usage().title}- >- <span class="truncate">{usage().label}</span>- <span class="h-1 w-1 shrink-0 rounded-full bg-border" aria-hidden="true" />- <span class="shrink-0">{usage().detail}</span>+ <div+ class="mt-1.5 flex min-h-7 min-w-0 flex-wrap items-center justify-between gap-2"+ data-testid="assistant-composer-chrome"+ >+ <div+ class="flex min-w-0 flex-1 flex-wrap items-center gap-1.5"+ data-testid="assistant-composer-route-controls"+ >+ <ModelSelector+ models={aiRuntimeModels()}+ selectedModel={chat.model()}+ defaultModel={defaultModel()}+ defaultModelLabel={defaultModelLabel()}+ chatOverrideModel={chatOverrideModel()}+ chatOverrideLabel={chatOverrideLabel()}+ recentModelIds={recentModelIds()}+ isLoading={aiRuntimeModelsLoading()}+ error={aiRuntimeModelsError()}+ openRequest={modelSelectorOpenRequest()}+ onModelSelect={selectModel}+ onRefresh={() => loadModels(true)}+ />++ <div class="relative" data-dropdown>+ <button+ onClick={() => setShowControlMenu(!showControlMenu())}+ class={`flex flex-shrink-0 items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-medium rounded-md border transition-colors ${controlPresentation().pillClassName} ${controlSaving() ? 'opacity-70 cursor-wait' : 'hover:opacity-90'}`}+ title="Control mode"+ disabled={controlSaving()}+ >+ <span class={`h-1.5 w-1.5 rounded-full ${controlPresentation().dotClassName}`} />+ <span>{controlPresentation().label}</span>+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M19 9l-7 7-7-7"+ />+ </svg>+ </button>++ <Show when={showControlMenu()}>+ <div class="absolute bottom-full left-0 z-50 mb-2 w-60 overflow-hidden rounded-md border border-border bg-surface shadow-sm">+ <div class="border-b border-border px-3 py-2 text-[11px] text-muted">+ Default control mode+ </div>+ <button+ class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'read_only' ? getAIChatControlLevelPresentation('read_only').selectedClassName : ''}`}+ onClick={() => updateControlLevel('read_only')}+ >+ <div class="font-medium text-base-content">+ {getAIChatControlLevelPresentation('read_only').label}+ </div>+ <div class="text-[11px] text-muted">+ {getAIChatControlLevelPresentation('read_only').description}+ </div>+ </button>+ <button+ class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'controlled' ? getAIChatControlLevelPresentation('controlled').selectedClassName : ''}`}+ onClick={() => updateControlLevel('controlled')}+ >+ <div class="font-medium text-base-content">+ {getAIChatControlLevelPresentation('controlled').label}+ </div>+ <div class="text-[11px] text-muted">+ {getAIChatControlLevelPresentation('controlled').description}+ </div>+ </button>+ <button+ class={`w-full text-left px-3 py-2.5 text-xs hover:bg-surface-hover transition-colors ${controlLevel() === 'autonomous' ? getAIChatControlLevelPresentation('autonomous').selectedClassName : ''}`}+ onClick={() => updateControlLevel('autonomous')}+ >+ <div class="font-medium text-base-content">+ {getAIChatControlLevelPresentation('autonomous').label}+ </div>+ <div class="text-[11px] text-muted">+ {getAIChatControlLevelPresentation('autonomous').description}+ </div>+ </button>+ </div>+ </Show></div>- )}- </Show>+ </div>++ <Show when={lastAssistantUsage()}>+ {(usage) => (+ <div+ class="flex min-h-4 min-w-0 items-center justify-end gap-1.5 text-[10px] font-medium text-muted"+ aria-label={usage().title}+ title={usage().title}+ >+ <span class="truncate">{usage().label}</span>+ <span class="h-1 w-1 shrink-0 rounded-full bg-border" aria-hidden="true" />+ <span class="shrink-0">{usage().detail}</span>+ </div>+ )}+ </Show>+ </div></div></Show></div>diff --git a/frontend-modern/src/components/shared/AIModelPicker.tsx b/frontend-modern/src/components/shared/AIModelPicker.tsxindex 2ef9b7aeee..ed8de034cf 100644--- a/frontend-modern/src/components/shared/AIModelPicker.tsx+++ b/frontend-modern/src/components/shared/AIModelPicker.tsx@@ -72,6 +72,7 @@ const DEFAULT_LIST_MAX_HEIGHT = 288;const MIN_DROPDOWN_MAX_HEIGHT = 120;const MOBILE_BOTTOM_CLEARANCE = 88;const DESKTOP_BOTTOM_CLEARANCE = 16;+const TOP_CLEARANCE = 16;const SEARCH_HEADER_HEIGHT = 52;const ERROR_ROW_HEIGHT = 36;const CUSTOM_RECENT_MODEL_DESCRIPTION = 'Recent custom model route';@@ -128,11 +129,13 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {const [showAllModels, setShowAllModels] = createSignal(false);const [searchQuery, setSearchQuery] = createSignal('');const [dropdownPosition, setDropdownPosition] = createSignal({+ bottom: 0,top: 0,left: 0,right: 0,maxHeight: DEFAULT_DROPDOWN_MAX_HEIGHT,listMaxHeight: DEFAULT_LIST_MAX_HEIGHT,+ placement: 'bottom' as 'bottom' | 'top',});let containerRef: HTMLDivElement | undefined;let buttonRef: HTMLButtonElement | undefined;@@ -246,7 +249,12 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {const dropdownStyle = createMemo(() => {const position = dropdownPosition();- const base = { top: `${position.top}px`, 'max-height': `${position.maxHeight}px` };+ const base = {+ ...(position.placement === 'top'+ ? { bottom: `${position.bottom}px` }+ : { top: `${position.top}px` }),+ 'max-height': `${position.maxHeight}px`,+ };if (props.align === 'left') {return { ...base, left: `${position.left}px` };}@@ -260,18 +268,26 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {const rect = buttonRef.getBoundingClientRect();const bottomClearance =window.innerWidth < 1024 ? MOBILE_BOTTOM_CLEARANCE : DESKTOP_BOTTOM_CLEARANCE;- const availableHeight = window.innerHeight - rect.bottom - bottomClearance;+ const availableBelow = window.innerHeight - rect.bottom - bottomClearance;+ const availableAbove = rect.top - TOP_CLEARANCE;+ const placement =+ availableBelow < MIN_DROPDOWN_MAX_HEIGHT && availableAbove > availableBelow+ ? 'top'+ : 'bottom';+ const availableHeight = placement === 'top' ? availableAbove : availableBelow;const maxHeight = Math.max(MIN_DROPDOWN_MAX_HEIGHT,Math.min(DEFAULT_DROPDOWN_MAX_HEIGHT, availableHeight),);const nonListHeight = SEARCH_HEADER_HEIGHT + (props.error ? ERROR_ROW_HEIGHT : 0);setDropdownPosition({+ bottom: window.innerHeight - rect.top + 4,top: rect.bottom + 4,left: rect.left,right: window.innerWidth - rect.right,maxHeight,listMaxHeight: Math.max(80, maxHeight - nonListHeight),+ placement,});};diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.tsindex 288b201d62..8e553ce79f 100644--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts@@ -254,7 +254,10 @@ describe('shared primitive guardrails', () => {expect(aiModelPickerSource).toContain("candidate.includes('://')");expect(aiModelPickerSource).toContain('separator <= 0 || separator === candidate.length - 1');expect(aiModelPickerSource).toContain('MOBILE_BOTTOM_CLEARANCE');- expect(aiModelPickerSource).toContain('availableHeight = window.innerHeight');+ expect(aiModelPickerSource).toContain('TOP_CLEARANCE');+ expect(aiModelPickerSource).toContain("placement: 'bottom' as 'bottom' | 'top'");+ expect(aiModelPickerSource).toContain("position.placement === 'top'");+ expect(aiModelPickerSource).toContain("availableHeight = placement === 'top'");expect(aiModelPickerSource).toContain("style={{ 'max-height': `${dropdownPosition().listMaxHeight}px` }}",);diff --git a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsxindex 479e44ed34..8ad70c2c0f 100644--- a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx+++ b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx@@ -116,6 +116,39 @@ describe('AIModelPicker', () => {expect(screen.getByRole('listbox').style.maxHeight).toBe('240px');});+ it('opens the dropdown above the button when composer chrome leaves no room below', () => {+ vi.spyOn(window, 'innerWidth', 'get').mockReturnValue(390);+ vi.spyOn(window, 'innerHeight', 'get').mockReturnValue(700);+ render(() => (+ <AIModelPicker+ models={models}+ selectedModel="openrouter:minimax/minimax-m2.5"+ onModelSelect={vi.fn()}+ title="Select shared default model"+ />+ ));++ const button = screen.getByTitle('Select shared default model');+ vi.spyOn(button, 'getBoundingClientRect').mockReturnValue({+ bottom: 668,+ height: 40,+ left: 16,+ right: 332,+ top: 628,+ width: 316,+ x: 16,+ y: 628,+ toJSON: () => ({}),+ } as DOMRect);++ fireEvent.click(button);++ const dropdown = document.querySelector('[data-ai-model-picker] .fixed') as HTMLElement;+ expect(dropdown.style.top).toBe('');+ expect(dropdown.style.bottom).toBe('76px');+ expect(dropdown.style.maxHeight).toBe('384px');+ });+it('searches the full catalog without requiring the older-model disclosure first', () => {render(() => (<AIModelPicker