File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,22 @@ function NoAgentImpl() {
4545 [ updateParams ]
4646 ) ;
4747
48+ // Global keyboard shortcut: cmd + k for new chat
49+ useEffect ( ( ) => {
50+ const handleKeyDown = ( event : KeyboardEvent ) => {
51+ if ( ( event . metaKey || event . ctrlKey ) && event . key === 'k' ) {
52+ event . preventDefault ( ) ;
53+ handleSelectTask ( null ) ;
54+ }
55+ } ;
56+
57+ window . addEventListener ( 'keydown' , handleKeyDown ) ;
58+
59+ return ( ) => {
60+ window . removeEventListener ( 'keydown' , handleKeyDown ) ;
61+ } ;
62+ } , [ handleSelectTask ] ) ;
63+
4864 return (
4965 < div className = "fixed inset-0 flex w-full" >
5066 < AnimatePresence >
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ export function TaskSidebar({
7474 onSelectTask,
7575} : TaskSidebarProps ) {
7676 const { agentexClient } = useAgentexClient ( ) ;
77+
7778 const { data : tasks = [ ] , isLoading : isLoadingTasks } = useTasks (
7879 agentexClient ,
7980 selectedAgentName ? { agentName : selectedAgentName } : undefined
@@ -208,10 +209,15 @@ function SidebarHeader({
208209 < Button
209210 onClick = { handleNewChat }
210211 variant = "ghost"
211- className = "text-sidebar-foreground flex items-center justify-start gap-2"
212+ className = "text-sidebar-foreground flex items-center justify-between gap-2"
212213 >
213- < SquarePen className = "size-5" />
214- New Chat
214+ < div className = "flex items-center gap-2" >
215+ < SquarePen className = "size-5" />
216+ New Chat
217+ </ div >
218+ < kbd className = "bg-muted text-muted-foreground pointer-events-none inline-flex h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none" >
219+ < span className = "text-xs/snug" > ⌘</ span > K
220+ </ kbd >
215221 </ Button >
216222 </ div >
217223 ) ;
You can’t perform that action at this time.
0 commit comments