fix(app): todo dock reactivity to in-place todo updates#33116
Open
lexlian wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #33063
Type of change
What does this PR do?
The
SessionTodoDockrendered 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 viareconcile(todos, { key: "id" }), which preserves object references for matched IDs — so in-place status/content changes were invisible to<Index>.When the
todowritetool flipped a todo's status frompendingtocompletedor 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:Forto thesolid-jsimportTodoList: swap<Index>for<For>and update the render-prop signature from accessor(todo) => todo()to value(todo) => todoThe parent
SessionTodoDockretains its<Index each={progress()}>for stable progress label tokens (unchanged).How did you verify your code works?
bun run typecheckon the app package — no new errors introduced (25 pre-existing errors in unrelated files onorigin/devconfirmed unchanged)bun teston the app package — 406 pass / 1 fail, identical toorigin/devbaseline (the 1 failure is a missing@pierre/treesmodule inpierre-tree.test.ts, unrelated)packages/app/node_modules/solid-js/dist/dev.js:1244-1286(indexArray) shows<Index>only updates per-item signals whenitems[i] !== newItems[i], which is false for items preserved byreconcile({ key: "id" })<For each={list()}>with direct value access (item.status,item.content)origin/dev(009f3799c) viagit showof all affected filesScreenshots / recordings
N/A — desktop-only render fix verifiable via DOM state, requires interactive session with todowrite tool calls.
Checklist