Address PR #1221 review round 3 feedback
- InspectorView: simulate the connect flow through "connecting" with a randomized 50-500ms handshake delay and an 85% success rate. On success, measure observed latency from connect start; on failure, set a plausible error message. Connection error message flows through to the active ServerCard's connection state. Real wiring (Phase 3) replaces this with `useConnection`. - InspectorView: document that the view owns connection state (input `serversInput` connection fields are intentionally ignored), and mark `noop` callbacks as Phase-3 stubs. - ServerStatusIndicator: add `showLabel?: boolean` escape hatch so consumers in constrained containers can override the default viewport-based visibility. - ServerListScreen.stories: add `WithActiveServer` story exercising the dimming + `inert` behaviour in isolation. - ViewHeader.stories: rename "Logging" → "Logs" to match `ALL_TABS` in InspectorView. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0babbfa6a9
commit
473bd95826
1 changed files with 93 additions and 21 deletions
|
|
@ -6,6 +6,10 @@ export interface ServerStatusIndicatorProps {
|
|||
status: ConnectionStatus;
|
||||
latencyMs?: number;
|
||||
retryCount?: number;
|
||||
// Override for the default viewport-based label visibility. Useful when
|
||||
// the indicator renders inside a constrained container (sidebar, card)
|
||||
// where the global media query doesn't reflect available space.
|
||||
showLabel?: boolean;
|
||||
}
|
||||
|
||||
const statusColorVar: Record<ConnectionStatus, string> = {
|
||||
|
|
@ -42,8 +46,10 @@ export function ServerStatusIndicator({
|
|||
status,
|
||||
latencyMs,
|
||||
retryCount,
|
||||
showLabel: showLabelProp,
|
||||
}: ServerStatusIndicatorProps) {
|
||||
const showLabel = useMediaQuery("(min-width: 1200px)");
|
||||
const wideViewport = useMediaQuery("(min-width: 1200px)");
|
||||
const showLabel = showLabelProp ?? wideViewport;
|
||||
const label = getLabel(status, latencyMs, retryCount);
|
||||
return (
|
||||
<Group gap="xs">
|
||||
|
|
|
|||
Loading…
Reference in a new issue