MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / stepEdgeVisible

Function stepEdgeVisible

ui/src/lib/steps-model.ts:1162–1180  ·  view source on GitHub ↗
(
  model: StepsModel,
  edge: MapEdgeLayout,
  selected: string | null,
  reach?: ReadonlySet<string>
)

Source from the content-addressed store, hash-verified

1160 * unregioned picture keeps the Map's rule.
1161 */
1162export function stepEdgeVisible(
1163 model: StepsModel,
1164 edge: MapEdgeLayout,
1165 selected: string | null,
1166 reach?: ReadonlySet<string>
1167): boolean {
1168 if (selected !== null) {
1169 const r = reach ?? selectionReach(model, selected);
1170 return r.has(edge.source) || r.has(edge.target);
1171 }
1172 if (edge.thin || edge.back) return false;
1173 // A hop too far to follow says itself in words on both its boxes instead
1174 // ({@link StepStub}); drawing it as well is the web those words replace.
1175 if (model.stubbed.has(edge.id)) return false;
1176 if (model.regions === null) return true;
1177 const from = model.nodes.get(edge.source)?.step;
1178 if (from?.anchor) return model.regionEntries?.has(edge.target) ?? true;
1179 return true;
1180}
1181
1182/** The side panel's two lists for a selected step. */
1183export function stepNeighbourhood(

Callers 2

Calls 3

selectionReachFunction · 0.85
hasMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected