Skip to content

VSCode lineage panel: add "direct parents/children only" (1-hop) filter #5811

@tjirab

Description

@tjirab

Problem

When selecting a model in the VSCode Lineage panel, the view renders the model's full transitive lineage — every upstream ancestor and every downstream descendant, including unrelated sibling chains that hang off shared ancestors. For models with rich lineage (e.g. a core dimension with ~30+ downstream nodes across marts/exports), this produces a dense graph where it's hard to see the model's immediate dependencies and consumers.

The existing "Only selected nodes" toggle (CircuitBoard icon) helps narrow the view, but it still walks the full transitive graph via recursive getAllIncomers / getAllOutgoers in web/common/src/components/Lineage/LineageLayoutBase.tsx (lines 122-162). There is no 1-hop mode.

Proposed UX

Replace the current binary toggle with a 3-state cycle button:

  1. All nodes (current default) — full graph
  2. Connected (transitive) — current "Only selected nodes" behavior
  3. Direct (1-hop) — selected node + direct parents + direct children only

Alternatively: keep the existing button and add a second one for "Direct only."

Implementation sketch

In LineageLayoutBase.tsx, the connectedNodes memo (lines 164-173) currently does:

const all = [
  ...getAllIncomers(selectedNode),
  ...getAllOutgoers(selectedNode),
]

For 1-hop, swap to React Flow's non-recursive helpers:

const all = [
  selectedNode,
  ...getIncomers(selectedNode, nodes, edges),
  ...getOutgoers(selectedNode, nodes, edges),
]

(Both are already imported at the top of the file.)

Environment

  • sqlmesh 0.234.0
  • VSCode extension Lineage panel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions