From d6fa200066842d5be0dd8b43c9107d16ee42b483 Mon Sep 17 00:00:00 2001 From: adgk2349 Date: Sat, 7 Mar 2026 20:35:42 +0900 Subject: [PATCH] docs: align impact and file-detail comments with current behavior --- crates/engine/src/impact_analysis.rs | 10 +++++----- editor/vscode/webview/graph.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/impact_analysis.rs b/crates/engine/src/impact_analysis.rs index a6d0c84..2bcf8e2 100644 --- a/crates/engine/src/impact_analysis.rs +++ b/crates/engine/src/impact_analysis.rs @@ -1,11 +1,11 @@ use crate::graph_builder::{BuiltGraph, BuiltNode}; use std::collections::{HashMap, HashSet, VecDeque}; -/// Return all nodes reachable from `start_node_ids` by following `calls` edges -/// in `graph` (forward BFS reachability). +/// Return caller-side impact reachable from `start_node_ids` by following +/// `calls` edges in reverse direction. /// -/// The start nodes themselves are **excluded** from the result — only their -/// transitive dependants are returned. +/// Traversal follows `callee -> caller`, because when a callee changes its +/// callers are impacted. /// /// Only `calls` edges are traversed; `contains` edges (which express parent/ /// child containment) are intentionally ignored so that structural hierarchy @@ -14,7 +14,7 @@ use std::collections::{HashMap, HashSet, VecDeque}; /// # Example /// ```text /// A → B → C -/// impacted_nodes(graph, ["A"]) == [B, C] +/// impacted_nodes(graph, ["C"], ["C"]) == [B, A] /// ``` pub fn impacted_nodes( graph: &BuiltGraph, diff --git a/editor/vscode/webview/graph.js b/editor/vscode/webview/graph.js index a55cda3..d8c3f4d 100644 --- a/editor/vscode/webview/graph.js +++ b/editor/vscode/webview/graph.js @@ -1153,9 +1153,9 @@ } // ── showFileDetail ──────────────────────────────────────────────────────── - // Drills into a single file: shows its type nodes as top-level flat cards, - // with a file context card above them. Func nodes start hidden; clicking a - // type expands/collapses its funcs. Press Back/Overview to return. + // Drills into a single file: shows its type nodes as top-level flat cards + // with a file context card above them. Func nodes are visible by default, + // and clicking a type toggles its child funcs. Press Back/Overview to return. // // Rebuilt entirely from the raw analysis graph — does NOT depend on whatever // nodes are currently in the Cytoscape instance (overview virtual nodes etc).