yousoph opened a new pull request, #42106: URL: https://github.com/apache/superset/pull/42106
### SUMMARY The "Tooltip sort by metric" control (`tooltipSortByMetric`) describes itself as sorting the tooltip "in descending order", but on **stacked** charts the tooltip actually displays in **ascending** order. Why: `extractTooltipKeys` (`utils/series.ts`) does sort descending (`b - a`), but the Timeseries tooltip formatter (`Timeseries/transformProps.ts`) then runs `rows.reverse()` whenever the chart is stacked — introduced in #23392 so stacked tooltips read top-of-stack first. The reverse runs unconditionally, so it also inverts the sort-by-metric ordering. Non-stacked charts (and the Mixed Chart, whose formatter has no such reverse) display descending as documented. This PR updates the control description to accurately describe both behaviors: > Whether to sort tooltip by the selected metric in descending order. On stacked charts, values are shown in ascending order. Documentation-only — no sorting behavior is changed. An alternative would be to skip the `rows.reverse()` when `tooltipSortByMetric` is enabled so the ordering is consistently descending, but that changes rendered behavior for existing users, so this PR just makes the description honest. Happy to follow up with the behavior change if preferred. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A — control description text only. ### TESTING INSTRUCTIONS Open a stacked Bar/Area chart, enable Rich tooltip, and hover the "Tooltip sort by metric" checkbox's info icon — the description now notes the ascending order on stacked charts. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
