Add keyboard shortcut (Ctrl+L) to open main chat view and update UI with shortcut indication

This commit is contained in:
tusharmagar 2026-01-20 20:11:21 +05:30
parent 96d66a9f10
commit dbabfd2aca

View file

@ -1032,6 +1032,18 @@ function App() {
setIsGraphOpen(false)
}, [])
// Keyboard shortcut: Ctrl+L to open main chat view
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if ((e.ctrlKey || e.metaKey) && e.key === 'l') {
e.preventDefault()
handleOpenFullScreenChat()
}
}
document.addEventListener('keydown', handleKeyDown)
return () => document.removeEventListener('keydown', handleKeyDown)
}, [handleOpenFullScreenChat])
const toggleExpand = (path: string, kind: 'file' | 'dir') => {
if (kind === 'file') {
setSelectedPath(path)
@ -1513,6 +1525,11 @@ function App() {
<div className="text-4xl font-semibold tracking-tight text-foreground/80 sm:text-5xl md:text-6xl">
Rowboat
</div>
<div className="mt-3 text-sm text-muted-foreground flex items-center gap-1">
<kbd className="px-1.5 py-0.5 text-xs font-medium bg-muted rounded border border-border"></kbd>
<kbd className="px-1.5 py-0.5 text-xs font-medium bg-muted rounded border border-border">L</kbd>
<span className="ml-1">to open chat from anywhere</span>
</div>
</ConversationEmptyState>
) : (
<>