Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ function Mcp(props: { api: TuiPluginApi }) {

function Version(props: { api: TuiPluginApi }) {
const theme = () => props.api.theme.current
const mini = createMemo(() => props.api.kv.get("ui_minimal", false))

return (
<box flexShrink={0}>
<text fg={theme().textMuted}>{props.api.app.version}</text>
<Show when={!mini()}>
<text fg={theme().textMuted}>{props.api.app.version}</text>
</Show>
</box>
)
}
Expand Down
41 changes: 0 additions & 41 deletions packages/opencode/src/cli/cmd/tui/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import { useProject } from "../context/project"
import { useSync } from "../context/sync"
import { Toast } from "../ui/toast"
import { useArgs } from "../context/args"
import { useDirectory } from "../context/directory"
import { useRouteData } from "@tui/context/route"
import { usePromptRef } from "../context/prompt"
import { Installation } from "@/installation"
import { useLocal } from "../context/local"
import { useKV } from "../context/kv"
import { TuiPluginRuntime } from "@/cli/cmd/tui/plugin/runtime"
import { useEditorContext } from "@tui/context/editor"

Expand All @@ -24,12 +21,10 @@ const placeholder = {

export function Home() {
const sync = useSync()
const kv = useKV()
const { theme } = useTheme()
const project = useProject()
const route = useRouteData("home")
const promptRef = usePromptRef()
const mcp = createMemo(() => Object.keys(sync.data.mcp).length > 0)
const mcpError = createMemo(() => {
return Object.values(sync.data.mcp).some((x) => x.status === "failed")
})
Expand All @@ -38,16 +33,6 @@ export function Home() {
return Object.values(sync.data.mcp).filter((x) => x.status === "connected").length
})

const isFirstTimeUser = createMemo(() => sync.data.session.length === 0)
const mini = createMemo(() => kv.get("ui_minimal", false))
const tipsHidden = createMemo(() => kv.get("tips_hidden", false))
const showTips = createMemo(() => {
if (mini()) return false
// Don't show tips for first-time users
if (isFirstTimeUser()) return false
return !tipsHidden()
})

const Hint = (
<box flexShrink={0} flexDirection="row" gap={1}>
<Show when={connectedMcpCount() > 0}>
Expand Down Expand Up @@ -101,7 +86,6 @@ export function Home() {
sent = true
r.submit()
})
const directory = useDirectory()

return (
<>
Expand Down Expand Up @@ -134,31 +118,6 @@ export function Home() {
<box flexGrow={1} minHeight={0} />
<Toast />
</box>
<box paddingTop={1} paddingBottom={1} paddingLeft={2} paddingRight={2} flexDirection="row" flexShrink={0} gap={2}>
<text fg={theme.textMuted}>{directory()}</text>
<box gap={1} flexDirection="row" flexShrink={0}>
<Show when={mcp()}>
<text fg={theme.text}>
<Switch>
<Match when={mcpError()}>
<span style={{ fg: theme.error }}>⊙ </span>
</Match>
<Match when={true}>
<span style={{ fg: connectedMcpCount() > 0 ? theme.success : theme.textMuted }}>⊙ </span>
</Match>
</Switch>
{connectedMcpCount()} MCP
</text>
<text fg={theme.textMuted}>/status</text>
</Show>
</box>
<box flexGrow={1} />
<box flexShrink={0}>
<Show when={!mini()}>
<text fg={theme.textMuted}>{Installation.VERSION}</text>
</Show>
</box>
</box>
<box width="100%" flexShrink={0}>
<TuiPluginRuntime.Slot name="home_footer" mode="single_winner" />
</box>
Expand Down
Loading