Skip to content

Commit 3d9db8f

Browse files
committed
fix: Open Arena + Research Competition + Resume timing
Colosseum Panel: - Open Arena opens in DAEMON browser tab (was: external browser) - Fixed URL to arena.colosseum.org/hackathon (was wrong link) - Get token link also opens in DAEMON browser - Research Competition now adds terminal to UI, switches to canvas Resume: - Added 200ms delay for terminal to render before writing /resume - Removed stale centerMode dependency from useCallback
1 parent 57dad18 commit 3d9db8f

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

src/panels/Colosseum/HackathonPanel.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useEffect, useCallback, useRef } from 'react'
22
import { useUIStore } from '../../store/ui'
3+
import { useBrowserStore } from '../../store/browser'
34
import './HackathonPanel.css'
45

56
const DEADLINE_KEY = 'daemon:hackathon-deadline'
@@ -142,16 +143,21 @@ export function HackathonPanel() {
142143
})
143144
}, [])
144145

145-
const handleResearchAgent = useCallback(() => {
146-
// Spawn the colosseum-research agent
146+
const handleResearchAgent = useCallback(async () => {
147147
const projectId = useUIStore.getState().activeProjectId
148-
if (projectId) {
149-
window.daemon.terminal.spawnAgent({ agentId: 'colosseum-research', projectId })
150-
}
148+
if (!projectId) return
149+
try {
150+
const res = await window.daemon.terminal.spawnAgent({ agentId: 'colosseum-research', projectId })
151+
if (res.ok && res.data) {
152+
useUIStore.getState().addTerminal(projectId, res.data.id, res.data.agentName ?? 'Colosseum Research', res.data.agentId)
153+
useUIStore.getState().setCenterMode('canvas')
154+
}
155+
} catch {}
151156
}, [])
152157

153158
const handleOpenArena = useCallback(() => {
154-
window.daemon.shell.openExternal('https://arena.colosseum.org')
159+
useBrowserStore.getState().setUrl('https://arena.colosseum.org/hackathon')
160+
useUIStore.getState().openBrowserTab()
155161
}, [])
156162

157163
if (isConfigured === null) {
@@ -193,7 +199,10 @@ export function HackathonPanel() {
193199

194200
<span
195201
className="hackathon-link"
196-
onClick={() => window.daemon.shell.openExternal('https://arena.colosseum.org/copilot')}
202+
onClick={() => {
203+
useBrowserStore.getState().setUrl('https://arena.colosseum.org/copilot')
204+
useUIStore.getState().openBrowserTab()
205+
}}
197206
>
198207
Get a token at arena.colosseum.org/copilot
199208
</span>

src/panels/SessionRegistry/SessionHistory.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,16 @@ export function SessionHistory() {
247247
if (!terminal) return
248248

249249
const projectId = terminal.projectId
250+
251+
// Switch to canvas, show terminal, activate the right tab
252+
setCenterMode('canvas')
250253
setActiveTerminal(projectId, session.terminal_id)
251-
if (centerMode !== 'canvas') setCenterMode('canvas')
252-
window.daemon.terminal.write(session.terminal_id, '/resume\n')
253-
}, [terminals, setActiveTerminal, centerMode, setCenterMode])
254+
255+
// Small delay so the terminal is visible before writing
256+
setTimeout(() => {
257+
window.daemon.terminal.write(session.terminal_id!, '/resume\n')
258+
}, 200)
259+
}, [terminals, setActiveTerminal, setCenterMode])
254260

255261
const handleRelaunch = useCallback(async (session: LocalAgentSession) => {
256262
if (!session.agent_id) return

0 commit comments

Comments
 (0)