Skip to content

[AIPROFVIS-704] Show a message instead of a runaway spacer when a table filter matches nothing - #1219

Merged
dhingora-amd merged 2 commits into
mainfrom
dhingora/fix-empty-table
Nov 27, 2026
Merged

dhingora-amd merged 2 commits into
mainfrom
dhingora/fix-empty-table

Conversation

@dhingora-amd

Copy link
Copy Markdown
Contributor

Motivation

When a table filter matched no rows, the table kept its header and filter row but drew a bottom spacer of (total_row_count - (end_row + 1)) * row_height. With total_row_count == 0 that unsigned subtraction underflows, so the spacer was about 1.8e19 rows tall and pushed the layout cursor to ~5.7e20 px. ImGui then truncates the content size through int, which overflows (undefined behaviour). On Linux the content height comes out at -9.2e18 and scrolling clamps to 0, but the result depends on the platform. The table also showed no message, because the no-data text is only drawn when there is no header.

Technical Details

  • InfiniteScrollTable::Render only adds the bottom spacer when rows remain below the loaded window, so the subtraction can't underflow.
  • When the result is empty and no request is in flight, a disabled message is centred over the table, under the header and filter row. It reads "No rows match the current filter." when a filter is active, and otherwise uses the table's no-data text.
  • The other total_row_count - 1 in the fetch-more check can't underflow: it only runs when there are at least 2 rows.
  • Testing:
    • New UI test sys_event_table_empty_filter_scroll fills the Event Table from one track, filters duration < 0, and checks for 0 rows and a laid-out table height of just the header and filter row.
    • Added InfiniteScrollTableTestPeer (friended from InfiniteScrollTable) to set a column filter and read the widget name, and AnalysisViewTestPeer::EventTablePtr().
    • On main with only the test added, the new test fails. With the fix, it passes. The rest of the trace UI suite has the same 5 failures on both builds.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Security scan found no critical or high findings on lines changed by this pull request

View the security scan run for complete reports.

“New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta.

@dhingora-amd
dhingora-amd merged commit c4a3215 into main Nov 27, 2026
25 checks passed
@dhingora-amd
dhingora-amd deleted the dhingora/fix-empty-table branch November 27, 2026 16:54

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants