Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Asset graph sidebar] Preserve path when selecting a node in the side…
…bar (#16665) ## Summary & Motivation There are 2 sources of truth for the selected node, one tracked by the graph, and one tracked by the sidebar. The difference is that the one tracked by the sidebar includes a `path` (eg. the exact path of the node you selected) where as selecting a node from the graph doesn't have a path (it's ambiguous which path you want, so we just select the first path with a matching ID). When we sync the select node to the graph, the graph syncs the selected node back to the sidebar (`lastSelectedNode` = selected node from graph as source of truth, `selectedNode` = selected node from sidebar as source of truth) and it ends up overwriting the selected node from the sidebar which has the real path, causing the selected node's path in the sidebar to potentially be different than the one that was clicked. This pr adds a check to prevent that from happening by checking if the node synced back from the graph has the same ID as the selected node in the sidebar. ## How I Tested These Changes locally
- Loading branch information
25f11ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-8cj8mn41e-elementl.vercel.app
Built with commit 25f11ba.
This pull request is being automatically deployed with vercel-action