fix: show 'no data' in KPI component when measure value is null#9274
Draft
fix: show 'no data' in KPI component when measure value is null#9274
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the KPI query succeeds but returns null data (e.g. no matching rows for the selected filters/time range), the
measureValueFormatteris called withnull. Since the formatter is typed ascreateMeasureValueFormatter<null>, it passesnullthrough unchanged, and Svelte rendersnullas empty text — resulting in a blank measure value.Changes
This matches the existing pattern used in the explore dashboard's
MeasureBigNumber.sveltecomponent, which already displays "no data" for null values (line 327-328).Closes APP-858
Checklist:
Linear Issue: APP-858