diff options
| author | bndw <ben@bdw.to> | 2026-03-04 22:26:24 -0800 |
|---|---|---|
| committer | bndw <ben@bdw.to> | 2026-03-04 22:26:24 -0800 |
| commit | 712b7ce8306d8bf5b21f35aa51957a82fa771e3b (patch) | |
| tree | 319ae23cefcde3394618b2737654ef0f83456a3c /renderer/src | |
| parent | 73d2680b83ccbdbd8dfec2d319533e98b379b830 (diff) | |
feat: Sync sessions array after phase advance in handleSubmit (+1 more)
- ✅ Sync sessions array after phase advance in handleSubmit
- ✅ Auto-send initial message in handleConfirmNewSession for plan/implement phases
Diffstat (limited to 'renderer/src')
| -rw-r--r-- | renderer/src/App.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/renderer/src/App.tsx b/renderer/src/App.tsx index 7c5c969..5fb3dd1 100644 --- a/renderer/src/App.tsx +++ b/renderer/src/App.tsx | |||
| @@ -432,6 +432,14 @@ export function App() { | |||
| 432 | phase: advanced.phase, | 432 | phase: advanced.phase, |
| 433 | git_branch: advanced.git_branch, | 433 | git_branch: advanced.git_branch, |
| 434 | }); | 434 | }); |
| 435 | // Keep sessions array in sync so Sidebar reflects the new phase immediately. | ||
| 436 | setSessions((prev) => | ||
| 437 | prev.map((s) => | ||
| 438 | s.id === id | ||
| 439 | ? { ...s, phase: advanced.phase, git_branch: advanced.git_branch } | ||
| 440 | : s | ||
| 441 | ) | ||
| 442 | ); | ||
| 435 | setLoadingBySession((prev) => ({ ...prev, [id]: true })); | 443 | setLoadingBySession((prev) => ({ ...prev, [id]: true })); |
| 436 | const initialMsg = | 444 | const initialMsg = |
| 437 | advanced.phase === "plan" | 445 | advanced.phase === "plan" |
| @@ -479,6 +487,22 @@ export function App() { | |||
| 479 | setMessages([]); | 487 | setMessages([]); |
| 480 | setDocumentContent(""); | 488 | setDocumentContent(""); |
| 481 | setOriginalContent(""); | 489 | setOriginalContent(""); |
| 490 | |||
| 491 | // For sessions that start beyond research, kick off Claude immediately | ||
| 492 | // with the same message used when advancing into that phase via Submit. | ||
| 493 | if (phase === "plan" || phase === "implement") { | ||
| 494 | const initialMsg = | ||
| 495 | phase === "plan" | ||
| 496 | ? "Create a detailed implementation plan based on the research." | ||
| 497 | : "Begin implementing the plan."; | ||
| 498 | setLoadingBySession((prev) => ({ ...prev, [session.id]: true })); | ||
| 499 | try { | ||
| 500 | await api.sendMessage(session.id, initialMsg); | ||
| 501 | } catch (err) { | ||
| 502 | setError(err instanceof Error ? err.message : "Failed to start session"); | ||
| 503 | setLoadingBySession((prev) => ({ ...prev, [session.id]: false })); | ||
| 504 | } | ||
| 505 | } | ||
| 482 | }; | 506 | }; |
| 483 | 507 | ||
| 484 | const handleDeleteProject = async (id: string) => { | 508 | const handleDeleteProject = async (id: string) => { |
