Skip to content

Commit ac54535

Browse files
authored
feat: add version to session header and /status dialog (anomalyco#8802)
1 parent 1a43e5f commit ac54535

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { TextAttributes } from "@opentui/core"
22
import { useTheme } from "../context/theme"
33
import { useSync } from "@tui/context/sync"
44
import { For, Match, Switch, Show, createMemo } from "solid-js"
5+
import { Installation } from "@/installation"
56

67
export type DialogStatusProps = {}
78

@@ -44,6 +45,7 @@ export function DialogStatus() {
4445
</text>
4546
<text fg={theme.textMuted}>esc</text>
4647
</box>
48+
<text fg={theme.textMuted}>OpenCode v{Installation.VERSION}</text>
4749
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text fg={theme.text}>No MCP Servers</text>}>
4850
<box>
4951
<text fg={theme.text}>{Object.keys(sync.data.mcp).length} MCP Servers</text>

packages/opencode/src/cli/cmd/tui/routes/session/header.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { SplitBorder } from "@tui/component/border"
77
import type { AssistantMessage, Session } from "@opencode-ai/sdk/v2"
88
import { useCommandDialog } from "@tui/component/dialog-command"
99
import { useKeybind } from "../../context/keybind"
10+
import { Installation } from "@/installation"
1011

1112
const Title = (props: { session: Accessor<Session> }) => {
1213
const { theme } = useTheme()
@@ -113,13 +114,19 @@ export function Header() {
113114
</text>
114115
</box>
115116
<box flexGrow={1} flexShrink={1} />
116-
<ContextInfo context={context} cost={cost} />
117+
<box flexDirection="row" gap={1} flexShrink={0}>
118+
<ContextInfo context={context} cost={cost} />
119+
<text fg={theme.textMuted}>v{Installation.VERSION}</text>
120+
</box>
117121
</box>
118122
</Match>
119123
<Match when={true}>
120124
<box flexDirection="row" justifyContent="space-between" gap={1}>
121125
<Title session={session} />
122-
<ContextInfo context={context} cost={cost} />
126+
<box flexDirection="row" gap={1} flexShrink={0}>
127+
<ContextInfo context={context} cost={cost} />
128+
<text fg={theme.textMuted}>v{Installation.VERSION}</text>
129+
</box>
123130
</box>
124131
</Match>
125132
</Switch>

0 commit comments

Comments
 (0)