-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(1094): Keep current visibility when adding a new entity to the ca… #1615
base: main
Are you sure you want to change the base?
Conversation
7ac6697
to
371de49
Compare
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1615 +/- ##
============================================
- Coverage 78.48% 78.47% -0.02%
Complexity 367 367
============================================
Files 468 468
Lines 14778 14784 +6
Branches 2746 2831 +85
============================================
+ Hits 11599 11602 +3
- Misses 3091 3094 +3
Partials 88 88 ☔ View full report in Codecov by Sentry. |
setTimeout(() => { | ||
const result = findRootVisualization(controller.getGraph(), newId); | ||
controller.fireEvent(SELECTION_EVENT, [result?.id]); | ||
}, 300); |
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.
@tplevko we now have the getVisualizationNodesFromGraph
function to look for canvas nodes.
setTimeout(() => {
const result = getVisualizationNodesFromGraph(
controller.getGraph(),
(vizNode) => vizNode.data.entity?.id === newId,
);
controller.fireEvent(SELECTION_EVENT, [result[0]?.id]);
}, 300);
That being said, I don't know a better way to ensure the selection happens after the rerender 😢 , so probably what's gonna happen for environments like DevSpaces, this might fail from time to time, since the SELECTION_EVENT
could happen before the actual rerender.
Would you be open to moving forward without the setTimeout for now until we get a better way to ensure the entity is properly selected?
1640aff
to
d7ad43b
Compare
Quality Gate passedIssues Measures |
…nvas
fixes #1094
vokoscreenNG-2024-11-13_15-03-55.mp4