Skip to content

DataViews: improve out-of-bounds page empty state messaging and pagination. - #80982

Open
shail-mehta wants to merge 5 commits into
trunkfrom
fix/dataviews-out-of-bounds-page-messaging
Open

DataViews: improve out-of-bounds page empty state messaging and pagination.#80982
shail-mehta wants to merge 5 commits into
trunkfrom
fix/dataviews-out-of-bounds-page-messaging

Conversation

@shail-mehta

Copy link
Copy Markdown
Member

What?

Closes #80840

  • Shows a specific empty state message for out-of-bounds pages: "No results on this page".
  • Keeps pagination/page switcher visible so users can navigate back to valid pages.
  • Handles rest_post_invalid_page_number in core-data by recovering pagination metadata from page 1 and returning an empty result set for the requested page.
  • Adds/updates tests for both DataViews UI behavior and core-data resolver fallback.
  • Adds changelog entries in Dataviews and core-data.

Why?

  • In the issue scenario, users see generic "No results" with no clear indication that results exist on other pages.
  • This is confusing when URL pageNumber is out of bounds.
  • The fix aligns behavior with the issue expectation: clear out-of-bounds message + visible page switcher.

How?

  • Detects out-of-bounds state when totalItems > 0, totalPages > 0, and view.page > totalPages.
  • Uses out-of-bounds copy for default empty state.
  • Ensures pagination select remains functional when current page is out-of-range.

Testing Instructions

  • Clear any saved view before proceeding (View config → Reset view).
  • Load theme test data.
  • Ensure page dataset has “level” matches (about 8–9 records is fine).
  • Open http://localhost:8888/wp-admin/site-editor.php?p=%2Fpage&pageNumber=5&search=level then
    Verify:
  • Empty state shows "No results on this page".
  • Pagination/page switcher is visible.
  • You can navigate back to valid pages and see results.
  • Open a true-empty search like: http://localhost:8888/wp-admin/site-editor.php?p=%2Fpage&search=fmjfajf Verify generic "No results" still appears.

Use of AI Tools

  • Yes

@shail-mehta shail-mehta self-assigned this Jul 30, 2026
@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Jul 30, 2026
@github-actions github-actions Bot added [Package] Core data /packages/core-data [Package] DataViews /packages/dataviews labels Jul 30, 2026
@shail-mehta shail-mehta changed the title DataViews: improve out-of-bounds page empty state messaging and pagin… DataViews: improve out-of-bounds page empty state messaging and pagination. Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

Size Change: +537 B (+0.01%)

Total Size: 7.76 MB

📦 View Changed
Filename Size Change
build/modules/content-types/index.min.js 166 kB +107 B (+0.06%)
build/scripts/core-data/index.min.js 36.5 kB +75 B (+0.21%)
build/scripts/edit-site/index.min.js 306 kB +86 B (+0.03%)
build/scripts/editor/index.min.js 501 kB +146 B (+0.03%)
build/scripts/media-utils/index.min.js 122 kB +123 B (+0.1%)

compressed-size-action

@shail-mehta
shail-mehta marked this pull request as ready for review July 30, 2026 16:43
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: shail-mehta <shailu25@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

Labels

[Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond [Package] Core data /packages/core-data [Package] DataViews /packages/dataviews [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DataViews: improve messaging for out-of-bounds page

1 participant