You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c372a71
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app): pulse the list-bar and histogram charts while they refresh (#3229)
## 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.
- `DBListBarChart` pulses the bar list, and its empty state, while `isPlaceholderData` is true.
- `DBHistogramChart` does the same through a new `className` prop on `HistogramChart`, which is applied to its `ResponsiveContainer`.
- `DBHistogramChart`'s loading state now shows only before the first data arrives (`isLoading && !data`), as `DBListBarChart` and `DBBarChart` already do. `useQueriedChartConfig` also reports `isLoading` while the materialized-view check for the new range runs, which briefly replaced the kept histogram with "Loading Chart Data...".
- `DBListBarChart` is 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`:
- the bars pulse during a refresh and stop once fresh data loads;
- the empty state pulses during a refresh, but not for a fresh empty result.
- `DBHistogramChart.test.tsx`:
- the histogram stays on screen and pulses while a refresh loads, and stops once fresh data loads;
- the empty state pulses during a refresh, but not for a fresh empty result;
- the loading state still shows before the first data.
- Without the source changes, 4 of the 9 new tests fail. The ones that pass either way are the guards: no pulse once fresh, and the loading state before the first data.
### How to test on Vercel preview
**Preview routes:** /services
**Steps:**
1. Open the Services dashboard on the demo trace source. On the "HTTP Service" tab, switch "Request Latency" to "Display as Histogram".
2. Click "Refresh dashboard".
3. Verify the "Request Latency" histogram and the "Top 20 Most Time Consuming Endpoints" list keep their data on screen and pulse while they reload, and stop pulsing once the new data appears.
### References
- Linear Issue: N/A
- Related PRs: #3211, #3221, #3224
- Follow-up to #3205
Checks run locally:
- `jest --findRelatedTests` for both charts: 33 passed across 4 suites.
- `eslint` on the changed files: 0 errors, no new warnings.
- `prettier --check`.
- `tsc --noEmit` for `packages/app`.
0 commit comments