Skip to content

Commit 02bd2e6

Browse files
committed
fix(app): clear todo dock after fade-out instead of just hiding it
The todo dock only hides when the last item finishes - it never clears. Old items therefore reappear on the next session open, and the sync used to force a re-fetch that pulled them straight back from the database. - call clear() after the fade-out completes in session-composer-state - drop the force/cached arguments so a closed dock stays closed The fetch itself is unchanged: an open dock still loads from the database. Refs anomalyco#41359
1 parent 97a86b7 commit 02bd2e6

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎packages/app/src/pages/session.tsx‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,15 +909,14 @@ export default function Page() {
909909
todoTimer = undefined
910910
if (!id) return
911911
if (status === "idle" && !blocked) return
912-
const cached = untrack(() => sync().data.todo[id] !== undefined)
913912

914913
todoFrame = requestAnimationFrame(() => {
915914
todoFrame = undefined
916915
todoTimer = window.setTimeout(() => {
917916
todoTimer = undefined
918917
if (sdk().directory !== dir || params.id !== id) return
919918
untrack(() => {
920-
void sync().session.todo(id, cached ? { force: true } : undefined)
919+
void sync().session.todo(id)
921920
})
922921
}, 0)
923922
})

‎packages/app/src/pages/session/composer/session-composer-state.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,22 @@ export function createSessionComposerController(options?: { closeMs?: number | (
102102
return 400
103103
}
104104

105+
// Keep stale turn todos from reopening if the model never clears them.
106+
const clear = () => {
107+
const id = params.id
108+
if (!id) return
109+
sync().set("todo", id, [])
110+
}
111+
105112
const scheduleClose = () => {
106113
if (timer) window.clearTimeout(timer)
107114
timer = window.setTimeout(() => {
108115
setStore({ dock: false, closing: false })
116+
clear()
109117
timer = undefined
110118
}, closeMs())
111119
}
112120

113-
// Keep stale turn todos from reopening if the model never clears them.
114-
const clear = () => {
115-
const id = params.id
116-
if (!id) return
117-
sync().set("todo", id, [])
118-
}
119-
120121
createEffect(
121122
on(
122123
() => [params.id, todos().length, done(), live()] as const,

0 commit comments

Comments
 (0)