Skip to content

fix(ui): TrendChart renders a gap for null points instead of a fabricated 0 - #9914

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9674
Jul 29, 2026
Merged

fix(ui): TrendChart renders a gap for null points instead of a fabricated 0#9914
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
bitfathers94:fix/issue-9674

Conversation

@bitfathers94

Copy link
Copy Markdown
Contributor

fix(ui): TrendChart renders a gap for null points instead of a fabricated 0

Sparkline already breaks its line on a null TrendPoint via connectNulls={false};
TrendChart's plain-SVG values prop only accepted number[], so the calibration and
slop/duplicate trend cards coerced a null (below-sample-floor) point to 0 before
handing it off, plotting a fake 0% right above a "—" in the same card. TrendChart
now accepts nullable values and splits the path into a fresh sub-path per
contiguous run, and the two model helpers keep nulls instead of substituting 0.
Also gives each of the four TrendChart instances its own aria-label instead of
the shared "Trend chart" string.

Closes #9674

UI Evidence

Viewport · Theme Before After
Desktop · Dark Desktop · Dark before
before
Desktop · Dark after
after
Tablet · Dark Tablet · Dark before
before
Tablet · Dark after
after
Mobile · Dark Mobile · Dark before
before
Mobile · Dark after
after

…ated 0

Sparkline already breaks its line on a null TrendPoint via connectNulls={false};
TrendChart's plain-SVG values prop only accepted number[], so the calibration and
slop/duplicate trend cards coerced a null (below-sample-floor) point to 0 before
handing it off, plotting a fake 0% right above a "—" in the same card. TrendChart
now accepts nullable values and splits the path into a fresh sub-path per
contiguous run, and the two model helpers keep nulls instead of substituting 0.
Also gives each of the four TrendChart instances its own aria-label instead of
the shared "Trend chart" string.
@bitfathers94
bitfathers94 requested a review from JSONbored as a code owner July 29, 2026 22:18
@loopover-orb

loopover-orb Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-29 22:26:24 UTC

12 files · 1 AI reviewer · no blockers · readiness 93/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This fixes a real bug: TrendChart previously coerced null (below-sample-floor) points to 0, so calibration and slop/duplicate cards plotted a fabricated 0% next to a "—" label in the same card. The fix correctly threads `number | null` through TrendChart, splits the path/area into per-run sub-paths on null so the line and fill both break instead of interpolating, and the two model helpers now preserve nulls instead of substituting 0. It also fixes a real a11y bug by giving each of the four TrendChart call sites a distinct aria-label instead of the shared "Trend chart" string, with solid test coverage across both changes (empty/all-null/leading/trailing-null edge cases, per-run area closing, and label uniqueness).

Nits — 6 non-blocking
  • apps/loopover-ui/src/components/site/trend-chart.tsx:32 — `runs.length` in `prevIndex === i - 1 && runs.length` is redundant since `prevIndex` starts at -1 and can't equal `i-1` before a run exists; harmless but could be simplified to just `prevIndex === i - 1`.
  • Several TrendChart height/width literals (96, 80, 40) are pre-existing style, not introduced by this diff's logic change, but a named constant would help readability per the external brief.
  • apps/loopover-ui/src/components/site/trend-chart.tsx — the two block comments explaining sub-path/area splitting are a bit verbose for the non-obviousness of the logic; could be tightened to one line each.
  • Consider extracting the run-splitting logic in trend-chart.tsx into a small named helper (e.g. `splitIntoRuns`) to make the useMemo body easier to scan, though current inline form is not incorrect.
  • The screenshot evidence provided shows unrelated sign-in page images with no visible diff — worth flagging to the contributor that the attached UI evidence doesn't actually demonstrate the fix; the code change itself is what should be judged here.
  • Possible screenshot-table issue: pair 1 — Advisory only — verify the screenshot-table images against the stated change before deciding.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #9674
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ⚠️ 20/25 Preflight is ready, but the PR body does not name the validation run.
Contributor workload ✅ 10/10 Author activity: 101 registered-repo PR(s), 69 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bitfathers94; Gittensor profile; 101 PR(s), 1 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: moderate
Linked issue satisfaction

Addressed
The diff implements TrendChart with a required label prop and nullable ReadonlyArray<number|null> values that split into multiple M sub-paths per contiguous run, excludes nulls from min/max, and renders empty d/area for all-null input; both model helpers (calibrationTrendValues, chartValuesForSeries) now preserve null instead of coercing to 0, and all four call sites pass distinct labels, matching

Review context
  • Author: bitfathers94
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript
  • Official Gittensor activity: 101 PR(s), 1 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add validation command/output.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/app/analytics/test desktop before /app/analytics/test
before /app/analytics/test
after /app/analytics/test
after /app/analytics/test
/app/analytics/test mobile before /app/analytics/test (mobile)
before /app/analytics/test (mobile)
after /app/analytics/test (mobile)
after /app/analytics/test (mobile)
/app/analytics desktop before /app/analytics
before /app/analytics
after /app/analytics
after /app/analytics
/app/analytics mobile before /app/analytics (mobile)
before /app/analytics (mobile)
after /app/analytics (mobile)
after /app/analytics (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

Scroll preview
Route Before (production) After (this PR's preview)
/app/analytics/test before /app/analytics/test (scroll)
before /app/analytics/test (scroll)
after /app/analytics/test (scroll)
after /app/analytics/test (scroll)
/app/analytics before /app/analytics (scroll)
before /app/analytics (scroll)
after /app/analytics (scroll)
after /app/analytics (scroll)

A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 29, 2026

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 3377503 into JSONbored:main Jul 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui(analytics): TrendChart plots a fabricated 0 for "insufficient data" points the same card

1 participant