fix(app): use categorical palette on histogram charts - #2949
Conversation
Histogram bars used a hardcoded neon green outside the chart palette, and a one-off tooltip that inherited that color. Align both with other charts. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: cddd1fd The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Greptile SummaryHistogram bars now use the categorical
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the histogram now resolves
|
| Filename | Overview |
|---|---|
| packages/app/src/components/DBHistogramChart.tsx | Resolves the histogram color through the chart token reader and adopts the shared tooltip; the previously reported direct palette access is fixed. |
| packages/app/src/components/tests/DBHistogramChart.test.tsx | Adds coverage for categorical color resolution, shared tooltip rendering, formatting, fallback color, and inactive states. |
| packages/app/src/components/charts/ChartTooltip.tsx | Adds a test identifier to the shared tooltip container without changing runtime behavior. |
| .changeset/histogram-chart-categorical-color.md | Records the user-visible histogram palette and tooltip update as an application patch. |
Reviews (4): Last reviewed commit: "Merge branch 'main' into agent/histogram..." | Re-trigger Greptile
Deep ReviewScope: PR #2949 — a small, frontend-only change swapping the histogram chart's hardcoded ✅ No critical issues found. No P0/P1 findings. The change is well-scoped and the new tooltip behavior (active/inactive, empty, undefined, and missing-color payloads) is directly tested. 🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers (5): correctness, testing, maintainability, project-standards, kieran-typescript. Testing gaps: No test confirms the removed "View Events" |
E2E Test Results✅ All tests passed • 305 passed • 1 skipped • 1181s
Tests ran across 4 shards in parallel. |
Indexing COLORS skipped getColorFromCSSToken, so palette reorders or future per-theme categorical overrides would miss this histogram. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover the color fallback and empty-payload tooltip branches, pin the expected hex, and drop the unused View events link that was never wired through DBHistogramChart. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Histogram charts (including Request Latency on the Services dashboard) now use the categorical palette and the shared chart tooltip instead of a leftover neon green fill and a one-off tooltip.
Bars were hardcoded to
#50FA7B, which is not in the chart palette. The tooltip also painted "Number of events" in that same color. They now resolvechart-bluethroughgetColorFromCSSTokenand render withChartTooltipContainer/ChartTooltipItem, matching line, bar, and pie charts.The tooltip's unused View events link is gone.
generateSearchUrlwas accepted on the inner histogram/tooltip but never passed fromDBHistogramChart, so the link never appeared in production. The only caller (Services → HTTP Request Latency) has no search-URL builder for a duration bucket. Wiring a working link would be a separate feature (filter events to that latency range); until then the prop was dead code.Test plan
#437eef), not neon greenyarn workspace @hyperdx/app jest src/components/__tests__/DBHistogramChart.test.tsx