diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx index b85cd5c6542..d3a78902fc9 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-status.tsx @@ -1,6 +1,8 @@ import { TextAttributes } from "@opentui/core" import { useTheme } from "../context/theme" import { useSync } from "@tui/context/sync" +import { useTerminalDimensions } from "@opentui/solid" +import { ScrollBoxRenderable } from "@opentui/core" import { For, Match, Switch, Show, createMemo } from "solid-js" export type DialogStatusProps = {} @@ -9,6 +11,10 @@ export function DialogStatus() { const sync = useSync() const { theme } = useTheme() + const dimensions = useTerminalDimensions() + const height = createMemo(() => Math.max(10, Math.floor(dimensions().height / 2.5))) + let scroll: ScrollBoxRenderable | undefined + const enabledFormatters = createMemo(() => sync.data.formatter.filter((f) => f.enabled)) const plugins = createMemo(() => { @@ -37,126 +43,136 @@ export function DialogStatus() { }) return ( - - + + Status esc - 0} fallback={No MCP Servers}> - - {Object.keys(sync.data.mcp).length} MCP Servers - - {([key, item]) => ( - - - )[item.status], - }} - > - • - - - {key}{" "} - - - Connected - {(val) => val().error} - Disabled in configuration - - Needs authentication (run: opencode mcp auth {key}) - - - {(val) => (val() as { error: string }).error} - - - - - - )} - - - - {sync.data.lsp.length > 0 && ( - - {sync.data.lsp.length} LSP Servers - - {(item) => ( - - - • - - - {item.id} {item.root} - - - )} - - - )} - 0} fallback={No Formatters}> - - {enabledFormatters().length} Formatters - - {(item) => ( - - - • - - - {item.name} - - - )} - - - - 0} fallback={No Plugins}> - - {plugins().length} Plugins - - {(item) => ( - - - • - - - {item.name} - {item.version && @{item.version}} - - - )} - + (scroll = r)} + maxHeight={height()} + > + + 0} fallback={No MCP Servers}> + + {Object.keys(sync.data.mcp).length} MCP Servers + + {([key, item]) => ( + + + )[item.status], + }} + > + • + + + {key}{" "} + + + Connected + {(val) => val().error} + Disabled in configuration + + Needs authentication (run: opencode mcp auth {key}) + + + {(val) => (val() as { error: string }).error} + + + + + + )} + + + + {sync.data.lsp.length > 0 && ( + + {sync.data.lsp.length} LSP Servers + + {(item) => ( + + + • + + + {item.id} {item.root} + + + )} + + + )} + 0} fallback={No Formatters}> + + {enabledFormatters().length} Formatters + + {(item) => ( + + + • + + + {item.name} + + + )} + + + + 0} fallback={No Plugins}> + + {plugins().length} Plugins + + {(item) => ( + + + • + + + {item.name} + {item.version && @{item.version}} + + + )} + + + - + ) }