Repository navigation
Refactor UI components to be props-driven and Tauri-independent - #1391
Conversation
#1384) - TextNode, TaskNode, DateNode: remove sharedNodeStore/structureTree reads; accept content/nodeType/children purely as props (base-node-viewer already passes them) - TaskNode taskState now derives from metadata.taskState (pre-computed by extractNodeMetadata) falling back to content-based syntax detection - BacklinksPanel: replace nodeId+sharedNodeStore subscription with backlinks prop; base-node-viewer passes currentViewedNode.mentionedIn - NavigationSidebar: remove @tauri-apps/api/event import; pro:tier-detected handler moved to app-shell.svelte where Tauri API already lives - Add props-driven-components.test.ts with 15 tests verifying props contracts and business logic for each refactored component - Update backlinks-panel.test.ts to reflect props-driven API Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR delivers a well-scoped refactoring that meaningfully improves testability and component isolation. The core approach — removing store reads from leaf components and flowing data down through the FindingsCritical Issues[Critical/Blocker] The old code path went through the now-deleted case 'done':
case 'cancelled':
return 'completed';The new path relies on // core-plugins.ts extractMetadata
if (status === 'IN_PROGRESS' || status === 'in_progress') { taskState = 'inProgress'; }
else if (status === 'DONE' || status === 'done') { taskState = 'completed'; }
else if (status === 'OPEN' || status === 'open') { taskState = 'pending'; }
// 'cancelled' → falls through → taskState = 'pending'
Fix: Add the missing case to } else if (status === 'CANCELLED' || status === 'cancelled') {
taskState = 'completed';
}This also removes a pre-existing gap that the old Suggested Improvements[Improvement] The
This is now false — the component is purely props-driven. The docblock should be updated to reflect the new props interface. Stale comments erode trust in documentation. [Improvement]
[Improvement] Test coverage gap — The new [Improvement] Minor test duplication between the two test files
Nitpicks
Acceptance Criteria Status
The |
malibio
left a comment
There was a problem hiding this comment.
This is a self-review. Recommendation: REQUEST CHANGES before merge. See full findings in the comment above. The critical blocker is the cancelled task status regression in core-plugins.ts — one-liner fix required.
…anup - Fix core-plugins.ts: map cancelled/CANCELLED task status to 'completed' taskState (was falling through to default 'pending' — regression introduced when removing taskStatusToNodeState from task-node.svelte) - Remove $bindable from nodeType in task-node.svelte (no parent binds to it) - Update core-plugins.test.ts: correct stale expectation that cancelled → 'pending' - Add cancelled status test in props-driven-components.test.ts - Fix stale docblock in backlinks-panel.svelte (no longer uses SharedNodeStore) - Remove stale REFACTOR (Issue #316) comments from task-node.svelte Co-Authored-By: Claude <[email protected]>
Re-Review — PR #1391 (Issue #1384)All findings from the initial review have been addressed. Below is the verification of each item. Critical Issue — Resolved
The fix is correctly placed within the } else if (status === 'CANCELLED' || status === 'cancelled') {
taskState = 'completed';
}Both lowercase and uppercase variants are handled consistently with the pattern used for the other status values in the same block. The placement is correct — it participates in the One behavioral note worth documenting: Suggested Improvements — All Resolved
Nitpicks — All Resolved
New Issues IntroducedNone. The fix commit is tightly scoped to the five files identified in the initial review. No unrelated files were modified. The logic change in Verdict: APPROVEDAll critical and improvement-level findings are addressed. The codebase is in a better state than before — the |
malibio
left a comment
There was a problem hiding this comment.
Re-review complete. All findings addressed — see full report in the comment above. Verdict: APPROVE (GitHub blocks self-approval, but this PR is clear to merge).
* Refactor UI components to be props-driven and Tauri-independent (closes #1384) - TextNode, TaskNode, DateNode: remove sharedNodeStore/structureTree reads; accept content/nodeType/children purely as props (base-node-viewer already passes them) - TaskNode taskState now derives from metadata.taskState (pre-computed by extractNodeMetadata) falling back to content-based syntax detection - BacklinksPanel: replace nodeId+sharedNodeStore subscription with backlinks prop; base-node-viewer passes currentViewedNode.mentionedIn - NavigationSidebar: remove @tauri-apps/api/event import; pro:tier-detected handler moved to app-shell.svelte where Tauri API already lives - Add props-driven-components.test.ts with 15 tests verifying props contracts and business logic for each refactored component - Update backlinks-panel.test.ts to reflect props-driven API Co-Authored-By: Claude <[email protected]> * Address review feedback: fix cancelled task status regression and cleanup - Fix core-plugins.ts: map cancelled/CANCELLED task status to 'completed' taskState (was falling through to default 'pending' — regression introduced when removing taskStatusToNodeState from task-node.svelte) - Remove $bindable from nodeType in task-node.svelte (no parent binds to it) - Update core-plugins.test.ts: correct stale expectation that cancelled → 'pending' - Add cancelled status test in props-driven-components.test.ts - Fix stale docblock in backlinks-panel.svelte (no longer uses SharedNodeStore) - Remove stale REFACTOR (Issue #316) comments from task-node.svelte Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
Closes #1384