mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
Add keyboard shortcut (Ctrl+L) to open main chat view and update UI with shortcut indication
This commit is contained in:
parent
96d66a9f10
commit
dbabfd2aca
1 changed files with 17 additions and 0 deletions
|
|
@ -1032,6 +1032,18 @@ function App() {
|
||||||
setIsGraphOpen(false)
|
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') => {
|
const toggleExpand = (path: string, kind: 'file' | 'dir') => {
|
||||||
if (kind === 'file') {
|
if (kind === 'file') {
|
||||||
setSelectedPath(path)
|
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">
|
<div className="text-4xl font-semibold tracking-tight text-foreground/80 sm:text-5xl md:text-6xl">
|
||||||
Rowboat
|
Rowboat
|
||||||
</div>
|
</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>
|
</ConversationEmptyState>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue