Skip to content

fix(app): todo dock reactivity to in-place todo updates - #33116

Closed
lexlian wants to merge 1 commit into
anomalyco:devfrom
lexlian:fix/todo-dock-reactivity
Closed

lexlian wants to merge 1 commit into
anomalyco:devfrom
lexlian:fix/todo-dock-reactivity

Conversation

@lexlian

@lexlian lexlian commented Jun 20, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #33063

Type of change

  • Bug fix

What does this PR do?

The SessionTodoDock rendered its todo list with Solid's <Index>, which only re-renders when the array length or item references change. The global todo store (serverSync().data.session_todo[id]) is updated via reconcile(todos, { key: "id" }), which preserves object references for matched IDs — so in-place status/content changes were invisible to <Index>.

When the todowrite tool flipped a todo's status from pending to completed or updated its content text, the dock's checkboxes stayed stale until a full page reload.

Switching <Index> to <For> diffs by value reference and re-runs the render prop when an item updates. <For> is the same primitive the TUI sidebar uses (packages/tui/src/feature-plugins/sidebar/todo.tsx:26), which works correctly today.

Single file change in packages/app/src/pages/session/composer/session-todo-dock.tsx:

  • Import: add For to the solid-js import
  • Inside TodoList: swap <Index> for <For> and update the render-prop signature from accessor (todo) => todo() to value (todo) => todo

The parent SessionTodoDock retains its <Index each={progress()}> for stable progress label tokens (unchanged).

How did you verify your code works?

  • bun run typecheck on the app package — no new errors introduced (25 pre-existing errors in unrelated files on origin/dev confirmed unchanged)
  • bun test on the app package — 406 pass / 1 fail, identical to origin/dev baseline (the 1 failure is a missing @pierre/trees module in pierre-tree.test.ts, unrelated)
  • Traced root cause through Solid source: packages/app/node_modules/solid-js/dist/dev.js:1244-1286 (indexArray) shows <Index> only updates per-item signals when items[i] !== newItems[i], which is false for items preserved by reconcile({ key: "id" })
  • Confirmed TUI is unaffected: uses <For each={list()}> with direct value access (item.status, item.content)
  • Confirmed bug exists on origin/dev (009f3799c) via git show of all affected files

Screenshots / recordings

N/A — desktop-only render fix verifiable via DOM state, requires interactive session with todowrite tool calls.

Checklist

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

The TodoList component rendered todos with Solid's <Index>, which only
re-renders on array length or item reference changes. The global todo
store updates via reconcile({ key: "id" }), preserving item references
for matched IDs, so in-place status/content changes were invisible to
<Index>. Switching to <For> diffs by value reference and re-runs the
render prop on item updates, matching the working TUI sidebar pattern
at packages/tui/src/feature-plugins/sidebar/todo.tsx.

Closes anomalyco#33063
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Todo dock UI does not refresh after todowrite tool updates session todos

1 participant