Skip to content

fix: autofix navigation on subgraph create undo#2145

Open
maxy-shpfy wants to merge 1 commit into04-22-fix_windows_state_persistence_and_default_layoutfrom
04-22-fix_autofix_navigation_on_subgraph_create_undo
Open

fix: autofix navigation on subgraph create undo#2145
maxy-shpfy wants to merge 1 commit into04-22-fix_windows_state_persistence_and_default_layoutfrom
04-22-fix_autofix_navigation_on_subgraph_create_undo

Conversation

@maxy-shpfy
Copy link
Copy Markdown
Collaborator

@maxy-shpfy maxy-shpfy commented Apr 23, 2026

Description

When a user is navigating inside a nested subgraph and performs an undo/redo operation that removes that subgraph, the navigation path becomes invalid (i.e., activeSpec is null while the path depth is greater than 1). This leaves the editor in a broken state with no visible spec.

A correctInvalidNavigation action has been added to NavigationStore that trims the navigation path back to the deepest level that still resolves to a valid spec. A MobX reaction in useSpecLifecycle watches for this condition and triggers the correction automatically whenever it occurs.

Related Issue and Pull requests

Type of Change

  • Bug fix

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

Screen Recording 2026-04-22 at 10.47.29 PM.mov (uploaded via Graphite)

Test Instructions

  1. Open a pipeline that contains at least one nested subgraph/component.
  2. Navigate into the subgraph so the navigation path depth is greater than 1.
  3. Perform an undo operation that removes the subgraph you are currently viewing.
  4. Verify that the editor automatically navigates back to the deepest still-valid level rather than displaying a blank or broken state.
  5. Confirm that redo restores the subgraph and normal navigation resumes as expected.

Additional Comments

The disposeNavGuard cleanup is registered alongside the existing disposeTaskWatcher to ensure the reaction is torn down properly when the editor unmounts.

@github-actions
Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: 04-22-fix_autofix_navigation_on_subgraph_create_undo/67f97e7

@maxy-shpfy maxy-shpfy marked this pull request as ready for review April 23, 2026 05:50
@maxy-shpfy maxy-shpfy requested a review from a team as a code owner April 23, 2026 05:50
Copy link
Copy Markdown
Collaborator

@camielvs camielvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants