Skip to content

DataViews: Render table bulk actions outside the table - #85250

Merged
oandregal merged 10 commits into
WordPress:trunkfrom
dinhtungdu:try/table-bulk-actions-sibling
Oct 26, 2026
Merged

oandregal merged 10 commits into
WordPress:trunkfrom
dinhtungdu:try/table-bulk-actions-sibling

Conversation

@dinhtungdu

@dinhtungdu dinhtungdu commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

What?

Follow-up to #82730. Move the table bulk actions toolbar outside the table while preserving its placement over the column headers. No intended visual change.

Why?

Remove the workaround that places the bulk actions toolbar in an extra table row and restore the expected table structure.

How?

Use a sticky sibling element and measure the header height with a resize observer.

Testing Instructions

  1. Open Site Editor → Pages in table view, in both classic and extensible editors.
  2. Select rows. Check bulk actions, Cancel, and horizontal/vertical scrolling at desktop and narrow widths.
  3. Change table density and confirm the toolbar stays aligned.

Testing Instructions for Keyboard

Tab to Select all and press Space. Focus moves to the toolbar checkbox. Tab through actions, then activate Cancel. Focus returns to Select all, and column sorting works again.

Use of AI Tools

Amp assisted with implementation, verification, and review.

Amp thread

@github-actions github-actions Bot added the [Package] DataViews /packages/dataviews label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 Props

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @ampagent.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Unlinked contributors: ampagent.

Co-authored-by: dinhtungdu <dinhtungdu@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.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@dinhtungdu
dinhtungdu marked this pull request as ready for review October 21, 2026 13:32
@oandregal oandregal added the [Type] Enhancement A suggestion for improvement. label Oct 23, 2026
@oandregal

Copy link
Copy Markdown
Member

@dinhtungdu Thanks, moving the toolbar out of the table is a nice cleanup.

While testing it, I found three issues with the sibling placement and pushed fixes for you to look at (feel free to revert them):

  1. Wrong height on first paint. When the table loaded with rows already selected, the bulk actions toolbar briefly showed at the wrong height before resizing. Fixed in 4750208.
  2. It no longer followed an offset header. Inside <thead>, the toolbar moved with any sticky offset a consumer gave the header; as a sibling, it didn't. I reproduced by opening the Free Composition story and clicking Select all: the toolbar sat above the column headers instead of over them. It now uses the same offset as the header as of 4f88620.
  3. It painted over page elements at z-index: 2. For example, it covered the sticky heading in Free Composition when the page scrolled. Fixed in 4f88620 as well.

I also fixed the Free Composition story, which is broken on trunk too: its sticky header offset never worked and just hid the first row. Fixed in f571a2c.

@oandregal

Copy link
Copy Markdown
Member

This looks good and I'd approve. Though I want to hear your thoughts first about my suggestions (feel free to revert).

@dinhtungdu
dinhtungdu force-pushed the try/table-bulk-actions-sibling branch from f571a2c to 59de4c6 Compare October 26, 2026 04:01
@dinhtungdu

Copy link
Copy Markdown
Member Author

@oandregal thanks for the review and commits. It's my mistake only tested the default case, great catch! I also addressed you feedback, all makes sense to me! Thanks again, this is ready for another review.

dinhtungdu and others added 10 commits October 26, 2026 16:43
Keep the toolbar over the sticky header without adding a table row or cell. Measure the header with the existing resize observer so density and custom header sizes stay aligned.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1590a-46c4-73eb-a596-5d55213f3f75
Co-authored-by: Amp <amp@ampcode.com>
Fade the toolbar over a themed backing so covered column headers cannot show through. Extend delayed-loading browser coverage.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1590a-46c4-73eb-a596-5d55213f3f75
Co-authored-by: Amp <amp@ampcode.com>
Cover fractional scroll bounds, locate bulk actions outside table cells, and link the changelog to this PR.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1590a-46c4-73eb-a596-5d55213f3f75
Co-authored-by: Amp <amp@ampcode.com>
The header height lived in React state seeded with 52px and updated from
the resize observer, which reports after the first paint. Toolbars shown
on mount (such as a selection restored from the URL) rendered at 52px for
a frame in every density. Measure the header in a layout effect when the
toolbar shows, and write the height to the overlay directly from the
observer so header resizes no longer re-render the table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The toolbar now sits outside the table, so a sticky offset that consumers
give the header no longer moved it: it stayed at the top of the scroll
area while the header sat lower. Copy the header's computed
inset-block-start onto the toolbar when it is placed.

Its z-index of 2 also lifted it above page elements at z-index 2 (such as
a sticky heading), which the header-contained toolbar stayed under.
Isolate the table so the header's z-index stays inside it, and drop the
toolbar back to z-index 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The story offset the sticky table header by 67px to clear its sticky
heading, but the header sticks inside the layout's own scroll area,
which never scrolls in this story. The header never stuck to the page
and instead sat 67px down, covering the first row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal
oandregal force-pushed the try/table-bulk-actions-sibling branch from 59de4c6 to c9276eb Compare October 26, 2026 15:54
@oandregal oandregal added the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Oct 26, 2026
@oandregal
oandregal merged commit 73e9762 into WordPress:trunk Oct 26, 2026
91 checks passed
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 26, 2026
@github-actions

Copy link
Copy Markdown

There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch.

PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk.

# Checkout the wp/7.2 branch instead of trunk.
git checkout wp/7.2

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 73e9762b190ea0638286391f7b08137351e59f1f

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.2 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

@oandregal

Copy link
Copy Markdown
Member

Manual backport at #85571

oandregal added a commit that referenced this pull request Oct 26, 2026
Co-authored-by: dinhtungdu <dinhtungdu@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
wporg-sync pushed a commit to WordPress/wordpress-develop that referenced this pull request Oct 27, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340

git-svn-id: https://develop.svn.wordpress.org/trunk@64796 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 27, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340
Built from https://develop.svn.wordpress.org/trunk@64796


git-svn-id: http://core.svn.wordpress.org/trunk@63946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@t-hamano t-hamano added Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) Backported to WP Core Pull request that has been successfully merged into WP Core and removed Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Oct 27, 2026
@github-actions

Copy link
Copy Markdown

There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch.

PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk.

# Checkout the wp/7.2 branch instead of trunk.
git checkout wp/7.2

# Create a new branch for your PR.
git checkout -b my-branch

# Cherry-pick the commit.
git cherry-pick 73e9762b190ea0638286391f7b08137351e59f1f

# Check which files have conflicts.
git status

# Resolve the conflict...
# Add the resolved files to the staging area.
git status
git add .
git cherry-pick --continue

# Push the branch to the repository
git push origin my-branch

# Create a PR and set the base to the wp/7.2 branch.
# See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request.

@oandregal

Copy link
Copy Markdown
Member

Ah, forgot about the labels. Thanks @t-hamano !

Mamaduka pushed a commit that referenced this pull request Oct 28, 2026
Co-authored-by: dinhtungdu <dinhtungdu@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
@Mamaduka Mamaduka removed the Backport to Gutenberg RC Pull request that needs to be backported to a Gutenberg release candidate (RC) label Oct 28, 2026
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
This updates the pinned commit hash of the Gutenberg repository from `be6a50be6834e922b9db12c75c9a2cd817b2db59` to `d72020a651eda64dcc53b5dbd5b9d5bd511c4cc9` (version 24.3.0-rc.1).

A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@be6a50b...d72020a

- BorderControl: Remove double focus outline (WordPress/gutenberg#85173)
- Snackbar: Use design system focus ring (WordPress/gutenberg#85168)
- SelectControl: Fix default options showing the `Select` placeholder (WordPress/gutenberg#85172)
- Actions API: Remove the unsupported `single` action context (WordPress/gutenberg#85186)
- Client-side media: Upgrade wasm-vips to 0.0.19 and raise memory budgets accordingly (WordPress/gutenberg#84980)
- Styles: Fix inconsistent 'Elements' tools panel heading level (WordPress/gutenberg#85247)
- `media-utils`/MediaEdit: use design system focus ring (WordPress/gutenberg#84940)
- Icons: Add new form based icons. (WordPress/gutenberg#84074) (WordPress/gutenberg#85360)
- Navigation: keep custom CSS off inner list containers (WordPress/gutenberg#84881) (WordPress/gutenberg#85367)
- Navigation: keep Global Styles custom CSS off inner list containers (WordPress/gutenberg#85366)
- Edit as HTML: Show design system focus ring on the HTML textarea (WordPress/gutenberg#85266) (WordPress/gutenberg#85359)
- Icons: Restore the missing speech bubble in postComments (WordPress/gutenberg#85275)
- Block Directory: Standardize downloadable block focus indicators (WordPress/gutenberg#85307)
- Global Styles: Add icons and tweak styling for element and block buttons (WordPress/gutenberg#85363) (WordPress/gutenberg#85414)
- Tests: Stop asserting Core lacks the core fields functions (WordPress/gutenberg#85201)
- Meta Boxes: Use the design system focus ring for the panel toggle (WordPress/gutenberg#85355) (WordPress/gutenberg#85410)
- DataViews: Use the design system focus ring for list items. (WordPress/gutenberg#85358) (WordPress/gutenberg#85435)
- Components: Standardize checkbox and radio focus outlines (WordPress/gutenberg#85379) (WordPress/gutenberg#85436)
- UI: Use solid brand highlights for popup items (WordPress/gutenberg#84087)
- Media: Preserve EXIF metadata when converting HEIC to JPEG client-side (WordPress/gutenberg#82040)
- Icons: Add error, info and postComments to the core-admin collection (WordPress/gutenberg#85452)
- UnitControl: Use the design system outline for the unit select focus ring (WordPress/gutenberg#85444)
- Page List: Keep pages visible in the Navigation sidebar in contentOnly (WordPress/gutenberg#85357)
- Icons: Add new asterisk icon (WordPress/gutenberg#85442) (WordPress/gutenberg#85498)
- wp-env: Keep Debian security updates in Bullseye-based images (WordPress/gutenberg#85469)
- Editor: Guard entity preload filters and share entity actions/fields logic (WordPress/gutenberg#85390) (WordPress/gutenberg#85499)
- UI: Scale Spinner stroke width with its size (WordPress/gutenberg#85378)
- [WP 7.2] Fix the block-library TypeScript test project (WordPress/gutenberg#85533)
- Editor: Vertically center the Categories loading spinner (WordPress/gutenberg#85563)
- DataViews: Render table bulk actions outside the table (WordPress/gutenberg#85250) (WordPress/gutenberg#85571)
- Record e2e traces only when a failed test is retried (WordPress/gutenberg#85428)
- Writing flow: fix triple click in a list item selecting the next item (WordPress/gutenberg#85569)
- Build: Limit concurrent wp-build builds (WordPress/gutenberg#79889)
- Icons: Promote Dashicon replacements to `core-admin` and map their Dashicons (WordPress/gutenberg#85541)
  
Props peterwilsoncc, mamaduka.
See #66340

git-svn-id: https://develop.svn.wordpress.org/trunk@64796 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Package] DataViews /packages/dataviews [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants