Repository navigation
Task schema properties not settable in TaskNodeViewer for nested tasks - #923
Conversation
- Fix startedAt/completedAt missing from optimistic update in updateTaskNode() - Fix startedAt/completedAt missing from backend response mapping in updateTaskNode() - Fix state_unsafe_mutation Svelte 5 error in schema-property-form.svelte: pre-initialize comboboxOpen keys for date fields in $effect after schema loads instead of mutating $state inside template expressions (which Svelte 5 forbids) - Add tests for startedAt and completedAt optimistic update coverage - Update CLAUDE.md to guide agents to read architecture docs when working on node storage, data models, or type-specific fields 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Code Review SummaryThis PR fixes two independent defects that were both blocking task schema properties from being settable in
Both fixes are correct, minimal, and well-scoped. The change is a clear net improvement and the defects are properly addressed. FindingsSuggested Improvements
The const localChanges: Partial<TaskNode> = {};
if (update.startedAt !== undefined) localChanges.startedAt = update.startedAt;This is a pre-existing pattern in the file, so it does not block this PR, but extending the same workaround to two more fields increases the surface area for future drift.
The Acceptance Criteria Coverage
Nitpicks
VerdictApprove. Both bugs are correctly fixed, the Svelte 5 rune compliance is enforced via tooling ( 🤖 Generated with Claude Code |
|
Review Status: APPROVED — Detailed findings posted above. Both defects are correctly fixed, all quality gates pass, and the change is a clear net improvement. Safe to merge. |
- Suggestion 1: Replace six `(localChanges as Record<string, unknown>)[key]`
casts in `updateTaskNode` with a properly typed `Partial<TaskNode>` local
variable, eliminating the type-assertion idiom and enabling full compiler
verification of field names and value types. Null-to-undefined coercion is
applied for `priority` since `TaskNode.priority` is `T | undefined` while
`TaskNodeUpdate.priority` allows `null` to clear the field.
- Suggestion 2: Unify combobox/popover pre-initialization in the schema
load `$effect` to cover text/string fields alongside date fields. Date
fields require this because they use `bind:open`; text/assignee fields
are now initialized here too for a consistent strategy.
- Nitpick 1: Update test result casts from `Node & { field?: T }` to
`unknown as TaskNode` across all `updateTaskNode` test assertions, giving
stronger typing via the canonical `TaskNode` interface.
- Nitpick 2: Correct stale "Svelte 4.x" in CLAUDE.md to "Svelte 5.x" with
rune context ($state, $derived, $effect).
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Review Recommendations AddressedAll four items from the review have been addressed in commit d2ae68d. Suggestion 1: Type-assertion pattern in
|
#923) * Fix: Task schema properties settable in TaskNodeViewer (closes #919) - Fix startedAt/completedAt missing from optimistic update in updateTaskNode() - Fix startedAt/completedAt missing from backend response mapping in updateTaskNode() - Fix state_unsafe_mutation Svelte 5 error in schema-property-form.svelte: pre-initialize comboboxOpen keys for date fields in $effect after schema loads instead of mutating $state inside template expressions (which Svelte 5 forbids) - Add tests for startedAt and completedAt optimistic update coverage - Update CLAUDE.md to guide agents to read architecture docs when working on node storage, data models, or type-specific fields 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.6 <[email protected]> * Address PR #923 review recommendations - Suggestion 1: Replace six `(localChanges as Record<string, unknown>)[key]` casts in `updateTaskNode` with a properly typed `Partial<TaskNode>` local variable, eliminating the type-assertion idiom and enabling full compiler verification of field names and value types. Null-to-undefined coercion is applied for `priority` since `TaskNode.priority` is `T | undefined` while `TaskNodeUpdate.priority` allows `null` to clear the field. - Suggestion 2: Unify combobox/popover pre-initialization in the schema load `$effect` to cover text/string fields alongside date fields. Date fields require this because they use `bind:open`; text/assignee fields are now initialized here too for a consistent strategy. - Nitpick 1: Update test result casts from `Node & { field?: T }` to `unknown as TaskNode` across all `updateTaskNode` test assertions, giving stronger typing via the canonical `TaskNode` interface. - Nitpick 2: Correct stale "Svelte 4.x" in CLAUDE.md to "Svelte 5.x" with rune context ($state, $derived, $effect). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --------- Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Closes #919