fix(analytics): retain Countme zeros and preserve missing values as gaps - #1110
Open
castrojo wants to merge 1 commit into
Open
fix(analytics): retain Countme zeros and preserve missing values as gaps#1110castrojo wants to merge 1 commit into
castrojo wants to merge 1 commit into
Conversation
Project Bluefin family cards computed isTracked as count > 0, so a real reported zero (e.g. Dakota weekly value 0) was treated identically to missing data: the sparkline history was cleared to [] and the card fell back to its bootstrapping/provisioning placeholder text instead of showing the trend. Read counts through a shared readCount() helper that keeps a reported 0 as 0 and only returns null when the field is actually absent or non-finite, matching the gapSafe() convention already used by the comparative charts in this file. isTracked and per-week history now key off count !== null instead of count > 0, so zero values stay visible and only genuinely missing weeks render as sparkline gaps. Signed-off-by: castrojo <castrojo@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.
Fixes #1086
Problem
Project Bluefin family cards on the analytics page computed
isTracked = count > 0. A real reported zero (e.g. Dakota's weekly value of0) was indistinguishable from a missing week, so:[]entirely instead of rendering with a gap for the missing point, andFix
Added a shared
readCount()helper that returns the reported value (including0) and only returnsnullwhen a field is genuinely absent or non-finite — matching thegapSafe()convention already used by the comparative time-series charts in this file.isTracked, the per-card count, and the 12-week sparkline history now all key offcount !== nullrather thancount > 0, so:0renders as0(not a placeholder), andTesting
npx tsc --noEmit— no new errorsnpx eslint src/components/analytics/CountmeAnalyticsCharts.tsx— cleannpx prettier --check— clean— hive: backend=copilot model=claude-sonnet-5
🐝 Hive Agent:
contributor| SHA:ed9a243e