Fix hardcoded Model status to reflect runtime state#46
Fix hardcoded Model status to reflect runtime state#46
Conversation
The Model status card always showed "Ready"/"Loaded" regardless of actual backend state. Now derives the display from the health check response, showing "Not Ready"/"Unavailable" when the model is down. Closes #33 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the desktop UI’s “Model” status card to derive its displayed state from the tracked backend health status (status.ready) instead of hardcoded “Ready/Loaded”, aiming to reflect runtime backend/model availability.
Changes:
- Replace hardcoded “Model: Ready / Loaded” with conditional rendering based on
status.ready. - Show “Not Ready / Unavailable” styling when
status.readyis false.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <p className="value">{status.ready ? "Ready" : "Not Ready"}</p> | ||
| <span className={status.ready ? "pill" : "pill muted"}>{status.ready ? "Loaded" : "Unavailable"}</span> |
There was a problem hiding this comment.
The new "Not Ready/Unavailable" branch here is effectively unreachable because this component returns the startup view whenever !status.ready (see earlier if (!status.ready) return ...). As a result, the Model status card will never display the non-ready state in the main UI, which doesn't match the PR's stated behavior. Consider decoupling "backend connected" vs "startup/initializing" vs "model ready" state (e.g., track hasEverBeenReady / connectionState, or keep rendering the main view with disabled controls and show the cards in a muted state when status.ready flips false).
| <p className="value">{status.ready ? "Ready" : "Not Ready"}</p> | ||
| <span className={status.ready ? "pill" : "pill muted"}>{status.ready ? "Loaded" : "Unavailable"}</span> |
There was a problem hiding this comment.
This change introduces new conditional UI states for the Model card, but there are no tests covering the main view or verifying that the Model card updates when backend status changes. Since App.test.tsx exists, consider adding a test that simulates a onBackendStatus callback toggling ready and asserts the Model label/pill text and class change accordingly.
Summary
status.readyfield, showing "Not Ready"/"Unavailable" when the model is downTest plan
Closes #33
🤖 Generated with Claude Code