Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 9beb0f8

Browse files
committed
tui: improve keyboard navigation and MCP server status display
1 parent d4cb47e commit 9beb0f8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function CommandProvider(props: ParentProps) {
7878
const keybind = useKeybind()
7979

8080
useKeyboard((evt) => {
81-
if (keybind.match("command_list", evt)) {
81+
if (keybind.match("command_list", evt) && dialog.stack.length === 0) {
8282
evt.preventDefault()
8383
dialog.replace(() => <DialogCommand options={value.options} />)
8484
return

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function DialogStatus() {
1515
<text attributes={TextAttributes.BOLD}>Status</text>
1616
<text fg={theme.textMuted}>esc</text>
1717
</box>
18-
<Show when={Object.keys(sync.data.mcp).length > 0}>
18+
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text>No MCP Servers</text>}>
1919
<box>
2020
<text>{Object.keys(sync.data.mcp).length} MCP Servers</text>
2121
<For each={Object.entries(sync.data.mcp)}>

packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
123123

124124
const keybind = useKeybind()
125125
useKeyboard((evt) => {
126-
if (evt.name === "up") move(-1)
127-
if (evt.name === "down") move(1)
126+
if (evt.name === "up" || (evt.ctrl && evt.name === "p")) move(-1)
127+
if (evt.name === "down" || (evt.ctrl && evt.name === "n")) move(1)
128128
if (evt.name === "pageup") move(-10)
129129
if (evt.name === "pagedown") move(10)
130130
if (evt.name === "return") {

0 commit comments

Comments
 (0)