Skip to content

fix: Vega tooltip parsing for dimension comparison values#9419

Merged
djbarnwal merged 2 commits into
mainfrom
fix/vega-tooltip-normalization
May 11, 2026
Merged

fix: Vega tooltip parsing for dimension comparison values#9419
djbarnwal merged 2 commits into
mainfrom
fix/vega-tooltip-normalization

Conversation

@djbarnwal
Copy link
Copy Markdown
Member

Fixes chart rendering errors in Explore dimension comparison mode when selected dimension values contain markdown, newlines, URLs, quotes, or other punctuation.

Changes:

Add safe tooltip titles for pivoted dimension-value tooltip fields instead of reusing Vega-escaped field paths as labels.
Escape quotes in Vega field-path sanitization.
Keep tooltip color mapping aligned with normalized tooltip labels.

https://linear.app/rilldata/issue/ENG-1108/text-leaks-from-tables-into-chart-area-during-comparison

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@djbarnwal djbarnwal requested a review from a team as a code owner May 11, 2026 09:22
@djbarnwal djbarnwal requested a review from AdityaHegde May 11, 2026 09:27
}
}

export function sanitizeTitleForVegaTooltip(value: unknown) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a small comment describing why we need to sanitise title. Also good to add a similar one for sanitizeValueForVega above as well.

@djbarnwal djbarnwal merged commit 8579649 into main May 11, 2026
13 of 14 checks passed
@djbarnwal djbarnwal deleted the fix/vega-tooltip-normalization branch May 11, 2026 12:20
djbarnwal added a commit that referenced this pull request May 14, 2026
* fix: Vega tooltip parsing for dimension comparison values

* add comment
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.

2 participants