Skip to content

Commit 46e9599

Browse files
anandgupta42claude
andcommitted
fix: make upgrade indicator responsive for small screens
On narrow terminals (<100 cols), hide "update available ·" text and show only the essential: ↑ 0.6.0 altimate upgrade Wide (100+): ↑ 0.6.0 update available · altimate upgrade Narrow (<100): ↑ 0.6.0 altimate upgrade Uses useTerminalDimensions() for reactive width detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cfa8c70 commit 46e9599

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/opencode/src/cli/cmd/tui/component/upgrade-indicator.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import { createMemo, Show, type JSX } from "solid-js"
2+
import { useTerminalDimensions } from "@opentui/solid"
23
import { useTheme } from "@tui/context/theme"
34
import { useKV } from "../context/kv"
45
import { UPGRADE_KV_KEY, getAvailableVersion } from "./upgrade-indicator-utils"
56

67
export function UpgradeIndicator(props: { fallback?: JSX.Element }) {
78
const { theme } = useTheme()
89
const kv = useKV()
10+
const dimensions = useTerminalDimensions()
911

1012
const latestVersion = createMemo(() => getAvailableVersion(kv.get(UPGRADE_KV_KEY)))
13+
const isCompact = createMemo(() => dimensions().width < 100)
1114

1215
return (
1316
<Show when={latestVersion()} fallback={props.fallback}>
1417
{(version) => (
1518
<box flexDirection="row" gap={1} flexShrink={0}>
1619
<text fg={theme.success}></text>
1720
<text fg={theme.accent}>{version()}</text>
18-
<text fg={theme.textMuted}>update available · altimate upgrade</text>
21+
<Show when={!isCompact()}>
22+
<text fg={theme.textMuted}>update available ·</text>
23+
</Show>
24+
<text fg={theme.textMuted}>altimate upgrade</text>
1925
</box>
2026
)}
2127
</Show>

0 commit comments

Comments
 (0)