(e: KeyboardEvent)
| 23 | |
| 24 | useEffect(() => { |
| 25 | const handleKeyDown = (e: KeyboardEvent) => { |
| 26 | if ((e.metaKey || e.ctrlKey) && e.key === 'n') { |
| 27 | e.preventDefault(); |
| 28 | const session = { |
| 29 | id: generateId(), |
| 30 | projectId: activeProjectId ?? 'default', |
| 31 | title: 'New Chat', |
| 32 | createdAt: new Date().toISOString(), |
| 33 | updatedAt: new Date().toISOString(), |
| 34 | }; |
| 35 | addSession(session); |
| 36 | setActiveSessionId(session.id); |
| 37 | } |
| 38 | }; |
| 39 | |
| 40 | window.addEventListener('keydown', handleKeyDown); |
| 41 | return () => window.removeEventListener('keydown', handleKeyDown); |
nothing calls this directly
no test coverage detected