Conversation
Co-authored-by: ericokuma <ericokuma@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
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
left a comment
There was a problem hiding this comment.
-
getCellTooltipValueis duplicated identically betweenFlatTable.svelteandNestedTable.svelte. The two functions have the same body; the only difference is thatgetMeasureColumninFlatTabletakes aColumnandNestedTabletakes aCell(then immediately reads.column). Consider extracting this to a shared utility in the pivot directory, taking aCellas the common parameter. Both call sites already have the cell. -
getNodeWithAttributeinTDDTable.svelteduplicateshandleEventright next to it.handleEventalready walks the DOM tree looking for an attribute — the only difference is thatgetNodeWithAttributereturns the node instead of calling a callback. Consider refactoringhandleEventto usegetNodeWithAttributeinternally, which would eliminate the duplicate traversal logic and also improve its typing (it currently has untyped parameters). -
tooltipFormattedValue: unknowninCell.svelteis overly loose. The value flows into<FormattedDataType>which expectsstring | number | null. Typing this asstring | number | null(or extending it to match the existingformattedValuetype plusnumber) would catch misuse at compile time. -
Currency tooltip formatting in
format-measure-value.tsusesreplaceAll("$", "")to strip the dollar sign from the humanized output. This is brittle — ifhumanizerever 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$). -
setTooltipValueAttributeinRegularTable.sveltechecksvalueAsString.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 likeLOADING_CELLorNULL_CELL) would make the intent clearer. -
Minor:
pctOfTotalstooltip inLeaderboardRow.sveltecallsformatMeasurePercentageDifferencetwice — 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>
This PR resolves ENG-1044 by standardizing the display and microcopy of measure tooltips across both Measures and Dimensions.
Specifically, it addresses:
This ensures a unified and accurate user experience for all measure tooltips.
Checklist:
Linear Issue: ENG-1044