feat: add version to session header and /status dialog (#8802)

This commit is contained in:
Akshar Patel
2026-01-15 23:58:41 -05:00
committed by GitHub
parent 1a43e5fe87
commit ac54535486
2 changed files with 11 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import { TextAttributes } from "@opentui/core"
import { useTheme } from "../context/theme" import { useTheme } from "../context/theme"
import { useSync } from "@tui/context/sync" import { useSync } from "@tui/context/sync"
import { For, Match, Switch, Show, createMemo } from "solid-js" import { For, Match, Switch, Show, createMemo } from "solid-js"
import { Installation } from "@/installation"
export type DialogStatusProps = {} export type DialogStatusProps = {}
@@ -44,6 +45,7 @@ export function DialogStatus() {
</text> </text>
<text fg={theme.textMuted}>esc</text> <text fg={theme.textMuted}>esc</text>
</box> </box>
<text fg={theme.textMuted}>OpenCode v{Installation.VERSION}</text>
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}> <Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}>
<box> <box>
<text fg={theme.text}>{Object.keys(sync.data.mcp).length} MCP Servers</text> <text fg={theme.text}>{Object.keys(sync.data.mcp).length} MCP Servers</text>

View File

@@ -7,6 +7,7 @@ import { SplitBorder } from "@tui/component/border"
import type { AssistantMessage, Session } from "@opencode-ai/sdk/v2" import type { AssistantMessage, Session } from "@opencode-ai/sdk/v2"
import { useCommandDialog } from "@tui/component/dialog-command" import { useCommandDialog } from "@tui/component/dialog-command"
import { useKeybind } from "../../context/keybind" import { useKeybind } from "../../context/keybind"
import { Installation } from "@/installation"
const Title = (props: { session: Accessor<Session> }) => { const Title = (props: { session: Accessor<Session> }) => {
const { theme } = useTheme() const { theme } = useTheme()
@@ -113,13 +114,19 @@ export function Header() {
</text> </text>
</box> </box>
<box flexGrow={1} flexShrink={1} /> <box flexGrow={1} flexShrink={1} />
<ContextInfo context={context} cost={cost} /> <box flexDirection="row" gap={1} flexShrink={0}>
<ContextInfo context={context} cost={cost} />
<text fg={theme.textMuted}>v{Installation.VERSION}</text>
</box>
</box> </box>
</Match> </Match>
<Match when={true}> <Match when={true}>
<box flexDirection="row" justifyContent="space-between" gap={1}> <box flexDirection="row" justifyContent="space-between" gap={1}>
<Title session={session} /> <Title session={session} />
<ContextInfo context={context} cost={cost} /> <box flexDirection="row" gap={1} flexShrink={0}>
<ContextInfo context={context} cost={cost} />
<text fg={theme.textMuted}>v{Installation.VERSION}</text>
</box>
</box> </box>
</Match> </Match>
</Switch> </Switch>