-
Notifications
You must be signed in to change notification settings - Fork 92
Fix pinned 'top nodes' tooltip not updated when choosing another metric #5348
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
Conversation
19c8af6 to
98f0d22
Compare
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.
Pull request overview
This PR fixes a UX issue where the pinned 'top nodes' tooltip would not update when the user selected a different metric. The solution refactors the tooltip refresh mechanism to automatically update when metadata changes, and simplifies the API by removing the metric parameter from showTopNodes() since the metric is now selected separately.
Key Changes:
- Introduced a tooltip refresh callback mechanism that triggers when metadata (including metric selection) changes
- Refactored
showTopNodes()to use the currently selected metric instead of requiring it as a parameter - Fixed a CSS bug where the tooltip max-width calculation had a typo (used
+instead of-)
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| js-packages/web-console/src/lib/components/profiler/ProfilerTooltip.svelte | Fixed max-width calculation typo in tooltip styling |
| js-packages/web-console/src/lib/components/profiler/ProfilerLayout.svelte | Replaced event handler with reactive effect for metric changes; removed metric parameter from showTopNodes calls |
| js-packages/web-console/src/lib/components/profiler/ProfilerDiagram.svelte | Removed metric parameter from showTopNodes method signature |
| js-packages/profiler-lib/src/profiler.ts | Added tooltip refresh callback mechanism and refactored showTopNodes to use selected metric internally |
| js-packages/profiler-lib/src/metadataSelection.ts | Extracted notifyMetricsChanged into separate method for better code organization |
| js-packages/profiler-lib/src/cytograph.ts | Added callback invocation when tooltip context changes |
| js-packages/profiler-app/src/index.ts | Removed metric parameter from showTopNodes calls |
| js-packages/profiler-app/src/fileLoader.ts | Removed metric parameter from showTopNodes method signature |
| bun.lock | Updated dependency versions for @sveltejs/kit, svelte, and esrap |
| this.circuitSelector = null; | ||
| this.metadataSelector = null; | ||
| this.rendering = null; | ||
| this.onRefreshTooltip = null |
Copilot
AI
Dec 30, 2025
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.
Missing semicolon at end of statement. Add semicolon for consistency with project style.
| this.onRefreshTooltip = null | |
| this.onRefreshTooltip = null; |
| metricButton?.addEventListener('mouseover', () => loader.showTopNodes(false)); | ||
| metricButton?.addEventListener('mouseout', () => loader.hideNodeAttributes()); | ||
| metricButton?.addEventListener('click', () => loader.showTopNodes(metricSelector.value, true)); | ||
| metricButton?.addEventListener('click', () => loader.showTopNodes(true) ); |
Copilot
AI
Dec 30, 2025
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.
Inconsistent spacing before closing parenthesis. Remove the space before the closing parenthesis to match the formatting on line 228.
| metricButton?.addEventListener('click', () => loader.showTopNodes(true) ); | |
| metricButton?.addEventListener('click', () => loader.showTopNodes(true)); |
Fix tooltip styles to not take up full height regardless of content Made table headers sticky Signed-off-by: Karakatiza666 <[email protected]>
98f0d22 to
84861d8
Compare
Please decide with @ryzhyk if we want this change; I believe it is clearly a better UX, and makes the behavior more intuitive.
Also: showTopNodes() method in profiler-lib no longer takes the selected metric as an argument because it is selected with a separate function call beforehand.