Skip to content

Commit 580d833

Browse files
UI: show plugin count in footer
1 parent 24bb293 commit 580d833

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

packages/opencode/src/cli/cmd/tui/app.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@ import { render, useKeyboard, useRenderer, useTerminalDimensions } from "@opentu
22
import { Clipboard } from "@tui/util/clipboard"
33
import { TextAttributes } from "@opentui/core"
44
import { RouteProvider, useRoute } from "@tui/context/route"
5-
import { Switch, Match, createEffect, untrack, ErrorBoundary, createSignal, onMount, batch } from "solid-js"
5+
import {
6+
Switch,
7+
Match,
8+
Show,
9+
createEffect,
10+
untrack,
11+
ErrorBoundary,
12+
createSignal,
13+
onMount,
14+
batch,
15+
createMemo,
16+
} from "solid-js"
617
import { Installation } from "@/installation"
718
import { Global } from "@/global"
819
import { DialogProvider, useDialog } from "@tui/ui/dialog"
@@ -29,6 +40,7 @@ import { TuiEvent } from "./event"
2940
import { KVProvider, useKV } from "./context/kv"
3041
import { Provider } from "@/provider/provider"
3142
import { ArgsProvider, useArgs, type Args } from "./context/args"
43+
import { Locale } from "@/util/locale"
3244

3345
async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
3446
// can't set raw mode if not a TTY
@@ -455,7 +467,7 @@ function App() {
455467
<text fg={theme.textMuted} paddingRight={1}>
456468
tab
457469
</text>
458-
<text fg={local.agent.color(local.agent.current().name)}>{""}</text>
470+
<text fg={local.agent.color(local.agent.current().name)}>{"\ue0b2"}</text>
459471
<text bg={local.agent.color(local.agent.current().name)} fg={theme.background} wrapMode={undefined}>
460472
<span style={{ bold: true }}> {local.agent.current().name.toUpperCase()}</span>
461473
<span> AGENT </span>

packages/opencode/src/cli/cmd/tui/routes/home.tsx

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,34 @@ export function Home() {
1919
return Object.values(sync.data.mcp).some((x) => x.status === "failed")
2020
})
2121

22+
const plugins = createMemo(() => (sync.data.config.plugin ?? []).length)
23+
2224
const Hint = (
23-
<Show when={Object.keys(sync.data.mcp).length > 0}>
24-
<box flexShrink={0} flexDirection="row" gap={1}>
25-
<text fg={theme.text}>
26-
<Switch>
27-
<Match when={mcpError()}>
28-
<span style={{ fg: theme.error }}></span> mcp errors{" "}
29-
<span style={{ fg: theme.textMuted }}>ctrl+x s</span>
30-
</Match>
31-
<Match when={true}>
32-
<span style={{ fg: theme.success }}></span>{" "}
33-
{Locale.pluralize(Object.values(sync.data.mcp).length, "{} mcp server", "{} mcp servers")}
34-
</Match>
35-
</Switch>
36-
</text>
37-
</box>
38-
</Show>
25+
<box flexShrink={0} flexDirection="column" gap={0}>
26+
<Show when={Object.keys(sync.data.mcp).length > 0}>
27+
<box flexDirection="row" gap={1}>
28+
<text fg={theme.text}>
29+
<Switch>
30+
<Match when={mcpError()}>
31+
<span style={{ fg: theme.error }}></span> mcp errors{" "}
32+
<span style={{ fg: theme.textMuted }}>ctrl+x s</span>
33+
</Match>
34+
<Match when={true}>
35+
<span style={{ fg: theme.success }}></span>{" "}
36+
{Locale.pluralize(Object.values(sync.data.mcp).length, "{} mcp server", "{} mcp servers")}
37+
</Match>
38+
</Switch>
39+
</text>
40+
</box>
41+
</Show>
42+
<Show when={plugins() > 0}>
43+
<box flexDirection="row" gap={1}>
44+
<text fg={theme.text}>
45+
<span style={{ fg: theme.success }}></span> {Locale.pluralize(plugins(), "{} plugin", "{} plugins")}
46+
</text>
47+
</box>
48+
</Show>
49+
</box>
3950
)
4051

4152
let prompt: PromptRef

0 commit comments

Comments
 (0)