feat(cli): simplify top bar — title + host only

- Show 'Mosaic Stack TUI' on left, gateway host on right
- Remove connection status from top bar (lives in footer)
- Remove model/conversation from top bar (lives in footer)
This commit is contained in:
2026-03-15 13:59:48 -05:00
parent d7a03fd68b
commit 16409ff42d

View File

@@ -2,54 +2,19 @@ import React from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
export interface TopBarProps { export interface TopBarProps {
connected: boolean;
connecting: boolean;
gatewayUrl: string; gatewayUrl: string;
conversationId?: string;
modelName: string | null;
} }
export function TopBar({ export function TopBar({ gatewayUrl }: TopBarProps) {
connected,
connecting,
gatewayUrl,
conversationId,
modelName,
}: TopBarProps) {
const indicator = connected ? '●' : '○';
const indicatorColor = connected ? 'green' : connecting ? 'yellow' : 'red';
const statusLabel = connected ? 'connected' : connecting ? 'connecting' : 'disconnected';
// Strip protocol for compact display // Strip protocol for compact display
const host = gatewayUrl.replace(/^https?:\/\//, ''); const host = gatewayUrl.replace(/^https?:\/\//, '');
return ( return (
<Box borderStyle="single" borderColor="gray" paddingX={1} justifyContent="space-between"> <Box borderStyle="single" borderColor="gray" paddingX={1} justifyContent="space-between">
<Box>
<Text bold color="blue"> <Text bold color="blue">
mosaic Mosaic Stack TUI
</Text> </Text>
<Text> </Text> <Text dimColor>{host}</Text>
<Text color={indicatorColor}>{indicator}</Text>
<Text dimColor> {statusLabel}</Text>
<Text dimColor> · {host}</Text>
</Box>
<Box>
{modelName && (
<>
<Text dimColor>model: </Text>
<Text color="magenta">{modelName}</Text>
<Text> </Text>
</>
)}
{conversationId && (
<>
<Text dimColor>conv: </Text>
<Text>{conversationId.slice(0, 8)}</Text>
</>
)}
</Box>
</Box> </Box>
); );
} }