Skip to content

fix(app): clear todo dock after fade-out instead of just hiding it - #52813

Closed
Chunai-Bboy wants to merge 1 commit into
anomalyco:devfrom
Chunai-Bboy:fix/todo-dock-stale-lists
Closed

Chunai-Bboy wants to merge 1 commit into
anomalyco:devfrom
Chunai-Bboy:fix/todo-dock-stale-lists

Conversation

@Chunai-Bboy

@Chunai-Bboy Chunai-Bboy commented Oct 2, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #41359

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The todo dock only hides when the last item finishes - it never clears. So the old items come back on the next session open, and the sync used to force a re-fetch that pulled them straight back from the database.

Two small things in the app cause it:

  1. session-composer-state.ts - the setTimeout in scheduleClose sets dock: false and stops the timer, but never calls the clear() that sits right above it.
  2. pages/session.tsx - the todo sync passes force: true and a cached fallback, so it re-fetches stale rows even after the dock closed.

This calls clear() after the fade-out completes, and drops the force/cached args so a closed dock stays closed.

The fetch itself is untouched - if the dock is open it still loads from the database.

Known limit: this is client-side only. The server-side rows are not deleted. session.todo is registered as GET only and Todo.Interface exposes just update and get, so there is currently no endpoint a client could call to clear them. Consumers reading GET /session/{id}/todo directly - third-party UIs, plugins - will still see the stored list. Clearing server-side needs an API that does not exist yet; that would be a separate change, and the "when to clear" semantics are a maintainer decision.

How did you verify your code works?

I traced the state machine in todoState and confirmed the existing session-composer-state unit tests still describe the same transitions. Local tsc --noEmit over both changed files reports nothing beyond missing-dependency noise (Cannot find module), identical to an unmodified checkout of dev. I have not run the full suite or the app build.

Screenshots / recordings

None.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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
@Chunai-Bboy
Chunai-Bboy force-pushed the fix/todo-dock-stale-lists branch from ef95bbd to 02bd2e6 Compare October 2, 2026 19:10
@Chunai-Bboy

Copy link
Copy Markdown
Author

Rebased onto the current dev (was sitting on an older base).

The diff is unchanged — the 14 commits in between never touched session.tsx or session-composer-state.ts, so there was nothing to resolve.

Heads-up on the CI jobs: they are stuck at "waiting for status report" because workflows from a fork need maintainer approval to run. Local tsc --noEmit on the two files reports no errors beyond missing-dependency noise (Cannot find module), identical to an unmodified checkout of dev.

@thdxr

thdxr commented Oct 10, 2026

Copy link
Copy Markdown
Member

This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2.

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr thdxr closed this Oct 10, 2026
@Chunai-Bboy

Copy link
Copy Markdown
Author

Before porting I read through the V2 composer. session-composer-state.ts and its todo-dock state machine are gone in V2 — it now has session/composer/queue.ts / region.tsx, and I could not find the same "hide but never clear + force refetch" pattern in the rewritten code. Combined with today's fix(session-ui): drop stale todowrite tool label (#53966), it seems the todo panel was reworked there.

So this fix is probably moot against V2 as well, and I will not open a V2 PR unless one of you confirms the stale-resurrection behavior still exists. Two things worth keeping in mind if it does: the server-side rows are still never deleted (session.todo is GET-only), so whatever the dock does on close, third-party consumers of GET /session/{id}/todo still see old rows — and #41359 stays open until someone confirms V2 behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] todowrite list goes stale for several turns, stays stuck on one item, and leaks the previous task's todos when switching to a new task

2 participants