Skip to content

Fix graph viewer not re-rendering correctly after loading a second graph#4304

Merged
d10c merged 1 commit intogithub:mainfrom
asgerf:graph-viewer-restart
Feb 18, 2026
Merged

Fix graph viewer not re-rendering correctly after loading a second graph#4304
d10c merged 1 commit intogithub:mainfrom
asgerf:graph-viewer-restart

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Feb 18, 2026

This PR fixes an issue with the graph viewer (CFG viewer) that appears after loading two CFGs without closing the webview in-between.

To reproduce the issue:

  • Open the CFG viewer
  • Observe that pan-to-scroll works. And that clicking a node doesn't reset the scroll position within the webview.
  • Open the CFG viewer for a different function without closing the webview.
  • Pan-to-scroll no longer works. Clicking a node resets the scroll position.
  • Closing the webview and opening another CFG makes it work again.

Copilot CLI duly noticed that the key for the ResultsApp component was not changing when loading a new query run. Changing the key ensures the underlying d3-graphviz component gets reset properly when rendering a new graph.

Copilot AI review requested due to automatic review settings February 18, 2026 10:58
@asgerf asgerf requested a review from a team as a code owner February 18, 2026 10:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the graph viewer (CFG viewer) where the component wasn't properly re-rendering after loading a second graph without closing the webview. The issue manifested as broken pan-to-scroll functionality and incorrect scroll position behavior after viewing a second CFG.

Changes:

  • Updated the React key calculation for the ResultTables component to include the resultsPath in addition to selectedTable and pageNumber

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@d10c d10c left a comment

Choose a reason for hiding this comment

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

Thanks! Have you tested that this works now?

@asgerf
Copy link
Contributor Author

asgerf commented Feb 18, 2026

Yes, I've tested it on my own machine.

@d10c d10c merged commit 39140f2 into github:main Feb 18, 2026
24 checks passed
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

Comments