fix: Improve Anywidget pagination and display for unknown row counts
Previously, when the total number of rows (row_count) was unknown (e.g., due to deferred computation or errors), it would incorrectly default to 0. This resulted in confusing UI, such as displaying "Page 1 of 0", and allowed users to navigate to empty pages without automatically returning to valid data.
current display strategy for the interactive table widget:
-
When
row_countis a positive number (e.g., 50):- Total Rows Display: Shows the exact count, like 50 total rows.
- Pagination Display: Shows the page relative to the total rows, like Page 1 of 50.
- Navigation: The "Next" button is disabled only on the final page.
-
When
row_countisNone(unknown):- Total Rows Display: Shows Total rows unknown.
- Pagination Display: Shows the page relative to an unknown total, like Page 1 of many.
- Navigation: The "Next" button is always enabled, allowing you to page forward until the backend determines there is no more data.
Fixes #<428238610> 🦕
Check out this pull request on ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
@tswast Upon checking, the failed e2e tests are not related to my change.