fix(app): pulse the list-bar and histogram charts while they refresh - #3229
Harshul1484 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 8e7222e 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 |
|
@Harshul1484 is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
PR Review✅ No issues found. |
|
Deep Review✅ No critical issues found. This is a small, well-scoped follow-up that adds 🔵 P3 nitpicks (3)
Reviewers (7): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, previous-comments. Testing gaps: No test covers the list-bar chart pulsing while No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
| <div | ||
| className={cx( | ||
| 'd-flex h-100 w-100 align-items-center justify-content-center text-muted', | ||
| { 'effect-pulse': isPlaceholderData }, | ||
| )} |
There was a problem hiding this comment.
Ad-hoc empty states The updated empty-result branches in this chart and
DBListBarChart still render inline <div> elements. The repository guide requires EmptyState for all empty/no-data states. Please use it in both charts while preserving the refresh pulse behavior; this requirement must be satisfied before merging.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Every chart component (DBBarChart, DBPieChart, DBNumberChart, DBTableChart, DBTimeChart and these two) renders the same inline "No data found within time range." block today, so switching them to EmptyState is a separate, codebase-wide change; this PR only adds the pulse class to the existing element.
There was a problem hiding this comment.
You're right: the inline empty state predates this PR and is shared consistently across the chart components. Requiring EmptyState only in these two charts would expand the change and make the implementation inconsistent, so this is not a blocking issue for this PR. I'll withdraw the finding; a codebase-wide empty-state migration can be handled separately.
Summary
A follow-up to #3205, for the Services dashboard. Two chart types there already keep their previous data during a refresh (
placeholderData: prev => prev) but give no sign that new data is loading: the "Top 20 Most Time Consuming Endpoints/Queries" list-bar charts and the "Request Latency" histogram. They now pulse while the refetch runs, like the categorical charts fixed in #3211.DBListBarChartpulses the bar list, and its empty state, whileisPlaceholderDatais true.DBHistogramChartdoes the same through a newclassNameprop onHistogramChart, which is applied to itsResponsiveContainer.DBHistogramChart's loading state now shows only before the first data arrives (isLoading && !data), asDBListBarChartandDBBarChartalready do.useQueriedChartConfigalso reportsisLoadingwhile the materialized-view check for the new range runs, which briefly replaced the kept histogram with "Loading Chart Data...".DBListBarChartis also used by the LLM token-cost charts and the endpoint side panel's performance chart, which now pulse the same way.Tests
DBListBarChart.test.tsx:DBHistogramChart.test.tsx:How to test on Vercel preview
Preview routes: /services
Steps:
References
Checks run locally:
jest --findRelatedTestsfor both charts: 33 passed across 4 suites.eslinton the changed files: 0 errors, no new warnings.prettier --check.tsc --noEmitforpackages/app.