Repository navigation
Fix: Smart navigation resolveWithRootAncestor breaks task node viewer opening - #916
Conversation
…viewer (#915) findRootAncestor() now checks if the target node has its own dedicated viewer (via pluginRegistry.hasViewer) before walking up the tree. Entity nodes like task, date, and query open in their own viewer instead of being resolved to a parent's viewer. Primitive child nodes (text, header) still correctly resolve to their nearest viewer-owning ancestor. Co-Authored-By: Claude <[email protected]>
Pragmatic Code Review -- PR #916Reviewer: Principal Engineer AI (claude-opus-4-6) Requirements Check (Issue #915)
All acceptance criteria are addressed. Code Review FindingsNo Critical Issues FoundThe implementation is clean, minimal, and correctly scoped. Suggested Improvements1. [Improvement] Defensive handling when node is not in sharedNodeStore ( const targetNode = sharedNodeStore.getNode(nodeId);
if (targetNode && pluginRegistry.hasViewer(targetNode.nodeType)) {
return nodeId;
}If In practice this is likely safe because However, 2. [Improvement] Method name The method no longer finds the root ancestor -- it finds the nearest viewer-owning ancestor, or the root if no viewer-owning ancestor exists. The name Consider renaming to Nitpicks
Architecture AssessmentThe design decision to use
The two-checkpoint approach (check target first, then check during walk) correctly handles both cases: (a) directly navigating to a viewer-owning node, and (b) a primitive node walking up and stopping at the first viewer-owning ancestor rather than overshooting to the tree root. Testing AssessmentThe 5 new tests cover the critical scenarios well:
One scenario that could be added in the future (not blocking): a viewer-owning node under another viewer-owning node under another viewer-owning node (3+ levels of entities). The current tests cover 2 levels, which is sufficient for now. RecommendationAPPROVE -- This is a clean, well-tested bug fix that correctly addresses the regression from #910. The implementation is minimal, uses existing infrastructure (pluginRegistry), and follows the Open/Closed Principle for future extensibility. The naming suggestions above are improvements but not blockers. The change is a clear net positive to code health. |
malibio
left a comment
There was a problem hiding this comment.
APPROVE (posted as comment since self-review is restricted). Clean, minimal bug fix with good test coverage. The pluginRegistry.hasViewer() approach is architecturally sound -- it leverages existing infrastructure and automatically handles future node types. See detailed review in PR comments for two optional naming improvements.
The method no longer finds the tree root — it finds the nearest viewer-owning ancestor. Renamed method, variables, and comments to reflect the updated semantics. Skipped: precondition comment suggestion — the call chain is self-evident (resolveWithNavigationAncestor always calls resolveNodeTarget first, which populates the store). Co-Authored-By: Claude <[email protected]>
Review Feedback Addressed✅ Addressed (1)
⏭️ Skipped (1)
Summary
|
… opening (#916) * Fix entity node navigation resolving to parent viewer instead of own viewer (#915) findRootAncestor() now checks if the target node has its own dedicated viewer (via pluginRegistry.hasViewer) before walking up the tree. Entity nodes like task, date, and query open in their own viewer instead of being resolved to a parent's viewer. Primitive child nodes (text, header) still correctly resolve to their nearest viewer-owning ancestor. Co-Authored-By: Claude <[email protected]> * Address review: rename findRootAncestor to findNavigationAncestor The method no longer finds the tree root — it finds the nearest viewer-owning ancestor. Renamed method, variables, and comments to reflect the updated semantics. Skipped: precondition comment suggestion — the call chain is self-evident (resolveWithNavigationAncestor always calls resolveNodeTarget first, which populates the store). Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
Closes #915