Skip to content

fix: pivot hover description in public URL#9247

Merged
royendo merged 7 commits intomainfrom
royendo/fix-pivot-hover-description
Apr 20, 2026
Merged

fix: pivot hover description in public URL#9247
royendo merged 7 commits intomainfrom
royendo/fix-pivot-hover-description

Conversation

@royendo
Copy link
Copy Markdown
Contributor

@royendo royendo commented Apr 15, 2026

https://www.loom.com/share/d91d85f0717a42098f424f7631f7eb39

  1. d49b584 — Fix fromProto.ts deserialization

Problem: When pivot state is deserialized from a protobuf (e.g. loading a shared/public URL), the mapDimension and mapMeasure
helpers in fromPivotProto weren't copying the description field onto the PivotChipData objects. So chips lost their tooltip
descriptions.

Fix: Added description: dim?.description and description: mes?.description to the two mapping functions (2 lines).

  1. d9a348f — Fix convertPresetToExploreState.ts deserialization

Problem: The first commit only fixed one deserialization path (fromProto.ts). The regular explore mode uses a different path —
convertPresetToExploreState.ts — which also builds PivotChipData objects via mapPivotEntry. That path had the same missing
description bug.

Fix: Added description: m.description and description: d.description in the measure and dimension branches of
fromPivotUrlParams (2 lines).

  1. daf5dfd — Reactive enrichment in PivotDisplay.svelte

Problem: On public URL first load, the metricsView data (which contains the descriptions) loads after the pivot state is
already deserialized. So even with commits 1 and 2, descriptions are still missing because the dimension/measure metadata isn't
available yet at deserialization time.

Fix: In PivotDisplay.svelte, builds a reactive descriptionMap from $validSpecStore (the metricsView). An enrichDescriptions()
function backfills any chip that's missing a description. The enriched pivot state is passed to PivotHeader and PivotSidebar
instead of the raw $dashboardStore.pivot. This ensures descriptions appear as soon as the metricsView loads, regardless of
timing.

TL;DR: All 3 commits fix the same bug — pivot chip description tooltips being lost — but across three different code paths:
proto deserialization, URL state deserialization, and a race condition on initial load.

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!

royendo and others added 5 commits April 15, 2026 10:50
Include `description` in `mapDimension` and `mapMeasure` within
`fromPivotProto` so dimension and measure chips retain their
description tooltips when pivot state is deserialized from URL
parameters (including public/shared URLs).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The regular explore mode deserializes pivot state through
`convertPresetToExploreState.ts`, not just `fromProto.ts`. Add
`description` to `mapPivotEntry` for both measures and dimensions
so chips in the rows/columns area retain their description tooltips.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On public URL first load, the metricsView data (with descriptions)
loads after the pivot state is deserialized, so descriptions are
missing. Fix by building a reactive description lookup from the
metricsView in PivotDisplay and enriching the pivot rows/columns
before passing them to PivotHeader and PivotSidebar.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rip consistency

Proto-default empty strings caused toEqual mismatches when comparing
mutation-created state (no description) vs URL-reconstructed state
(description: "").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@royendo
Copy link
Copy Markdown
Contributor Author

royendo commented Apr 16, 2026

flaky e2e

@royendo royendo requested a review from AdityaHegde April 16, 2026 14:13
…enriched state to PivotToolbar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread web-common/src/features/dashboards/proto-state/fromProto.ts Outdated
Description enrichment is handled reactively in PivotDisplay.svelte
via the metricsView store. The mappers only need to populate id and type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@royendo
Copy link
Copy Markdown
Contributor Author

royendo commented Apr 17, 2026

Addressed feedback: removed description from the deserialization mappers in fromProto.ts and convertPresetToExploreState.ts. The reactive enrichment in PivotDisplay.svelte is now the single source for chip descriptions — the mappers only populate id and type.

@royendo royendo requested a review from AdityaHegde April 18, 2026 20:56
@royendo royendo merged commit c6680d3 into main Apr 20, 2026
17 of 19 checks passed
@royendo royendo deleted the royendo/fix-pivot-hover-description branch April 20, 2026 13:30
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