Skip to content

armgit / Pulse

Public Imported from GitHub
0

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.

Separate Assistant model badge labels

rcourtman7c248b1c382d
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 8598301cda..8b6c77a024 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -763,7 +763,14 @@ runtime cost control, and shared AI transport surfaces.
`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
+ model metadata row uses an explicit `·` separator before the model at line
+ 1462 and before variants at line 1471, so adjacent metadata must not collapse
+ into fused labels. Pulse's shared model picker adapts that by separating
+ selected model labels from badges such as `default` in both visible text and
+ the button accessible name, so an OpenRouter default route renders as
+ `Qwen: Qwen3.7 Plus via OpenRouter · default` rather than
+ `OpenRouterdefault`.
+ 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
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 452e265fbf..cd724cdb6b 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1022,7 +1022,12 @@ not a replacement status card, CTA band, or page-local nested card.
the shared picker, System AI settings status strip, and per-surface
inherited-default descriptions must render OpenRouter-hosted provider
models with an explicit `via OpenRouter` route label while leaving direct
- DeepSeek/OpenAI/Anthropic/Gemini/Ollama selections unqualified.
+ DeepSeek/OpenAI/Anthropic/Gemini/Ollama selections unqualified. When a
+ selected route also carries a shared-default or override badge, the shared
+ picker owns that badge as separate metadata in both visible text and the
+ button accessible name; labels must render as `model via OpenRouter ·
+ default` instead of fusing provider and badge text such as
+ `OpenRouterdefault`.
Platform-first top-level pages registered through
`frontend-modern/src/App.tsx` must stay chrome-only and route through the
canonical app shell: each per-platform surface owns navigation and sub-tab
diff --git a/frontend-modern/src/components/shared/AIModelPicker.tsx b/frontend-modern/src/components/shared/AIModelPicker.tsx
index ed8de034cf..018fe472cd 100644
--- a/frontend-modern/src/components/shared/AIModelPicker.tsx
+++ b/frontend-modern/src/components/shared/AIModelPicker.tsx
@@ -246,6 +246,12 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {
}
return formatAIModelRouteLabel(selected);
});
+ const selectedBadge = createMemo(() => props.selectionBadge?.trim() || '');
+ const selectedButtonLabel = createMemo(() => {
+ const label = selectedLabel();
+ const badge = selectedBadge();
+ return badge ? `${label}, ${badge}` : label;
+ });
const dropdownStyle = createMemo(() => {
const position = dropdownPosition();
@@ -379,13 +385,22 @@ export const AIModelPicker: Component<AIModelPickerProps> = (props) => {
disabled={props.disabled}
aria-haspopup="listbox"
aria-expanded={isOpen()}
+ aria-label={selectedButtonLabel()}
class={props.buttonClass || DEFAULT_BUTTON_CLASS}
title={props.title || 'Select model'}
>
<MonitorIcon class="h-3.5 w-3.5 shrink-0" />
<span class={props.buttonLabelClass || DEFAULT_LABEL_CLASS}>{selectedLabel()}</span>
- <Show when={props.selectionBadge}>
- <span class="text-[10px] font-normal text-muted">{props.selectionBadge}</span>
+ <Show when={selectedBadge()}>
+ {(badge) => (
+ <>
+ <span class="text-[10px] font-normal text-muted" aria-hidden="true">
+ {' '}
+ ·{' '}
+ </span>
+ <span class="text-[10px] font-normal text-muted">{badge()}</span>
+ </>
+ )}
</Show>
<Show when={props.isLoading}>
<RefreshCwIcon class="h-3 w-3 shrink-0 animate-spin" />
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index 8e553ce79f..fd834b3ae8 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -251,6 +251,10 @@ describe('shared primitive guardrails', () => {
expect(aiModelPickerSource).toContain('(model) => !model.notable');
expect(aiModelPickerSource).toContain('Show ${hiddenModelCount()} older models');
expect(aiModelPickerSource).toContain('const MODEL_ROUTE_PROVIDER_RE');
+ expect(aiModelPickerSource).toContain('const selectedBadge = createMemo');
+ expect(aiModelPickerSource).toContain('const selectedButtonLabel = createMemo');
+ expect(aiModelPickerSource).toContain('aria-label={selectedButtonLabel()}');
+ expect(aiModelPickerSource).toContain("·{' '}");
expect(aiModelPickerSource).toContain("candidate.includes('://')");
expect(aiModelPickerSource).toContain('separator <= 0 || separator === candidate.length - 1');
expect(aiModelPickerSource).toContain('MOBILE_BOTTOM_CLEARANCE');
diff --git a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
index 8ad70c2c0f..2e73943ee2 100644
--- a/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/AIModelPicker.test.tsx
@@ -84,6 +84,26 @@ describe('AIModelPicker', () => {
expect(screen.getByText('DeepSeek: DeepSeek V4 Pro')).toBeInTheDocument();
});
+ it('separates selected model labels from selection badges in composer chrome', () => {
+ render(() => (
+ <AIModelPicker
+ models={models}
+ selectedModel=""
+ onModelSelect={vi.fn()}
+ emptySelectionLabel="Qwen: Qwen3.7 Plus via OpenRouter"
+ selectionBadge="default"
+ title="Select shared default model"
+ />
+ ));
+
+ const button = screen.getByTitle('Select shared default model');
+ expect(button.textContent).toContain('Qwen: Qwen3.7 Plus via OpenRouter · default');
+ expect(button.textContent).not.toContain('OpenRouterdefault');
+ expect(
+ screen.getByRole('button', { name: 'Qwen: Qwen3.7 Plus via OpenRouter, default' }),
+ ).toBe(button);
+ });
+
it('constrains the dropdown to the available mobile viewport height', () => {
vi.spyOn(window, 'innerWidth', 'get').mockReturnValue(760);
vi.spyOn(window, 'innerHeight', 'get').mockReturnValue(850);