Feat: VSCode lineage "Only Direct Neighbors" filter#5815
Merged
StuffbyYuki merged 2 commits intoMay 29, 2026
Conversation
Selecting a model in the VSCode lineage panel renders the full transitive lineage, which can be dense for hub models. This adds a new toggle to the existing settings menu that limits the view to the selected model plus its direct parents and direct children. The filter is implemented as a new withOnlyDirect boolean on LineageFlowContext, paired with a directNeighbors set memoized from the lineage map and mainNode. When enabled, getUpdatedNodes and getUpdatedEdges hide anything outside that set, leaving existing withConnected/withImpacted/withSecondary logic untouched. Refs SQLMesh#5811 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Bart Schuijt <schuijt.bart@gmail.com>
- Build reverse parent->children adjacency map once per lineage change so directNeighbors stays O(parents + children) per mainNode switch instead of scanning the full graph each time. - Hoist SettingsControl itemClass to module scope; rename props to withOnlyDirect / onWithOnlyDirectChange for consistency with the rest of the codebase. - Extend lineage_settings.spec.ts with a Playwright test that toggles "Only Direct Neighbors" and asserts the visible node count drops and is restored on toggle-off. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Bart Schuijt <schuijt.bart@gmail.com>
c7c1a56 to
6192058
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposes a fix for #5811.
Adds an "Only Direct Neighbors" toggle to the VSCode lineage panel's settings menu (the cog icon in the bottom-left controls). When enabled, the view collapses to the selected model + its direct parents + its direct children — independent of the existing
withConnected/withImpacted/withSecondaryflags.Summary
withOnlyDirect: booleanstate anddirectNeighbors: Set<ModelEncodedFQN>memo onLineageFlowContext(vscode/react/src/components/graph/context.tsx).directNeighborsis derived from the lineage map andmainNode.getUpdatedNodesandgetUpdatedEdges(vscode/react/src/components/graph/help.ts) take the new flag + set as optional parameters and hide anything outside the direct set when the flag is on. Existing filtering logic is untouched.SettingsControl(vscode/react/src/components/graph/SettingsControl.tsx) gains a second menu item that toggles the flag.Default is off, so behavior is unchanged unless the user opts in.
Screenshots
Current behavior

New toggle

Only direct neighbors

Test plan
Locally tested in a transformer repo against a model with ~30+ downstream nodes; the filter collapses the view to ~10 nodes as expected.