Skip to content

Commit 8c837ab

Browse files
committed
feat: update session handling to retain tasks during session switch and clear notes on workspace change
1 parent 23965b3 commit 8c837ab

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ export default function HomePage() {
390390
await ensureConnected();
391391
acp.selectSession(sessionId);
392392
setActiveSessionId(sessionId);
393-
// Clear tasks when switching sessions
394-
setRoutaTasks([]);
393+
// Don't clear tasks here - let onTasksDetected update them when history loads
394+
// This prevents the right sidebar from disappearing during session switch
395395
bumpRefresh();
396396
},
397397
[acp, ensureConnected, bumpRefresh]

src/client/hooks/use-notes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ export function useNotes(workspaceId: string = "default"): UseNotesReturn {
257257
};
258258
}, [workspaceId]);
259259

260+
// Clear notes when workspaceId changes to avoid showing stale data
261+
useEffect(() => {
262+
setNotes([]);
263+
setConnected(false);
264+
}, [workspaceId]);
265+
260266
// Connect SSE and fetch initial notes
261267
useEffect(() => {
262268
fetchNotes();

0 commit comments

Comments
 (0)