Skip to content

Implement StatusBar component #11774

Closed as not planned
Closed as not planned

Description

@randomm

Parent Epic

Part of #11762 (Ink-based TUI Rewrite)

Objective

Create status bar showing session metrics, duration, and token count.

Current Behavior

~27s · 275.9k tokens
────────────────────────────────

Component Design

interface StatusBarProps {
  duration: number       // seconds since session start
  tokenCount: number     // total tokens used
  agent: string          // current agent name
  model?: string         // current model (optional display)
}

const StatusBar: React.FC<StatusBarProps> = ({ duration, tokenCount, agent, model }) => {
  const formattedDuration = formatDuration(duration)
  const formattedTokens = formatTokenCount(tokenCount)
  
  return (
    <Box flexDirection="column">
      <Box>
        <Text dimColor>{formattedDuration} · {formattedTokens}</Text>
      </Box>
      <Text dimColor>{'─'.repeat(process.stdout.columns || 80)}</Text>
    </Box>
  )
}

function formatDuration(seconds: number): string {
  if (seconds < 60) return `~${seconds}s`
  return `~${Math.floor(seconds / 60)}m`
}

function formatTokenCount(tokens: number): string {
  if (tokens < 1000) return `${tokens} tokens`
  if (tokens < 1000000) return `${(tokens / 1000).toFixed(1)}k tokens`
  return `${(tokens / 1000000).toFixed(1)}m tokens`
}

Tasks

  • Create src/cli/ink/components/StatusBar.tsx
  • Implement duration formatting
  • Implement token count formatting
  • Implement separator line (respects terminal width)
  • Update duration every second (useEffect with interval)
  • Get token count from session metrics

Acceptance Criteria

  • Duration displays and updates
  • Token count displays correctly
  • Separator line spans terminal width
  • Styling matches current theme

Estimated Effort

0.5 days

Risk

Low - simple display component

Dependencies

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 2, 2026
  2. github-actions commented on Feb 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if your implementation has a different scope or represents the Ink-based TUI rewrite effort specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions