Skip to content

DataViews: Show table primary actions next to the title - #86971

Draft
oandregal wants to merge 8 commits into
trunkfrom
try/dataviews-table-actions-adjacent-to-title
Draft

oandregal wants to merge 8 commits into
trunkfrom
try/dataviews-table-actions-adjacent-to-title

Conversation

@oandregal

@oandregal oandregal commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

What?

See #75668

In the table layout, primary actions now sit next to the title, like in the list layout, and only show while the row is hovered. The actions column only holds the actions menu, which lists every action.

Why?

Primary actions take a lot of room in the actions column, which every row reserves whether or not it's hovered. This is a fourth approach to #75668, after #86916 (assign space dynamically), #86247 (actions below the title) and #75671 (actions as an overlay), following the mockup in #75668 (comment).

How?

  • The primary column renders the primary actions next to the title, as link buttons. At rest they take no room, so the title can use the whole cell; on hover, the title elides to make room for them.
  • The primary column keeps the same width whichever row is hovered. The actions' box is always 0 wide, and the buttons overflow it, so they never add to the column's width. Instead, the title makes room for them with a percentage max-width, which tables ignore when they size their columns. usePrimaryActionsFit measures the widths this needs and shares them as custom properties.
  • The column reserves room for each row's title and actions on one line, up to the title's 80 character cap. At rest the title uses that room; on hover the actions do. When a row still can't fit them, the actions wrap, and the row grows while hovered.
  • The actions column only holds the actions menu, through a new internal isMenuOnly prop of ItemActions, and its "Actions" label is visually hidden, so the column is as wide as the menu button. When the title isn't displayed, primary actions are only in the menu.
  • Primary actions show on hover, or while one of them has keyboard focus. Selected rows, or rows with focus elsewhere, don't show them. On devices without hover, they always show, like before.

Testing Instructions

  1. Open Pages in the site editor, and switch to the table layout.
  2. Hover rows: the primary actions (Quick edit, View, Trash) show next to the title, and the Title column doesn't change width between rows.
  3. Rename a page to a long title, or narrow the window: the title elides to make room for the actions, and actions that don't fit wrap.
  4. Select a row and move the pointer away: its primary actions hide.
  5. Hide the Title in the view options: the actions column only shows the actions menu, which lists every action.

Testing Instructions for Keyboard

  1. Tab into a row: the checkbox, media and title don't reveal the primary actions.
  2. Keep tabbing: focusing a primary action reveals them, and they stay visible while focus is on them.
  3. Tab to the Actions button: the menu lists every action, including the primary ones.

Screenshots or screencast

Before After
Pages table at rest on trunk: a wide Actions column with its label Pages table at rest with this change: a wider Title column and an Actions column as wide as its menu button
Hovering a row on trunk: Quick edit, View and Trash show in the Actions column Hovering a row with this change: Quick edit, View and Trash show next to the title
A selected row on trunk, not hovered: Quick edit, View and Trash show in the Actions column A selected row with this change, not hovered: its primary actions stay hidden

Use of AI Tools

Written with Claude Code (Claude Opus 5.5), directed and reviewed by the author.

oandregal and others added 8 commits November 17, 2026 16:37
In the table layout, primary actions now sit next to the title, like the
list layout, and take no room until the row is hovered or focused. The
actions column only holds the menu, which lists every action. When the
title isn't displayed, primary actions stay in the actions column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Revealing the primary actions next to the title widened the primary
column whenever the row's title and actions didn't fit, so the column
jumped between rows. The actions are now positioned out of the flow and
never add to the column's width; the title gives up the room they need
instead, measured in `usePrimaryActionsFit`.

The actions are capped to the room left after a minimum of title (the
whole title when it's short, 10 characters otherwise). Actions that
don't fit are hidden, so they can't take focus while invisible, and stay
available in the actions menu.

Also keeps the hierarchy mark from shrinking under the title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Instead of hiding the primary actions that don't fit next to the title,
wrap them onto more lines. The row grows taller while they're revealed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The primary column now reserves room for each row's primary actions on
one line, next to its whole title, up to the title's 80 character cap.
At rest the title uses that room; once revealed, the actions do, so the
title isn't elided and the actions don't wrap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With primary actions next to the title, the actions column only holds
the actions menu, but its visible "Actions" label set its width and
left the menu off-center. Hide the label visually, keeping it for
assistive technology, and render the menu at its regular size through a
new `isMenuOnly` prop, instead of the smaller `isCompact` one.

When the title isn't displayed, primary actions stay in the actions
column, and so does its visible label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The table's actions column now always holds only the actions menu, which
lists every action. Primary actions render as buttons next to the title,
so when the title isn't displayed they're only in the menu, and the
column's label is always visually hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Selected rows, and rows holding focus elsewhere, such as on their
checkbox, revealed the primary actions next to the title. Reveal them
only on hover, or while one of them has keyboard focus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Package] DataViews /packages/dataviews label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

📦 Bundle size

Size Change: +4.45 kB (+0.05%)

Total Size: 8.67 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 555 kB +353 B (+0.06%)
build/scripts/edit-site/index.min.js 383 kB +466 B (+0.12%)
build/scripts/editor/index.min.js 572 kB +437 B (+0.08%)
build/scripts/media-utils/index.min.js 238 kB +426 B (+0.18%)
build/styles/edit-site/style-rtl.css 21.1 kB +447 B (+2.16%)
build/styles/edit-site/style-rtl.min.css 17.1 kB +250 B (+1.49%)
build/styles/edit-site/style.css 21.2 kB +443 B (+2.14%)
build/styles/edit-site/style.min.css 17 kB +248 B (+1.48%)
build/styles/editor/style-rtl.css 32.1 kB +443 B (+1.4%)
build/styles/editor/style-rtl.min.css 27.7 kB +250 B (+0.91%)
build/styles/editor/style.css 32.2 kB +439 B (+1.38%)
build/styles/editor/style.min.css 27.7 kB +249 B (+0.91%)

b1ac01e Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric d8b9898 trunk % Change
timeToFirstByte 55 ms +5.27% -3.36% 54.5 ms +7.89% -2.29% 0.92%
largestContentfulPaint 84 ms +4.76% -4.76% 88 ms +4.55% -4.55% -4.55%
lcpMinusTtfb 28.2 ms +4.96% -4.79% 29.5 ms +30.17% -5.25% -4.41%
wpBeforeTemplate 28.85 ms +6.59% -2.53% 28.7 ms +3.21% -1.88% 0.52%
wpTemplate 22.15 ms +1.72% -5.24% 21.8 ms +5.87% -2.34% 1.61%
wpTotal 51.36 ms +4.83% -3.41% 50.92 ms +6.48% -3.44% 0.86%
wpMemoryUsage 7.75 MB +0% -0% 7.71 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric d8b9898 trunk % Change
timeToFirstByte 45.6 ms +4.71% -1.75% 46.7 ms +4.82% -2.89% -2.36%
largestContentfulPaint 80 ms +7.5% -0% 80 ms +5% -0% 0%
lcpMinusTtfb 35 ms +2.86% -1.71% 34.2 ms +2.34% -3.8% 2.34%
wpBeforeTemplate 26.2 ms +3.55% -1.49% 26.54 ms +11.53% -1.62% -1.28%
wpTemplate 16.13 ms +4.77% -2.48% 16.2 ms +3.95% -1.48% -0.43%
wpTotal 42.38 ms +5.62% -1.34% 43.59 ms +4.73% -2.8% -2.78%
wpMemoryUsage 6.44 MB +0% -0% 6.40 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric d8b9898 trunk % Change
mediaProcessingJpeg 406 ms +0.08% -0.92% 399.96 ms +0.62% -0.52% 1.51%
mediaProcessingAvif 6139.18 ms +0.4% -0.16% 6131.79 ms +0.38% -0.07% 0.12%
mediaProcessingJpegToAvif 4243.45 ms +0.17% -0.2% 4240.08 ms +0.17% -0.04% 0.08%

media-upload

Metric d8b9898 trunk % Change
jpegUploadProcessing 2007.44 ms +1.33% -1.1% 1531.28 ms +29.78% -1.84% 31.1%
pngUploadProcessing 270.03 ms +7.53% -3.92% 268.66 ms +1.6% -1.07% 0.51%
largeJpegUploadProcessing 1978.61 ms +0.93% -23.03% 1745.64 ms +13.09% -13.71% 13.35%
multipleImageUploadProcessing 2094.45 ms +1.44% -1.24% 2085.63 ms +1.51% -0.84% 0.42%

post-editor

Metric d8b9898 trunk % Change
serverResponse 338.02 ms +1.79% -11.48% 325.36 ms +1.56% -8.11% 3.89%
firstPaint 339.65 ms +12.57% -4.6% 317.42 ms +10.36% -1.16% 7%
domContentLoaded 664.63 ms +8.2% -2.72% 632.42 ms +1.26% -0.66% 5.09%
loaded 665.61 ms +8.19% -2.72% 633.24 ms +1.26% -0.65% 5.11%
firstContentfulPaint 378.88 ms +7.04% -5.32% 359.83 ms +0.62% -1.47% 5.29%
firstBlock 1766.82 ms +3.59% -2.01% 1684.23 ms +1.92% -1.44% 4.9%
type 16.03 ms +6.18% -7.99% 14.47 ms +3.18% -8.71% 10.78%
typeWithoutInspector 14.78 ms +1.76% -12.11% 14.47 ms +4.35% -9.33% 2.14%
typeWithTopToolbar 18.13 ms +6.4% -7.67% 18.39 ms +11.69% -10.39% -1.41%
typeContainer 6.65 ms +8.87% -9.47% 6.63 ms +2.56% -5.13% 0.3%
focus 89.87 ms +6.08% -0.69% 91.23 ms +12.44% -2.8% -1.49%
firstFocus 218.73 ms +0% -0% 210.54 ms +0% -0% 3.89%
selectAll 316.99 ms +1.12% -2.98% 313.99 ms +3.09% -3.21% 0.96%
undo 23.96 ms +5.93% -4.26% 24.07 ms +6.65% -4.99% -0.46%
listViewOpen 61.58 ms +13.98% -7.81% 57.88 ms +4.25% -5.63% 6.39%
inserterOpen 33.13 ms +4.53% -2.63% 33.55 ms +3.28% -11.56% -1.25%
inserterHover 9.72 ms +3.81% -10.39% 9.37 ms +9.61% -7.15% 3.74%
inserterSearch 6.98 ms +4.01% -3.3% 6.8 ms +5.29% -6.18% 2.65%
loadPatterns 503.87 ms +2.72% -1.61% 517.19 ms +0.8% -2.73% -2.58%
wpTotal 329.39 ms +1.75% -11.81% 316.81 ms +1.57% -8.31% 3.97%
wpMemoryUsage 14.81 MB +0% -0% 14.77 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric d8b9898 trunk % Change
serverResponse 261.96 ms +3.5% -8.54% 257.67 ms +3.07% -1.73% 1.66%
firstPaint 321.45 ms +6.07% -17.39% 279.89 ms +11.12% -9.64% 14.85%
domContentLoaded 570.38 ms +1.75% -2.72% 539.46 ms +2.11% -0.45% 5.73%
loaded 571.1 ms +1.74% -2.71% 540.17 ms +2.13% -0.45% 5.73%
firstContentfulPaint 326.09 ms +4.56% -2.43% 308.52 ms +1.04% -1.27% 5.69%
firstBlock 1719.52 ms +5.63% -1.63% 1666.44 ms +1.16% -0.52% 3.19%
type 12.64 ms +2.37% -6.41% 12.6 ms +7.62% -6.11% 0.32%
navigate 83.58 ms +5.42% -7.02% 75.32 ms +16.13% -8.62% 10.97%
loadPatterns 1000.76 ms +5.26% -0.98% 1060.59 ms +7.33% -4.02% -5.64%
loadPages 903.92 ms +1.24% -0.94% 974.68 ms +1.27% -2.77% -7.26%
wpTotal 255.26 ms +3.64% -8.76% 251.14 ms +3.01% -1.75% 1.64%
wpMemoryUsage 12.82 MB +0% -0% 12.79 MB +0% -0% 0.25%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

b1ac01e Run

@oandregal

oandregal commented Nov 17, 2026 •

Copy link
Copy Markdown
Member Author

How do we think about action styles here? It seems the blueish (or the primary color of the user's palette, etc.) would be better than the previous black, given we want actions to stand out over the title (they are so close we don't want actions and title to be confused). I suppose we also want to remove the underlines.

@oandregal oandregal added [Type] Enhancement A suggestion for improvement. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Nov 17, 2026
@oandregal oandregal self-assigned this Nov 17, 2026
@oandregal

Copy link
Copy Markdown
Member Author

cc @verofasulo

@oandregal

Copy link
Copy Markdown
Member Author

I need to stress test wrapping actions (when there are many of them), but it's promising: large titles create enough space for common scenarios (1-3 actions) and small titles reserve some space for them.

@jasmussen

Copy link
Copy Markdown
Contributor

Thanks for the fast work. Quick GIF as I tested this:

state

This is better than what's shipping, I think, so that's progress. It also does reveal the main downside of showing quick actions as a title-suffix rather than, say, below. It causes a river-effect, where the the position of the actions jumps between rows.

Not too sure how hard work it would be to ask Opus to try the other direction as well—actions below the title. It would definitely unify us towards what list tables do, which has its own benefits, and you could explore the cautious mockup I shared here. That mockup also has the benefit of retaining neutral colours for the main actions, and destructive for "Trash", which surfaces another conversation to have at some point (but not today): blue or black titles?

@oandregal

Copy link
Copy Markdown
Member Author

Not too sure how hard work it would be to ask Opus to try the other direction as well—actions below the title.

That's available at #86247 (comment) (just rebased and updated with some tweaks).

@jameskoster

Copy link
Copy Markdown
Contributor

I guess it wasn't clear in my original mockup but the idea was for the actions to be right-aligned within the column; that should address the river. It might make the actions feel too detached from the title though, needs testing.

Which component are we using for the actions? They look like links which seems wrong for 'actions'.

@jasmussen

Copy link
Copy Markdown
Contributor

Still eager for this PR! Thanks @oandregal for iterating.

@pavel-mailpoet

Copy link
Copy Markdown

We use DataViews in MailPoet for Subscribers, Emails, and other listings. In the screenshot below, the Subscribers listing’s Actions column reserves space for “Edit” on every row, even though it only shows on hover. That leaves less room for the subscriber, tags, and lists columns, which already wrap.

This direction works well for us because the Actions column only needs room for the ⋯ menu and “Edit” appears next to the title when needed. We already use a button in the row when an action needs to stand out, so the always-visible buttons in #82109 would take up more space than we need.

Screenshot 2026-12-02 at 10 29 47

This branch has not been deployed

No deployments
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] DataViews /packages/dataviews [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants