Skip to content

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

Closed

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

Activity

  1. lvanoverberghe commented on May 28, 2026

    @lvanoverberghe

    Last update to the VS Code extension was over 8 months ago.

  2. tjirab commented on May 28, 2026

    @tjirab
    ContributorAuthor

    Correction to the implementation sketch above — I'd originally pointed at web/common/src/components/Lineage/LineageLayoutBase.tsx, but the VSCode lineage panel doesn't actually use @sqlmesh-common. The code that runs in the VSCode panel lives in vscode/react/src/components/graph/:

    • ModelLineage.tsx — renders the panel
    • context.tsx — LineageFlowContext with withConnected / withImpacted / withSecondary flags (all force-set to true on mount, which is why the panel currently shows everything)
    • help.ts — getUpdatedNodes / getUpdatedEdges decide node/edge visibility
    • SettingsControl.tsx — the cog menu in the bottom-left of the panel

    Opened #5815 with a proposed implementation along those lines. It adds a withOnlyDirect boolean + a memoized directNeighbors set (selected model + direct parents + direct children, computed from the lineage map) and a new toggle in the settings menu. Default off, so existing behavior is unchanged.

  3. added
    ImprovementImproves existing functionality
    UXIssues related to user experience such as config setting, cli output, debugging
    on May 28, 2026
  4. nickmuoh commented on Jun 15, 2026

    @nickmuoh
    Contributor

    This can be close since #5815 has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ImprovementImproves existing functionalityProject: VSCode ExtensionUXIssues related to user experience such as config setting, cli output, debugging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions