Skip to content

Conversation

@Karakatiza666
Copy link
Contributor

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.

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 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
Copy link

Copilot AI Dec 30, 2025

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.

Suggested change
this.onRefreshTooltip = null
this.onRefreshTooltip = null;

Copilot uses AI. Check for mistakes.
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) );
Copy link

Copilot AI Dec 30, 2025

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.

Suggested change
metricButton?.addEventListener('click', () => loader.showTopNodes(true) );
metricButton?.addEventListener('click', () => loader.showTopNodes(true));

Copilot uses AI. Check for mistakes.
Fix tooltip styles to not take up full height regardless of content

Made table headers sticky

Signed-off-by: Karakatiza666 <[email protected]>
@Karakatiza666 Karakatiza666 added this pull request to the merge queue Jan 1, 2026
Merged via the queue into main with commit ac92090 Jan 1, 2026
1 check passed
@Karakatiza666 Karakatiza666 deleted the profiler-fixes branch January 1, 2026 10:12
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.

3 participants