Skip to content

fix(app): keep table tile rows on screen while a dashboard refreshes - #3212

Merged
kodiakhq[bot] merged 5 commits into
ClickHouse:mainfrom
Harshul1484:fix/table-tile-refresh-pulse
Sep 25, 2026
Merged

kodiakhq[bot] merged 5 commits into
ClickHouse:mainfrom
Harshul1484:fix/table-tile-refresh-pulse

Conversation

@Harshul1484

@Harshul1484 Harshul1484 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

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 useOffsetPaginatedQuery only keeps previous data in live mode. A refetch also doesn't stream its first page (hasPreviousQueries is true), so the tile had no data until the whole result arrived and showed "Loading Chart Data..." in place of the table.

Changes:

  • useOffsetPaginatedQuery gets an opt-in keepPreviousData option and returns isPlaceholderData. Previous data is kept in live mode as before, or with keepPreviousData when the query key differs only in dateRange (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.
  • DBTableChart opts in and passes effect-pulse to 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.
  • Table in HDXMultiSeriesTableChart accepts an optional className for its scroll container.
  • While rows are placeholder data the table gets no row action or search link, so kept rows can't open a search built from the new date range or config. Links return once fresh rows arrive.

Tests:

  • useOffsetPaginatedQuery: switching to a new date range keeps the previous rows as placeholder data with keepPreviousData, 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.
  • The new behaviour tests fail without the source change.

How to test on Vercel preview

Preview routes: /dashboards

Steps:

  1. Create a dashboard with a Table tile grouped by ServiceName on the demo logs source.
  2. Choose a large time range so the query takes a moment.
  3. Click "Refresh dashboard".
  4. Verify the table keeps its rows and pulses while the query runs instead of showing "Loading Chart Data...", and stops pulsing once the new rows appear.

References

Checks run locally: jest for DBTableChart, useOffsetPaginatedQuery, HDXMultiSeriesTableChart, DBRowTable and DBTraceWaterfallChart (143 passed), eslint on changed files (0 errors), prettier --check, and tsc --noEmit for packages/app.

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-bot

changeset-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 31d17eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

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

@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

@Harshul1484 is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adjusts table refresh behavior to keep rows visible during reload.

The PR appears safe to merge; no outstanding findings or new actionable issues remain.

Summary

The PR keeps table-tile rows visible during a dashboard date-range refresh, pulses placeholder rows, and disables their row links and actions until fresh data arrives.

  • Adds an opt-in, date-range-only placeholder policy to the paginated query hook.
  • Covers placeholder rows, pagination, links, and the refresh indicator with tests.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Dashboard date range changes] --> B[Table query starts]
  B --> C[Keep prior rows as placeholders]
  C --> D[Pulse rows; disable row actions]
  D --> E[Fresh result arrives]
  E --> F[Show fresh rows; restore actions]
Loading

Reviews (6) · Last reviewed commit: "Merge branch 'main' into fix/table-tile-..."

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.
@Harshul1484
Harshul1484 marked this pull request as ready for review September 24, 2026 19:24
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

✅ No issues found.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Scope: table-tile refresh behavior — useOffsetPaginatedQuery gains an opt-in keepPreviousData, DBTableChart pulses and inerts rows while showing placeholder data, and Table accepts a scroll-container className. Diff is small, self-contained, and heavily tested.

✅ No critical issues found.

The two prior Greptile findings are both addressed in the current diff:

  • DBTableChart.tsx:322–327 — the "old rows open new searches" P1 is closed: while isPlaceholderData is true both getRowAction and getRowSearchLink are set to undefined, so kept rows cannot open a search built from the new date range or config, and links return once fresh rows load. Covered by the new row links tests.
  • useOffsetPaginatedQuery.test.tsx:874 — the "placeholder pagination untested" P2 is closed by the windowed multi-page range-change test asserting hasNextPage is false while placeholder rows show and resumes to true against the new range.

🟡 P2 — recommended

  • packages/app/src/HDXMultiSeriesTableChart.tsx:409 — the new className scroll-container prop has no direct test; DBTableChart tests mock Table, so nothing asserts the real component actually applies the passed class to the scroll container.
    • Fix: Add a focused render test on Table asserting a passed className lands on the overflow-auto scroll container alongside the base classes.
🔵 P3 nitpicks (2)
  • packages/app/src/components/DBTableChart.tsx:311 — the 'effect-pulse' class string is repeated across the empty-state, the Table className, and its conditional, inviting drift if the effect name changes.
    • Fix: Hoist the pulse class to a single const and reference it in all three sites.
  • packages/app/src/components/DBTableChart.tsx:325 — the getRowSearchLink={isPlaceholderData || getRowAction ? undefined : getRowSearchLink} expression folds two distinct suppression reasons (placeholder vs. row-action present) into one ternary, which is easy to misread.
    • Fix: Compute an intermediate linksDisabled = isPlaceholderData boolean and keep the existing getRowAction precedence separate for readability.

Reviewers (2): ce-agent-native-reviewer, ce-previous-comments (prior-thread verification via direct diff analysis).

Testing gaps: No direct unit test exercises Table's new className passthrough to the scroll container; the pulse behavior is verified only through the mocked Table in DBTableChart tests.

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.
@Harshul1484

Copy link
Copy Markdown
Contributor Author

Round 2 (Claude Code Review and Deep Review) is addressed in 29e64e6:

  • Rows are now kept only when the query differs in nothing but its date range, so a tile edit no longer shows old rows with the new config's columns, formats and colours (Claude Code Review's DBTableChart.tsx:186 finding and Deep Review's P2).
  • An empty previous result now pulses its "No data found within time range." message during a refresh.
  • Removed the unused isFetching: true from a test mock.

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 hasNextPage.

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.

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Sep 25, 2026 4:39pm UTC

Request Review

kodiakhq Bot pushed a commit that referenced this pull request Sep 25, 2026
…#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`.
@kodiakhq
kodiakhq Bot merged commit 1edc042 into ClickHouse:main Sep 25, 2026
25 of 27 checks passed
kodiakhq Bot pushed a commit that referenced this pull request Sep 25, 2026
…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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants