Skip to content

fix: show 'no data' in KPI component when measure value is null#9274

Draft
ericokuma wants to merge 1 commit intomainfrom
cursor/fix-kpi-blank-null-value-d756
Draft

fix: show 'no data' in KPI component when measure value is null#9274
ericokuma wants to merge 1 commit intomainfrom
cursor/fix-kpi-blank-null-value-d756

Conversation

@ericokuma
Copy link
Copy Markdown
Contributor

When the KPI query succeeds but returns null data (e.g. no matching rows for the selected filters/time range), the measureValueFormatter is called with null. Since the formatter is typed as createMeasureValueFormatter<null>, it passes null through unchanged, and Svelte renders null as empty text — resulting in a blank measure value.

Changes

  • Primary value: Added a null check before formatting. When the value is null, shows italic "no data" text in muted styling instead of a blank space.
  • Comparison "previous" value: Added inline null check to show "no data" text when the comparison value is null.

This matches the existing pattern used in the explore dashboard's MeasureBigNumber.svelte component, which already displays "no data" for null values (line 327-328).

Closes APP-858

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!

Linear Issue: APP-858

Open in Web Open in Cursor 

When the KPI query succeeds but returns null data (e.g. no matching rows
for the selected filters/time range), the measure value formatter passes
null through unchanged and Svelte renders it as blank text.

Add explicit null checks before formatting:
- Primary value: show italic 'no data' text in muted style
- Comparison 'previous' value: show 'no data' text inline

This matches the pattern used in the explore dashboard's
MeasureBigNumber component.

Fixes APP-858

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