Repository navigation
fix(app): keep table tile rows on screen while a dashboard refreshes - #3212
Conversation
A dashboard refresh moves the time range, so the table tile refetches under a new query key. useOffsetPaginatedQuery only keeps previous data in live mode, and a refetch doesn't stream its first page, so the tile had no data until the whole result arrived: the table disappeared and "Loading Chart Data..." showed in its place. Add an opt-in `keepPreviousData` option to useOffsetPaginatedQuery and return `isPlaceholderData`. DBTableChart opts in and pulses the table while it is showing placeholder rows, like the other dashboard tiles. Default behaviour is unchanged for the search and trace views. Refs ClickHouse#3205
🦋 Changeset detectedLatest commit: 31d17eb 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. |
|
Rows kept from the previous query would build their search links and row actions from the new date range and config, so clicking one could open a search that doesn't match the row. Leave rows inert while they are placeholder data, and enable links again once fresh rows arrive. Also cover paging during a refresh: while placeholder rows are shown the hook reports no next page, so the table can't request more rows for the old result, and paging resumes against the new range once it loads.
PR Review✅ No issues found. |
Deep ReviewScope: table-tile refresh behavior — ✅ No critical issues found. The two prior Greptile findings are both addressed in the current diff:
🟡 P2 — recommended
🔵 P3 nitpicks (2)
Reviewers (2): ce-agent-native-reviewer, ce-previous-comments (prior-thread verification via direct diff analysis). Testing gaps: No direct unit test exercises 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 |
Review round 2: - keepPreviousData kept rows across any query-key change, so after a tile edit the old rows showed with the new config's columns, number formats and colours until fresh rows arrived. Keep previous data only when the key differs in nothing but dateRange. - A refresh over an empty previous result showed "No data found within time range." with no loading sign. Pulse it while a refetch runs. - Drop an isFetching flag from a test mock that the component ignores.
|
Round 2 (Claude Code Review and Deep Review) is addressed in 29e64e6:
Not covered here from Deep Review's testing gaps: a refresh that fails still replaces the kept rows with the error state, as it did before this PR, and paging safety is asserted in the hook, which is what controls That's two rounds of automated review, so per AGENTS.md I'll stop addressing bot findings here. @brandon-pereira, this is ready for a human look whenever you have time. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…#3211) ## Summary Fixes the number, bar and pie parts of #3205: during a dashboard refresh these tiles now pulse, the same way line and stacked-bar time charts already do. A refresh moves the time range, so every tile refetches under a new query key. The tiles use `placeholderData: prev => prev`, and with react-query v5 a query showing placeholder data is in `success` state, so `isLoading` stays `false` for the whole refetch and only `isPlaceholderData` is `true`. `DBTimeChart` already folds `isPlaceholderData` into its loading state; the number, bar and pie tiles only looked at `isLoading`, so they showed stale values with no sign they were loading. Changes: - `useCategoricalChart` returns `isPlaceholderData`; `DBBarChart` and `DBPieChart` pulse on `isLoading || isPlaceholderData`. - `DBNumberChart` applies `effect-pulse` to the value on `isLoading || isPlaceholderData`. - An empty previous result pulses its "No data found within time range." message during a refetch, in all three tiles. - The pie pulses together with its legend, since the legend shows values too. - Tests for each tile: it pulses while showing the previous result (including an empty one) and stops once fresh data arrives. The "pulses" tests fail without the change. The **table** tile needs a change to `useOffsetPaginatedQuery`, so it is in a separate PR (#3212) to keep this one small, as agreed in #3209. ### How to test on Vercel preview **Preview routes:** /dashboards **Steps:** 1. Create a dashboard with a Number tile (`count()`), a Bar tile and a Pie tile grouped by `SeverityText`, and a Line time chart on the demo logs source. 2. Choose a large time range so each query takes a moment. 3. Click "Refresh dashboard". 4. Verify the number, bar and pie tiles pulse while their queries run, like the line chart, and stop pulsing once new values appear. ### References - Linear Issue: N/A - Related PRs: #3212 - Closes part of #3205 Checks run locally: `jest` for DBBarChart, DBPieChart and DBNumberChart (60 passed), `eslint` on changed files (0 errors), `prettier --check`, and `tsc --noEmit` for `packages/app`.
…3221) ## Summary Fixes the heatmap part of #3205: during a dashboard refresh, heatmap tiles now keep the current heatmap on screen and pulse, instead of replacing it with "Loading...". - Both heatmap queries (the min/max bounds and the buckets) keep their previous result as placeholder data, the same way the time chart and the number, bar and pie tiles do. - The bucket query waits for the refreshed bounds before it runs, so a refresh doesn't also query the new range bucketed with the previous range's min/max. - The heatmap, and the "Not enough data points" message, pulse while either query is still showing previous data. `Heatmap` takes an optional `className` so the pulse goes on its existing container rather than a new wrapper, which would affect its size measurement. - New tests in `DBHeatmapChart.render.test.tsx`: both queries keep their previous data, the tile pulses during a refresh and stops once fresh data loads, and the bucket query waits for fresh bounds. Three of the four fail without the change. While checking the rest of the app for the same pattern, I found two more places: the Kubernetes dashboard's Pods, Nodes and Namespaces tables still switch to skeleton rows on every refresh, and the Services dashboard tiles (`DBListBarChart`, `DBHistogramChart`, the slowest events tile) keep their data but don't pulse. Happy to take those as follow-ups if you'd like. ### How to test on Vercel preview **Preview routes:** /dashboards **Steps:** 1. Create a dashboard with a Heatmap tile on the demo traces source (for example on `Duration`) and a Line time chart. 2. Choose a large time range so each query takes a moment. 3. Click "Refresh dashboard". 4. Verify the heatmap stays on screen and pulses while its queries run, like the line chart, and stops pulsing once the new heatmap appears. ### References - Linear Issue: N/A - Related PRs: #3211, #3212. #3184 also edits the `queryKey` of these two heatmap queries, so whichever lands second needs a small rebase. - Closes part of #3205 Checks run locally: `jest` for the heatmap suites and `ChartPreviewPanel` (50 passed), `eslint` on changed files (0 errors, no new warnings), `prettier --check`, and `tsc --noEmit` for `packages/app`.
Summary
The table-tile part of #3205, split out from the number/bar/pie fix in #3211 to keep scope smaller (as agreed in #3209).
During a dashboard refresh the table tile didn't show stale rows. It disappeared: the refresh moves the time range, so the tile refetches under a new query key, and
useOffsetPaginatedQueryonly keeps previous data in live mode. A refetch also doesn't stream its first page (hasPreviousQueriesis true), so the tile had no data until the whole result arrived and showed "Loading Chart Data..." in place of the table.Changes:
useOffsetPaginatedQuerygets an opt-inkeepPreviousDataoption and returnsisPlaceholderData. Previous data is kept in live mode as before, or withkeepPreviousDatawhen the query key differs only indateRange(a refresh), so a tile edit doesn't show old rows with the new config's columns and formats. The default is unchanged, so the search results table and trace waterfall behave as before.DBTableChartopts in and passeseffect-pulseto the table while it is showing placeholder rows, like the other dashboard tiles. An empty previous result pulses its "No data found within time range." message.TableinHDXMultiSeriesTableChartaccepts an optionalclassNamefor its scroll container.Tests:
useOffsetPaginatedQuery: switching to a new date range keeps the previous rows as placeholder data withkeepPreviousData, and clears them by default.useOffsetPaginatedQuery: during a windowed (multi-page) range change the hook reports no next page while placeholder rows are shown, and paging resumes against the new range once it loads.DBTableChart: asks the query to keep previous rows, pulses while showing placeholder rows, doesn't pulse once fresh rows load, and disables row links on placeholder rows.How to test on Vercel preview
Preview routes: /dashboards
Steps:
ServiceNameon the demo logs source.References
Checks run locally:
jestfor DBTableChart, useOffsetPaginatedQuery, HDXMultiSeriesTableChart, DBRowTable and DBTraceWaterfallChart (143 passed),eslinton changed files (0 errors),prettier --check, andtsc --noEmitforpackages/app.