tui: improve keyboard navigation and MCP server status display

This commit is contained in:
Dax Raad
2025-10-31 19:47:08 -04:00
parent d4cb47eadc
commit 9beb0f8512
3 changed files with 4 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ export function CommandProvider(props: ParentProps) {
const keybind = useKeybind()
useKeyboard((evt) => {
if (keybind.match("command_list", evt)) {
if (keybind.match("command_list", evt) && dialog.stack.length === 0) {
evt.preventDefault()
dialog.replace(() => <DialogCommand options={value.options} />)
return

View File

@@ -15,7 +15,7 @@ export function DialogStatus() {
<text attributes={TextAttributes.BOLD}>Status</text>
<text fg={theme.textMuted}>esc</text>
</box>
<Show when={Object.keys(sync.data.mcp).length > 0}>
<Show when={Object.keys(sync.data.mcp).length > 0} fallback={<text>No MCP Servers</text>}>
<box>
<text>{Object.keys(sync.data.mcp).length} MCP Servers</text>
<For each={Object.entries(sync.data.mcp)}>

View File

@@ -123,8 +123,8 @@ export function DialogSelect<T>(props: DialogSelectProps<T>) {
const keybind = useKeybind()
useKeyboard((evt) => {
if (evt.name === "up") move(-1)
if (evt.name === "down") move(1)
if (evt.name === "up" || (evt.ctrl && evt.name === "p")) move(-1)
if (evt.name === "down" || (evt.ctrl && evt.name === "n")) move(1)
if (evt.name === "pageup") move(-10)
if (evt.name === "pagedown") move(10)
if (evt.name === "return") {