Drive counter tooltips from a tooltipRows schema#6023
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6023 +/- ##
==========================================
- Coverage 83.82% 83.82% -0.01%
==========================================
Files 330 331 +1
Lines 34682 34731 +49
Branches 9703 9629 -74
==========================================
+ Hits 29072 29113 +41
- Misses 5181 5190 +9
+ Partials 429 428 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replace the four hardcoded category branches in TrackCounterGraph's tooltip rendering (Memory / Power / Bandwidth / processCPU) with a declarative tooltipRows array on CounterDisplayConfig. Each row picks a data source (count, rate, accumulated, selection-total, …), a value format (unit, optional CO₂e, optional auto-scale ladder), and a label. The new TrackCounterTooltip component iterates the rows, resolves each source, formats the value, and renders through TooltipDetails. Memory and CPU tooltips now use the same TooltipDetails layout as Power and Bandwidth. Profile labels are raw English so the format stays self-describing. The frontend translates labels it recognizes from a private allow-list and renders unknown ones verbatim. The dedicated TooltipTrackPower component is removed; the power/energy unit ladders move into the formatter. Bumps the processed profile format to v63. The v63 upgrader derives tooltipRows from each counter's category and name. Closes firefox-devtools#5961.
canova
left a comment
There was a problem hiding this comment.
Looks good to me overall, thanks. I added some comments below
Drop the parallel ResolverContext type and read this.props directly. Extract picowatt-hour conversions into pwhToWh and pwhPerMsToWatts helpers. Memoize the per-range sample sums so mouse-move re-renders don't rescan the counter samples.
|
Thanks for your review, @canova! It seems like I have addressed all the issues now. |
canova
left a comment
There was a problem hiding this comment.
Thanks! Looks good to me, but I noticed one thing that we should fix before landing.
I was testing the localization with togglePseudoLocalization('accented') executed in the devtools console, and I can't see that the tooltips are properly localized currently.
For example, this is the same profile with profiler.firefox.com:
This is from the deploy preview:
Note that the profile in the initial comment doesn't include the labelKey so it won't work. I captured a new profile
Looks like because we updated the ftl keys to append 2.
|
Great catches, thanks @canova! Fixed now. I've also updated the PR description with the link to the profile you recorded. |
|
And thanks for the trick with |
Changes: [Nazım Can Altınova] Fix call node context menu being hidden behind source view bottom box (#6045) [Nazım Can Altınova] Pass `--use-env-proxy` only when the node version is >= 24 (#6064) [fatadel] Upgrade @firefox-devtools/react-contextmenu to 5.2.4 (#6066) [Markus Stange] Switch profiler-edit from minimist to commander (#6065) [Markus Stange] Support reading profiles from JsonSlabs files (#6037) [Florian Quèze] Don't fail profile processing when a marker's stack field is not a backtrace (#6069) [fatadel] Replace the footer-links overlay with a settings menu (#6042) [fatadel] Upgrade @types/node to match Node 24 (#6070) [fatadel] Remove unused undici-types package (#6074) [cathaysia] Update isLocalURL to include LAN addresses, .local domains, and hostn… (#5973) [Markus Stange] Fix from-url with binary profiles (#6072) [fatadel] Upgrade to React 19 (#6067) [Markus Stange] Add an insertStackLabels helper. (#6076) [fatadel] Drive counter tooltips from a tooltipRows schema (#6023) [fatadel] Add TrackPower--tooltip-average-power-microwatt (#6080) [Markus Stange] Downgrade to React 19.1 to fix unusable dev build performance. (#6082) [Nazım Can Altınova] Add source map symbolication and source view support (#6018) [spokodev] fix(FilterNavigatorBar): clip overflow so many breadcrumbs do not expand the parent (#6085) [Markus Stange] Move paddings inside the tree header cells. (#6002) [Markus Stange] Add an --insert-label-frames argument to the profiler-edit tool (#5966) [Markus Stange] Stop printing "error: too many arguments" during tests. (#6088) [Markus Stange] More additions to profiler-edit, for sp3 profiles (#6009) [Nazım Can Altınova] Do not rely on localized texts in the settings menu tests (#6101) And special thanks to our localizers: be: Andrei Mukamolau de: Ger de: Michael Köhler de: Ralf Duehnfahr el: Jim Spentzos en-CA: chutten en-GB: Ian Neal es-CL: ravmn fr: Théo Chevalier fr: wy fur: Fabio Tomat fy-NL: Fjoerfoks ia: Melo46 it: Francesco Lodolo [:flod] nl: Mark Heijl ru: Valery Ledovskoy sr: Марко Костић (Marko Kostić) sv-SE: Andreas Pettersson tr: Grk tr: Selim Şumlu zh-CN: Olvcpr423 zh-TW: Pin-guang Chen
Replace the four hardcoded category branches in TrackCounterGraph's tooltip rendering (Memory / Power / Bandwidth / processCPU) with a declarative tooltipRows array on CounterDisplayConfig. Each row picks a data source (count, rate, accumulated, selection-total, …), a value format (unit, optional CO₂e, optional auto-scale ladder), and a label.
The new TrackCounterTooltip component iterates the rows, resolves each source, formats the value, and renders through TooltipDetails. Memory and CPU tooltips now use the same TooltipDetails layout as Power and Bandwidth.
Profile labels are raw English so the format stays self-describing. The frontend translates labels it recognizes from a private allow-list and renders unknown ones verbatim. The dedicated TooltipTrackPower component is removed; the power/energy unit ladders move into the formatter.
Bumps the processed profile format to v63. The v63 upgrader derives tooltipRows from each counter's category and name.
Closes #5961.
Profile