diff --git a/packages/cli/src/tui/app.tsx b/packages/cli/src/tui/app.tsx index 4d7d3b1..850d7ed 100644 --- a/packages/cli/src/tui/app.tsx +++ b/packages/cli/src/tui/app.tsx @@ -57,9 +57,26 @@ export function TuiApp({ gatewayUrl, conversationId, sessionCookie }: TuiAppProp if (key.ctrl && ch === 'c') { exit(); } - // Ctrl+B: toggle sidebar - if (key.ctrl && ch === 'b') { + // Ctrl+L: toggle sidebar (refresh on open) + if (key.ctrl && ch === 'l') { + const willOpen = !appMode.sidebarOpen; appMode.toggleSidebar(); + if (willOpen) { + void conversations.refresh(); + } + } + // Ctrl+N: create new conversation and switch to it + if (key.ctrl && ch === 'n') { + void conversations.createConversation().then((conv) => { + if (conv) { + socket.switchConversation(conv.id); + appMode.setMode('chat'); + } + }); + } + // Ctrl+K: toggle search mode + if (key.ctrl && ch === 'k') { + appMode.setMode(appMode.mode === 'search' ? 'chat' : 'search'); } // Page Up / Page Down: scroll message history (only in chat mode) if (appMode.mode === 'chat') { @@ -82,14 +99,22 @@ export function TuiApp({ gatewayUrl, conversationId, sessionCookie }: TuiAppProp } } } - // Escape: return to chat from sidebar - if (key.escape && appMode.mode === 'sidebar') { - appMode.setMode('chat'); + // Escape: return to chat from sidebar/search; in chat, scroll to bottom + if (key.escape) { + if (appMode.mode === 'sidebar' || appMode.mode === 'search') { + appMode.setMode('chat'); + } else if (appMode.mode === 'chat') { + viewport.scrollToBottom(); + } } }); const inputPlaceholder = - appMode.mode !== 'chat' ? 'focus is on sidebar… press Esc to return' : undefined; + appMode.mode === 'sidebar' + ? 'focus is on sidebar… press Esc to return' + : appMode.mode === 'search' + ? 'search mode… press Esc to return' + : undefined; const messageArea = ( diff --git a/packages/cli/src/tui/components/bottom-bar.tsx b/packages/cli/src/tui/components/bottom-bar.tsx index e9151a4..53c80fe 100644 --- a/packages/cli/src/tui/components/bottom-bar.tsx +++ b/packages/cli/src/tui/components/bottom-bar.tsx @@ -46,6 +46,11 @@ export function BottomBar({ return ( + {/* Line 0: keybinding hints */} + + ^L sidebar · ^N new · ^K search · ^T thinking · PgUp/Dn scroll + + {/* Line 1: blank ····· Gateway: Status */}