Skip to content

Conversation

@Zylphrex
Copy link
Member

This withholds the chart data when the table is empty. It happens when the user is searching for a log closer to the start of the query period. The chart query successfully finds the results, but because the table query is using the flex time strategy, it may not have scanned that point in time just yet. It will if the user clicks on Continue Scanning a few times but until the table finds the log, we have a weird state that is difficult to explain. To address this, we opted to withhold the chart data and make it look like the chart is still loading when the user clicks on Continue Scanning. And only when the table finds some results, will the chart finally render.

This withholds the chart data when the table is empty. It happens when the user
is searching for a log closer to the start of the query period. The chart query
successfully finds the results, but because the table query is using the flex
time strategy, it may not have scanned that point in time just yet. It will if
the user clicks on `Continue Scanning` a few times but until the table finds the
log, we have a weird state that is difficult to explain. To address this, we
opted to withhold the chart data and make it look like the chart is still
loading when the user clicks on `Continue Scanning`. And only when the table
finds some results, will the chart finally render.
@Zylphrex Zylphrex requested a review from a team as a code owner November 24, 2025 22:03
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 24, 2025
timeseriesResult: {
...timeseriesResult,
isPending: timeseriesResult.isPending || tableIsPending,
} as ChartInfo['timeseriesResult'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting a weird type error here about not able to assign boolean to false here for some reason.

// This is to avoid a state where there is data in the chart but not in
// the table which is very weird. By withholding the chart data, we create
// the illusion the 2 are being queries in sync.
const withholdData = tableIsEmpty || tableIsPending;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Chart data not withheld during Continue Scanning

When the user clicks Continue Scanning with existing table data, the chart data isn't withheld as intended. The isPending property from useLogsPageDataQueryResult only includes isFetchingNextPage when data is empty. With existing data, isPending remains false during pagination, so withholdData becomes false, showing chart data while the table loads more results. This contradicts the PR's goal to withhold chart data during Continue Scanning operations. The code needs to also check isFetchingNextPage in the withholdData calculation.

Fix in Cursor Fix in Web

@Zylphrex Zylphrex merged commit d10392c into master Nov 25, 2025
49 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/withhold-chart-data-when-table-is-empty branch November 25, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants