Skip to content

Render the records table in the admin Databases tab - #206

Merged
dnnsjsk merged 1 commit into
inline0:mainfrom
Contributolo:fix/admin-database-records-layout
Nov 11, 2026
Merged

dnnsjsk merged 1 commit into
inline0:mainfrom
Contributolo:fix/admin-database-records-layout

Conversation

@Contributolo

Copy link
Copy Markdown
Collaborator

Fixes #205.

Cause

DatabaseRecordsTable passes children to DataViews. DataViews renders children ?? <DefaultUI /> (@wordpress/dataviews 11.3.0, src/dataviews/index.tsx), so the children replace the whole default UI, including the layout. The only child was DataViews.Footer, and the footer returns null when there is a single page and no bulk actions. So the .dataviews-wrapper stays empty, exactly as described in the issue. With more than 20 records, only the pagination would show.

The containerWidth: 0 from the issue is a side effect, not the cause: in this version only the grid layouts attach resizeObserverRef, the table layout does not, so containerWidth is 0 on the working Overview tables as well. The TabPanel is not involved either.

Change

Add <DataViews.Layout /> before <DataViews.Footer />, the same composition the registry tables use. Search and filters are left out on purpose: the records endpoint has no search parameter and the fields are not filterable.

includes/admin/assets/admin/index.js and index.asset.php are rebuilt with npm run build. A build of the unchanged main reproduces the committed bundles byte for byte, so the diff there is only this change.

Tests

New E2E test Admin Page - Databases in tests/e2e/admin/registry.ts: it creates a record in the blockstudio/type-db-table schema of the test theme, opens Databases and that tab, expects a table with the record, and deletes the record again.

There is no wp-env here, so I ran it against WordPress Playground (PHP 8.4, latest WordPress, the plugin and tests/theme mounted as in tests/wp-env/.wp-env.json), with only BASE changed: it passes with this change and fails on the 7.7.13 bundle ("element(s) not found" for the table). The same setup reproduces the empty tab from the issue without the change (wrapper with zero children, no console errors) and shows the table with all records with it.

npm run lint, oxfmt --check on the changed files and tsc for tsconfig.json, tsconfig.tooling.json and tsconfig.browser.json pass. No new translatable strings.

DatabaseRecordsTable passes children to DataViews, and DataViews renders
its children instead of the default UI. The children were only
DataViews.Footer, which returns null for a single page, so the records
area stayed empty and the table never mounted. Add DataViews.Layout
before the footer, like the registry tables do.

Fixes inline0#205
@dnnsjsk

dnnsjsk commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Merged and released in Blockstudio 7.7.14, integration commit b1c5139. The E2E regression verifies a real record on both the initial visit and a return visit, with record cleanup afterwards. Updated admin documentation and the production bundle are included. Full CI and distribution checks pass. Thanks for the contribution.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Admin Databases tab renders empty table — DataViews containerWidth stays 0 on TabPanel-mounted views

2 participants