mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 07:29:42 +02:00
feat(tui): add respawn status polling and display
- Poll session API every 2 seconds for respawn status - Display respawn state and cycle count in StatusBar - Show respawn status in magenta to match web UI - Format state (underscores to spaces) for readability Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,9 +13,16 @@ import React from 'react';
|
||||
import { Box, Text } from 'ink';
|
||||
import type { ScreenSession } from '../../types.js';
|
||||
|
||||
interface RespawnStatus {
|
||||
enabled: boolean;
|
||||
state: string;
|
||||
cycleCount: number;
|
||||
}
|
||||
|
||||
interface StatusBarProps {
|
||||
session: ScreenSession | null;
|
||||
inputMode?: boolean;
|
||||
respawnStatus?: RespawnStatus | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,7 +45,7 @@ function formatDuration(ms: number): string {
|
||||
/**
|
||||
* StatusBar component showing session information
|
||||
*/
|
||||
export function StatusBar({ session, inputMode = false }: StatusBarProps): React.ReactElement {
|
||||
export function StatusBar({ session, inputMode = false, respawnStatus }: StatusBarProps): React.ReactElement {
|
||||
if (!session) {
|
||||
return (
|
||||
<Box
|
||||
@@ -88,6 +95,15 @@ export function StatusBar({ session, inputMode = false }: StatusBarProps): React
|
||||
<Text color="yellow" bold>INPUT MODE</Text>
|
||||
</>
|
||||
)}
|
||||
{respawnStatus?.enabled && (
|
||||
<>
|
||||
<Text> | </Text>
|
||||
<Text color="magenta">
|
||||
respawn: {respawnStatus.state.replace(/_/g, ' ')}
|
||||
{respawnStatus.cycleCount > 0 && ` (${respawnStatus.cycleCount})`}
|
||||
</Text>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
{/* Right side: Keyboard hints */}
|
||||
|
||||
Reference in New Issue
Block a user