feat(ai-settings): rebind endpoint status dot to configured x enabled #19
Reference in New Issue
Block a user
Delete Branch "feat/ai-endpoint-status-dot-config-enabled"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The header dot on each AI endpoint card (Chat / LLM, Embeddings, Voice / STT) used to reflect the last 'Test endpoint' probe result (green/red/gray). That was misleading: a configured-and-enabled endpoint showed GRAY until someone manually clicked 'Test endpoint'.
Change
The dot now reads as the endpoint's health at a glance, derived synchronously from the live form values + the workspace feature toggle — never from a network probe.
Four-state model (
resolveCardStatus):ready(green) — configured AND enabledconfigured(yellow) — configured but the feature toggle is OFFoff(gray) — not configured (nothing to enable)warning(orange) — enabled but not configured (a real misconfiguration: the feature is on but will not work; surfaced instead of hidden under gray)'configured' = model field non-empty AND a base URL available (own OR inherited from chat for embeddings/STT). The API key is optional — local servers (Ollama, speaches) work without one. Source of truth is the live
form.valuesso the dot reacts as the admin types; persistent feature toggles drive the enabled axis.The 'Test endpoint' probe result stays as text under the button — it just no longer paints the dot.
A
Tooltipwith a human-readable label wraps the dot so the state is not color-only (colorblind-friendly).Verification
pnpm --filter client test— 62/62 pass (4 new tests forresolveCardStatus, incl. the misconfig(false,true)→"warning"branch).tsc --noEmiton client — clean.pnpm --filter client lint— pre-existing infrastructure failure (broken@tanstack/eslint-plugin-queryin node_modules, fails at config-load on a clean tree too); unrelated to this change.Out of scope
Keyboard a11y of the tooltip (the dot
<Box>has notabIndex) — the color state is also signalled by the adjacentSwitch, and the backlog asked only for a tooltip; left as a possible follow-up.The header dot on each AI endpoint card (Chat / LLM, Embeddings, Voice / STT) used to reflect the last 'Test endpoint' probe result - green/red/ gray. That was misleading: a configured-and-enabled endpoint showed GRAY until someone manually clicked 'Test endpoint'. The dot now reads as the endpoint's health at a glance, derived synchronously from the live form values + the workspace feature toggle - never from a network probe. Four-state model (resolveCardStatus): ready (green) - configured AND enabled configured (yellow) - configured but the feature toggle is OFF off (gray) - not configured (nothing to enable) warning (orange) - enabled but not configured (a real misconfig: the feature is on but will not work; surfaced instead of hidden under gray) 'configured' = model field non-empty AND a base URL available (own OR inherited from chat for embeddings/STT). The API key is optional - local servers (Ollama, speaches) work without one. Source of truth is the live form.values so the dot reacts as the admin types; the persistent feature toggles drive the enabled axis. The 'Test endpoint' probe result stays as text under the button - it just no longer paints the dot. A Tooltip with a human-readable label wraps the dot so the state is not color-only (colorblind-friendly). resolveCardStatus is exported and covered by a Vitest spec (4 cases, including the misconfig branch).