Skip to content

Tooltip display consistency#8942

Draft
ericokuma wants to merge 12 commits intomainfrom
cursor/ENG-1044-tooltip-display-consistency-4a1d
Draft

Tooltip display consistency#8942
ericokuma wants to merge 12 commits intomainfrom
cursor/ENG-1044-tooltip-display-consistency-4a1d

Conversation

@ericokuma
Copy link
Contributor

This PR resolves ENG-1044 by standardizing the display and microcopy of measure tooltips across both Measures and Dimensions.

Specifically, it addresses:

  1. Value Formatting: Dimension table and leaderboard measure tooltips now consistently display currency symbols and are formatted to two decimal points, matching the behavior of measure tooltips. This was achieved by introducing tooltip-specific formatted values in both the leaderboard and virtualized table paths.
  2. Microcopy: The "Copy this value to clipboard" text has been standardized to "Copy to clipboard" across all relevant tooltip instances.

This ensures a unified and accurate user experience for all measure tooltips.

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 (ENG-1044)
  • 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!

Linear Issue: ENG-1044

Open in Web Open in Cursor 

Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 28, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

cursoragent and others added 10 commits February 28, 2026 02:00
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
@ericokuma ericokuma requested a review from djbarnwal February 28, 2026 03:17
Copy link
Contributor Author

@ericokuma ericokuma left a comment

Choose a reason for hiding this comment

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

  1. getCellTooltipValue is duplicated identically between FlatTable.svelte and NestedTable.svelte. The two functions have the same body; the only difference is that getMeasureColumn in FlatTable takes a Column and NestedTable takes a Cell (then immediately reads .column). Consider extracting this to a shared utility in the pivot directory, taking a Cell as the common parameter. Both call sites already have the cell.

  2. getNodeWithAttribute in TDDTable.svelte duplicates handleEvent right next to it. handleEvent already walks the DOM tree looking for an attribute — the only difference is that getNodeWithAttribute returns the node instead of calling a callback. Consider refactoring handleEvent to use getNodeWithAttribute internally, which would eliminate the duplicate traversal logic and also improve its typing (it currently has untyped parameters).

  3. tooltipFormattedValue: unknown in Cell.svelte is overly loose. The value flows into <FormattedDataType> which expects string | number | null. Typing this as string | number | null (or extending it to match the existing formattedValue type plus number) would catch misuse at compile time.

  4. Currency tooltip formatting in format-measure-value.ts uses replaceAll("$", "") to strip the dollar sign from the humanized output. This is brittle — if humanizer ever returns a value containing a literal $ for a different reason (e.g., in scientific notation or an edge case), it would be stripped. A safer approach would be to pass a format preset that doesn't prepend the currency symbol, or to use a more targeted replacement (e.g., only strip a leading $).

  5. setTooltipValueAttribute in RegularTable.svelte checks valueAsString.includes("<") to skip HTML placeholders. This is a heuristic that could silently swallow legitimate tooltip values if a formatted string ever contains < (unlikely but possible with custom formatting). A comment explaining why this is safe or a more specific check (e.g., matching the known placeholder patterns like LOADING_CELL or NULL_CELL) would make the intent clearer.

  6. Minor: pctOfTotals tooltip in LeaderboardRow.svelte calls formatMeasurePercentageDifference twice — once for the tooltip value (line 278) and once for the displayed <PercentageChange> (line 285). Consider computing it once and reusing.


Developed in collaboration with Claude Code

Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
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