fix(dashboards): Prevent double HTML-escaping in chart tooltips#111022
Open
fix(dashboards): Prevent double HTML-escaping in chart tooltips#111022
Conversation
The tooltip nameFormatter in TimeSeriesWidgetVisualization called truncationFormatter with escaping enabled, but the outer truncationFormatter in getFormatter already escapes. This caused the ">" delimiter in series names (e.g., "My Query > prod : count()") to be double-escaped to "&gt;", rendering as literal ">" in tooltips. Disable escaping in the inner truncationFormatter call, matching the pattern already used in categoricalSeriesWidgetVisualization and the legend formatter. Fixes DAIN-1223 Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
static/app/views/dashboards/widgets/timeSeriesWidget/timeSeriesWidgetVisualization.tsx
Outdated
Show resolved
Hide resolved
nikkikapadia
approved these changes
Mar 18, 2026
The alias value from `plottable.label` is not HTML-escaped and goes into raw HTML tooltip strings. Escape it explicitly. For the fallback path (no alias match), the seriesName is already escaped by `getFormatter` in tooltip.tsx, so skip escaping to avoid double-encoding. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Prevent double HTML-escaping of series names in time series widget chart tooltips.
When a widget has multiple queries with a
groupBy, series names use>as a delimiter (e.g.,My Query > prod : count()). The tooltipnameFormatterinTimeSeriesWidgetVisualizationcalledtruncationFormatterwith escaping enabled, but the outertruncationFormatteringetFormatter(tooltip.tsx) already escapes. This caused>to be double-escaped to&gt;, which rendered as literal>in tooltips.The fix passes
escaped = falseto the innertruncationFormattercall, matching the existing pattern incategoricalSeriesWidgetVisualization(line 272-276) and the legend formatter (line 707-714, which has a comment explicitly explaining why escaping is disabled).The
>delimiter has been in series names since Jan 2025 (transformEventsResponseToSeries), but the double-escaping was introduced whenTimeSeriesWidgetVisualizationwas created with itsnameFormatterthat redundantly escapes.Fixes DAIN-1223