()
| 185 | |
| 186 | // Create new session with random name |
| 187 | const handleCreateSession = async () => { |
| 188 | const api = getElectronAPI(); |
| 189 | if (!api?.sessions) return; |
| 190 | |
| 191 | const sessionName = newSessionName.trim() || generateRandomSessionName(); |
| 192 | |
| 193 | const result = await api.sessions.create(sessionName, projectPath, effectiveWorkingDirectory); |
| 194 | |
| 195 | if (result.success && result.session?.id) { |
| 196 | setNewSessionName(''); |
| 197 | setIsCreating(false); |
| 198 | await invalidateSessions(); |
| 199 | onSelectSession(result.session.id); |
| 200 | } |
| 201 | }; |
| 202 | |
| 203 | // Create new session directly with a random name (one-click) |
| 204 | const handleQuickCreateSession = useCallback(async () => { |
no test coverage detected