Repository navigation
Fix schema seeding, cross-pane reactivity, and add TaskNode type safety - #678
Conversation
PR #672 added camelCase serde attributes to Rust models but missed updating the browser dev mode seeding script (init-schemas-via-proxy.ts), causing schema fields like coreValues and userValues to not be deserialized properly. Changes: - is_core → isCore (all 7 schema definitions) - core_values → coreValues (task schema enum fields) - user_values → userValues (task schema enum fields) - due_date → dueDate, started_at → startedAt, completed_at → completedAt - Status values: UPPERCASE → lowercase (per Issue #670) This aligns the browser seeding script with: - Rust seed_core_schemas() which uses camelCase in json!() macro - Identifier naming conventions: JSON uses camelCase Verified: Task priority dropdown now shows Low/Medium/High options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Root cause: When slash commands converted placeholders to typed nodes, the on:slashCommandSelected handlers were missing two critical calls that existed in the on:contentChange handler: - reactiveStructureTree.addChild() - triggers visibleNodesFromStores update - resetPlaceholderId() - allows template to re-render with real node Without these calls, the node was correctly persisted to the database but the UI didn't update to reflect the new nodeType (e.g., task nodes rendered as text nodes with blue bullets instead of checkboxes). Also fixed variable shadowing in taskStateChanged handlers where destructured `nodeId` from event.detail shadowed the outer `nodeId` prop. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- TaskNode now derives status from sharedNodeStore instead of nodeData - Enables cross-pane synchronization when task status changes in one pane - Uses schema properties (properties.task.status) as primary source - Falls back to content-based task syntax for backward compatibility - Cleaned up outdated LIVE SELECT comments in reactive-node-data.svelte.ts Root cause: TaskNode used nodeData store (Tauri events) while SchemaPropertyForm updated sharedNodeStore, causing stores to be out of sync for in-memory property updates. Related: Issue #679 documents broader store consolidation plan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Create TaskNode type extending Node (matches CodeBlockNode pattern) - Add TaskStatus and TaskPriority types matching schema - Add type guard isTaskNode() and typed accessors: - getTaskStatus(), setTaskStatus() - getTaskPriority(), setTaskPriority() - getTaskDueDate(), setTaskDueDate() - Add TaskNodeHelpers with isCompleted(), isActive(), isPending() - Update task-node.svelte to use type-safe helpers instead of manual property access with 'as' casts This brings TaskNode in line with other typed node variants (CodeBlockNode, QuoteBlockNode, OrderedListNode). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add CoreTaskStatus and CoreTaskPriority for protected values - TaskStatus/TaskPriority now accept string for user-defined values - Add isCoreStatus() and isCorePriority() type guards - Update display name helpers to format user-defined values (capitalizes words, replaces underscores with spaces) Schema supports extensible: true on enums, so types must allow user-defined values beyond the core set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Root cause: sharedNodeStore uses plain Map (not $state), so $derived doesn't re-evaluate when nodes are loaded asynchronously. On page refresh with persisted tabs, the viewer renders before node data loads. Fix: Add viewedNodeCache $state variable that gets updated after loadChildrenForParent completes, triggering reactivity for the SchemaPropertyForm condition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Code Review ReportReview Type: Initial Review Requirements CheckThis PR is a multi-fix PR without a linked issue. It addresses six distinct problems as described in the PR summary:
Code Review FindingsCritical [Blocker] Code Inconsistency: Status Case Mismatch📁 packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:1436-1453 and 1605-1622 Issue: The Current code (two locations): on:taskStateChanged={(e) => {
const { nodeId: eventNodeId, state } = e.detail;
// Map UI state to schema enum value
let schemaStatus: string;
switch (state) {
case 'pending':
schemaStatus = 'OPEN'; // Should be 'open'
break;
case 'inProgress':
schemaStatus = 'IN_PROGRESS'; // Should be 'in_progress'
break;
case 'completed':
schemaStatus = 'DONE'; // Should be 'done'
break;
default:
schemaStatus = 'OPEN'; // Should be 'open'
}
updateSchemaField(eventNodeId, 'status', schemaStatus);
}}Impact: When clicking on task checkboxes to change status, the schema property will be set to 'OPEN' instead of 'open', causing a mismatch with the schema definition and potentially breaking status-based queries/filters. Recommendation: switch (state) {
case 'pending':
schemaStatus = 'open';
break;
case 'inProgress':
schemaStatus = 'in_progress';
break;
case 'completed':
schemaStatus = 'done';
break;
default:
schemaStatus = 'open';
}Engineering Principle: Data consistency - schema enum values must match across all layers (seeding, reading, writing) to prevent data integrity issues and ensure queries work correctly. Suggestion [Improvement] Code Duplication: Repeated taskStateChanged Handler Logic📁 packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:1433-1454 and 1605-1626 The exact same Recommendation: Extract the status mapping logic into a helper function: function mapNodeStateToSchemaStatus(state: string): string {
switch (state) {
case 'pending':
return 'open';
case 'inProgress':
return 'in_progress';
case 'completed':
return 'done';
default:
return 'open';
}
}Then use in both handlers: on:taskStateChanged={(e) => {
const { nodeId: eventNodeId, state } = e.detail;
updateSchemaField(eventNodeId, 'status', mapNodeStateToSchemaStatus(state));
}}Engineering Principle: DRY (Don't Repeat Yourself) - duplicated logic should be extracted to a single source of truth to reduce maintenance burden and prevent divergence. Suggestion [Improvement] Type Safety Enhancement: Consider Using TaskStatus Type📁 packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:1437 The Current code: let schemaStatus: string;Recommendation: import type { TaskStatus } from '$lib/types/task-node';
// ...
let schemaStatus: TaskStatus;Engineering Principle: Type safety - leverage existing type definitions to catch errors at compile time rather than runtime. Nit [Polish] Import Cleanup in task-node.svelte📁 packages/desktop-app/src/lib/design/components/task-node.svelte:24 The Current code: import { isTaskNode, getTaskStatus, type TaskStatus } from '$lib/types/task-node';This is already correct! The Positive [Approval]: Excellent Type-Safe Task Node Design📁 packages/desktop-app/src/lib/types/task-node.ts The new
This is a model for how to add type safety to other node types in the future. Positive [Approval]: Cross-Pane Reactivity Fix📁 packages/desktop-app/src/lib/design/components/task-node.svelte:48-56 The switch from Positive [Approval]: viewedNodeCache Reactivity Fix📁 packages/desktop-app/src/lib/design/components/base-node-viewer.svelte:134-138 The addition of Summary
Tests: All 1493 tests passing. Manual testing checklist provided in PR. RecommendationREQUEST CHANGES The status case mismatch between schema seeding (lowercase) and taskStateChanged handlers (UPPERCASE) is a functional bug that will cause data inconsistencies. This must be fixed before merge. After fixing the UPPERCASE -> lowercase status values in base-node-viewer.svelte (lines 1436-1453 and 1605-1626), this PR provides valuable improvements:
The code quality is generally high with good documentation and proper architectural decisions. |
malibio
left a comment
There was a problem hiding this comment.
See code review comment for details. Critical issue: Status case mismatch in taskStateChanged handlers (UPPERCASE vs lowercase) must be fixed.
Address code review findings from PR #678: - 🔴 Critical: Fixed status case mismatch - handlers now use lowercase values ('open', 'in_progress', 'done') matching schema seeding - 🟡 Important: Extracted duplicated status mapping logic into mapNodeStateToSchemaStatus() helper function (DRY principle) Skipped recommendations: - 🟢 Using TaskStatus type: The schemaStatus variable is immediately passed to updateSchemaField() which expects a string. Adding the type would require additional type assertions with marginal benefit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Review Feedback Addressed ✅Changes Made
Implementation Details
Skipped RecommendationUsing TaskStatus type for schemaStatus variable: Skipped because the variable is immediately passed to Verification
Commit
|
Add type safety to status mapping function by using CoreTaskStatus return type instead of plain string. This catches typos at compile time and documents that only core status values are returned. Addresses reviewer suggestion from PR #678 code review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ty (#678) * Fix: Use camelCase for JSON schema fields in browser dev seeding script PR #672 added camelCase serde attributes to Rust models but missed updating the browser dev mode seeding script (init-schemas-via-proxy.ts), causing schema fields like coreValues and userValues to not be deserialized properly. Changes: - is_core → isCore (all 7 schema definitions) - core_values → coreValues (task schema enum fields) - user_values → userValues (task schema enum fields) - due_date → dueDate, started_at → startedAt, completed_at → completedAt - Status values: UPPERCASE → lowercase (per Issue #670) This aligns the browser seeding script with: - Rust seed_core_schemas() which uses camelCase in json!() macro - Identifier naming conventions: JSON uses camelCase Verified: Task priority dropdown now shows Low/Medium/High options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Add missing reactivity calls in slashCommandSelected handlers Root cause: When slash commands converted placeholders to typed nodes, the on:slashCommandSelected handlers were missing two critical calls that existed in the on:contentChange handler: - reactiveStructureTree.addChild() - triggers visibleNodesFromStores update - resetPlaceholderId() - allows template to re-render with real node Without these calls, the node was correctly persisted to the database but the UI didn't update to reflect the new nodeType (e.g., task nodes rendered as text nodes with blue bullets instead of checkboxes). Also fixed variable shadowing in taskStateChanged handlers where destructured `nodeId` from event.detail shadowed the outer `nodeId` prop. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: TaskNode cross-pane reactivity via sharedNodeStore - TaskNode now derives status from sharedNodeStore instead of nodeData - Enables cross-pane synchronization when task status changes in one pane - Uses schema properties (properties.task.status) as primary source - Falls back to content-based task syntax for backward compatibility - Cleaned up outdated LIVE SELECT comments in reactive-node-data.svelte.ts Root cause: TaskNode used nodeData store (Tauri events) while SchemaPropertyForm updated sharedNodeStore, causing stores to be out of sync for in-memory property updates. Related: Issue #679 documents broader store consolidation plan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * feat: add type-safe TaskNode interface with helpers - Create TaskNode type extending Node (matches CodeBlockNode pattern) - Add TaskStatus and TaskPriority types matching schema - Add type guard isTaskNode() and typed accessors: - getTaskStatus(), setTaskStatus() - getTaskPriority(), setTaskPriority() - getTaskDueDate(), setTaskDueDate() - Add TaskNodeHelpers with isCompleted(), isActive(), isPending() - Update task-node.svelte to use type-safe helpers instead of manual property access with 'as' casts This brings TaskNode in line with other typed node variants (CodeBlockNode, QuoteBlockNode, OrderedListNode). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: make TaskStatus and TaskPriority user-extensible - Add CoreTaskStatus and CoreTaskPriority for protected values - TaskStatus/TaskPriority now accept string for user-defined values - Add isCoreStatus() and isCorePriority() type guards - Update display name helpers to format user-defined values (capitalizes words, replaces underscores with spaces) Schema supports extensible: true on enums, so types must allow user-defined values beyond the core set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: SchemaPropertyForm not showing on page refresh for persisted tabs Root cause: sharedNodeStore uses plain Map (not $state), so $derived doesn't re-evaluate when nodes are loaded asynchronously. On page refresh with persisted tabs, the viewer renders before node data loads. Fix: Add viewedNodeCache $state variable that gets updated after loadChildrenForParent completes, triggering reactivity for the SchemaPropertyForm condition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Use lowercase status values in taskStateChanged handlers Address code review findings from PR #678: - 🔴 Critical: Fixed status case mismatch - handlers now use lowercase values ('open', 'in_progress', 'done') matching schema seeding - 🟡 Important: Extracted duplicated status mapping logic into mapNodeStateToSchemaStatus() helper function (DRY principle) Skipped recommendations: - 🟢 Using TaskStatus type: The schemaStatus variable is immediately passed to updateSchemaField() which expects a string. Adding the type would require additional type assertions with marginal benefit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: Use CoreTaskStatus type for mapNodeStateToSchemaStatus Add type safety to status mapping function by using CoreTaskStatus return type instead of plain string. This catches typos at compile time and documents that only core status values are returned. Addresses reviewer suggestion from PR #678 code review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
…ty (#678) * Fix: Use camelCase for JSON schema fields in browser dev seeding script PR #672 added camelCase serde attributes to Rust models but missed updating the browser dev mode seeding script (init-schemas-via-proxy.ts), causing schema fields like coreValues and userValues to not be deserialized properly. Changes: - is_core → isCore (all 7 schema definitions) - core_values → coreValues (task schema enum fields) - user_values → userValues (task schema enum fields) - due_date → dueDate, started_at → startedAt, completed_at → completedAt - Status values: UPPERCASE → lowercase (per Issue #670) This aligns the browser seeding script with: - Rust seed_core_schemas() which uses camelCase in json!() macro - Identifier naming conventions: JSON uses camelCase Verified: Task priority dropdown now shows Low/Medium/High options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Add missing reactivity calls in slashCommandSelected handlers Root cause: When slash commands converted placeholders to typed nodes, the on:slashCommandSelected handlers were missing two critical calls that existed in the on:contentChange handler: - reactiveStructureTree.addChild() - triggers visibleNodesFromStores update - resetPlaceholderId() - allows template to re-render with real node Without these calls, the node was correctly persisted to the database but the UI didn't update to reflect the new nodeType (e.g., task nodes rendered as text nodes with blue bullets instead of checkboxes). Also fixed variable shadowing in taskStateChanged handlers where destructured `nodeId` from event.detail shadowed the outer `nodeId` prop. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: TaskNode cross-pane reactivity via sharedNodeStore - TaskNode now derives status from sharedNodeStore instead of nodeData - Enables cross-pane synchronization when task status changes in one pane - Uses schema properties (properties.task.status) as primary source - Falls back to content-based task syntax for backward compatibility - Cleaned up outdated LIVE SELECT comments in reactive-node-data.svelte.ts Root cause: TaskNode used nodeData store (Tauri events) while SchemaPropertyForm updated sharedNodeStore, causing stores to be out of sync for in-memory property updates. Related: Issue #679 documents broader store consolidation plan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * feat: add type-safe TaskNode interface with helpers - Create TaskNode type extending Node (matches CodeBlockNode pattern) - Add TaskStatus and TaskPriority types matching schema - Add type guard isTaskNode() and typed accessors: - getTaskStatus(), setTaskStatus() - getTaskPriority(), setTaskPriority() - getTaskDueDate(), setTaskDueDate() - Add TaskNodeHelpers with isCompleted(), isActive(), isPending() - Update task-node.svelte to use type-safe helpers instead of manual property access with 'as' casts This brings TaskNode in line with other typed node variants (CodeBlockNode, QuoteBlockNode, OrderedListNode). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: make TaskStatus and TaskPriority user-extensible - Add CoreTaskStatus and CoreTaskPriority for protected values - TaskStatus/TaskPriority now accept string for user-defined values - Add isCoreStatus() and isCorePriority() type guards - Update display name helpers to format user-defined values (capitalizes words, replaces underscores with spaces) Schema supports extensible: true on enums, so types must allow user-defined values beyond the core set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: SchemaPropertyForm not showing on page refresh for persisted tabs Root cause: sharedNodeStore uses plain Map (not $state), so $derived doesn't re-evaluate when nodes are loaded asynchronously. On page refresh with persisted tabs, the viewer renders before node data loads. Fix: Add viewedNodeCache $state variable that gets updated after loadChildrenForParent completes, triggering reactivity for the SchemaPropertyForm condition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Use lowercase status values in taskStateChanged handlers Address code review findings from PR #678: - 🔴 Critical: Fixed status case mismatch - handlers now use lowercase values ('open', 'in_progress', 'done') matching schema seeding - 🟡 Important: Extracted duplicated status mapping logic into mapNodeStateToSchemaStatus() helper function (DRY principle) Skipped recommendations: - 🟢 Using TaskStatus type: The schemaStatus variable is immediately passed to updateSchemaField() which expects a string. Adding the type would require additional type assertions with marginal benefit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: Use CoreTaskStatus type for mapNodeStateToSchemaStatus Add type safety to status mapping function by using CoreTaskStatus return type instead of plain string. This catches typos at compile time and documents that only core status values are returned. Addresses reviewer suggestion from PR #678 code review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
…ty (#678) * Fix: Use camelCase for JSON schema fields in browser dev seeding script PR #672 added camelCase serde attributes to Rust models but missed updating the browser dev mode seeding script (init-schemas-via-proxy.ts), causing schema fields like coreValues and userValues to not be deserialized properly. Changes: - is_core → isCore (all 7 schema definitions) - core_values → coreValues (task schema enum fields) - user_values → userValues (task schema enum fields) - due_date → dueDate, started_at → startedAt, completed_at → completedAt - Status values: UPPERCASE → lowercase (per Issue #670) This aligns the browser seeding script with: - Rust seed_core_schemas() which uses camelCase in json!() macro - Identifier naming conventions: JSON uses camelCase Verified: Task priority dropdown now shows Low/Medium/High options. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Add missing reactivity calls in slashCommandSelected handlers Root cause: When slash commands converted placeholders to typed nodes, the on:slashCommandSelected handlers were missing two critical calls that existed in the on:contentChange handler: - reactiveStructureTree.addChild() - triggers visibleNodesFromStores update - resetPlaceholderId() - allows template to re-render with real node Without these calls, the node was correctly persisted to the database but the UI didn't update to reflect the new nodeType (e.g., task nodes rendered as text nodes with blue bullets instead of checkboxes). Also fixed variable shadowing in taskStateChanged handlers where destructured `nodeId` from event.detail shadowed the outer `nodeId` prop. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: TaskNode cross-pane reactivity via sharedNodeStore - TaskNode now derives status from sharedNodeStore instead of nodeData - Enables cross-pane synchronization when task status changes in one pane - Uses schema properties (properties.task.status) as primary source - Falls back to content-based task syntax for backward compatibility - Cleaned up outdated LIVE SELECT comments in reactive-node-data.svelte.ts Root cause: TaskNode used nodeData store (Tauri events) while SchemaPropertyForm updated sharedNodeStore, causing stores to be out of sync for in-memory property updates. Related: Issue #679 documents broader store consolidation plan 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * feat: add type-safe TaskNode interface with helpers - Create TaskNode type extending Node (matches CodeBlockNode pattern) - Add TaskStatus and TaskPriority types matching schema - Add type guard isTaskNode() and typed accessors: - getTaskStatus(), setTaskStatus() - getTaskPriority(), setTaskPriority() - getTaskDueDate(), setTaskDueDate() - Add TaskNodeHelpers with isCompleted(), isActive(), isPending() - Update task-node.svelte to use type-safe helpers instead of manual property access with 'as' casts This brings TaskNode in line with other typed node variants (CodeBlockNode, QuoteBlockNode, OrderedListNode). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: make TaskStatus and TaskPriority user-extensible - Add CoreTaskStatus and CoreTaskPriority for protected values - TaskStatus/TaskPriority now accept string for user-defined values - Add isCoreStatus() and isCorePriority() type guards - Update display name helpers to format user-defined values (capitalizes words, replaces underscores with spaces) Schema supports extensible: true on enums, so types must allow user-defined values beyond the core set. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: SchemaPropertyForm not showing on page refresh for persisted tabs Root cause: sharedNodeStore uses plain Map (not $state), so $derived doesn't re-evaluate when nodes are loaded asynchronously. On page refresh with persisted tabs, the viewer renders before node data loads. Fix: Add viewedNodeCache $state variable that gets updated after loadChildrenForParent completes, triggering reactivity for the SchemaPropertyForm condition. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * fix: Use lowercase status values in taskStateChanged handlers Address code review findings from PR #678: - 🔴 Critical: Fixed status case mismatch - handlers now use lowercase values ('open', 'in_progress', 'done') matching schema seeding - 🟡 Important: Extracted duplicated status mapping logic into mapNodeStateToSchemaStatus() helper function (DRY principle) Skipped recommendations: - 🟢 Using TaskStatus type: The schemaStatus variable is immediately passed to updateSchemaField() which expects a string. Adding the type would require additional type assertions with marginal benefit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * refactor: Use CoreTaskStatus type for mapNodeStateToSchemaStatus Add type safety to status mapping function by using CoreTaskStatus return type instead of plain string. This catches typos at compile time and documents that only core status values are returned. Addresses reviewer suggestion from PR #678 code review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Summary
Commits
dueDate,startedAt,completedAtinstead of snake_casereactiveStructureTree.addChild()andresetPlaceholderId()callsnodeDatatosharedNodeStorefor status derivationTaskNode,TaskStatus,TaskPrioritytypes with helpersTaskStatusallows user-defined values beyond core statusesviewedNodeCacheto trigger reactivity after async loadTest Plan
Related
🤖 Generated with Claude Code