Skip to content

Fields: Remove the link underline from the page title badge - #86937

Closed
t-hamano wants to merge 4 commits into
trunkfrom
fix/dataviews-title-link-underline
Closed

t-hamano wants to merge 4 commits into
trunkfrom
fix/dataviews-title-link-underline

Conversation

@t-hamano

@t-hamano t-hamano commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Note

Following the discussion in #73489 and #86937 (comment), this PR now keeps the title underline and removes it from the badge only. Outdated parts of the description are struck through.

What?

Removes the link underline from the title field in the DataViews table and grid layouts when items are rendered as links via renderItemLink.

Removes the link underline from the badge next to a page title, such as "Privacy Policy Page", in the DataViews table and grid layouts when items render as links with renderItemLink. The title itself keeps its underline.

Why?

In site editor v2, the page list shows the title, and badges such as "Privacy Policy Page", underlined. The v1 site editor does not, because it uses onClickItem, which renders a div role="button" instead of a link.

.dataviews-title-field a resets the link styles, but in the table and grid layouts the ItemClickWrapper element with the dataviews-title-field class is itself the a, so the selector never matches and the default a { text-decoration: underline } applies. The underline also propagates to the badge since #82499 replaced the Components Badge, whose inline-block/inline-flex wrapper blocked it, with the @wordpress/ui Badge.

In Site Editor v2, the page list renders titles as links, so the title is underlined. The badge inside the title inherits that underline, which makes it look like part of the link text.

The title underline stays, following the discussion in #73489: titles that are links should be underlined so users can tell they are links. The v1 site editor uses onClickItem, which renders a button rather than a link, so it has no underline in the first place. Whether both should consistently use links is a separate discussion.

The underline reaches the badge since #82499 replaced the Components Badge, whose inline-flex wrapper blocked it, with the @wordpress/ui Badge.

How?

Adds text-decoration: none to .dataviews-title-field--clickable, the class ItemClickWrapper adds to the clickable wrapper. This removes the underline at its source, so the badge needs no change.

An element cannot remove an underline it inherits from an ancestor with text-decoration: none, but an underline does not propagate into an inline block. The badge is a flex item of the title, and flex items are always blockified, so the badge is wrapped in a span and rendered as an inline block inside it. The badge still truncates with an ellipsis when space runs out.

Testing Instructions

  1. Enable the "Extensible Site Editor" experiment.
  2. Set a page as the privacy policy page in Settings > Privacy.
  3. Open the extensible site editor's page list in the table layout.
  4. Confirm the titles and the "Privacy Policy Page" badge have no underline, and the title color changes on hover. Confirm the titles are underlined and the "Privacy Policy Page" badge is not.
  5. Switch to the grid layout and confirm the same.
  6. Switch to the list layout, make the list narrow, and confirm the badge still truncates with an ellipsis.

Screenshots or screencast

compare-table compare-grid

Use of AI Tools

This PR was authored with Claude Code (Claude Opus 5.5), including the investigation, the fix and the screenshots, and reviewed by the author.

claude and others added 2 commits November 17, 2026 08:48
When `renderItemLink` is used, the title field wrapper is itself the
link, so the `.dataviews-title-field a` reset does not apply and the
title (and any badge in it) inherits the default link underline.

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URxCUqpueo5FHpbLJAC
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URxCUqpueo5FHpbLJAC
@github-actions github-actions Bot added the [Package] DataViews /packages/dataviews label Nov 17, 2026
@t-hamano t-hamano self-assigned this 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

🎉 Props

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: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@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.

📦 Bundle size

Size Change: +80 B (0%)

Total Size: 8.68 MB

📦 View Changed
Filename Size Change
build/modules/core-fields/page.min.js 7.13 kB +80 B (+1.13%)

52c88a1 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric a20baa6 trunk % Change
timeToFirstByte 44.25 ms +9.49% -5.54% 45.25 ms +7.85% -7.4% -2.21%
largestContentfulPaint 72 ms +8.33% -5.56% 72 ms +2.78% -5.56% 0%
lcpMinusTtfb 26.2 ms +16.6% -8.97% 25.1 ms +14.34% -7.37% 4.38%
wpBeforeTemplate 22.66 ms +17.21% -4.77% 23.3 ms +15.92% -4.46% -2.75%
wpTemplate 17.38 ms +5.58% -5.18% 17.08 ms +12.53% -4.1% 1.76%
wpTotal 40.79 ms +10.59% -5.71% 41.83 ms +8.15% -7.48% -2.49%
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 a20baa6 trunk % Change
timeToFirstByte 36.1 ms +8.73% -1.94% 36.45 ms +4.12% -2.47% -0.96%
largestContentfulPaint 64 ms +6.25% -0% 64 ms +3.13% -0% 0%
lcpMinusTtfb 28.6 ms +3.5% -1.75% 27.6 ms +3.08% -2.54% 3.62%
wpBeforeTemplate 19.67 ms +5.13% -2.14% 19.74 ms +12.31% -0.76% -0.35%
wpTemplate 13.25 ms +4.68% -1.74% 13.23 ms +5.97% -5.52% 0.15%
wpTotal 33.39 ms +8.83% -2.28% 33.74 ms +4.09% -3.29% -1.04%
wpMemoryUsage 6.44 MB +0% -0% 6.40 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric a20baa6 trunk % Change
mediaProcessingJpeg 326.58 ms +0.66% -0.42% 326.54 ms +0.51% -0.31% 0.01%
mediaProcessingAvif 4920.98 ms +0.07% -0.54% 4882.42 ms +0.13% -0.44% 0.79%
mediaProcessingJpegToAvif 3406.52 ms +0.53% -0.75% 3392.45 ms +0.3% -0.2% 0.41%

media-upload

Metric a20baa6 trunk % Change
jpegUploadProcessing 1470.05 ms +1.97% -1.26% 1449.89 ms +0.92% -0.26% 1.39%
pngUploadProcessing 227.06 ms +37.18% -4.76% 243.14 ms +2.95% -5.47% -6.61%
largeJpegUploadProcessing 1433.57 ms +1.72% -0.4% 1442.14 ms +0.59% -0.23% -0.59%
multipleImageUploadProcessing 1541.52 ms +7.74% -2.01% 1518.62 ms +1.76% -1.28% 1.51%

post-editor

Metric a20baa6 trunk % Change
serverResponse 513.69 ms +5.22% -6.3% 493.52 ms +1.29% -6.83% 4.09%
firstPaint 442.05 ms +11% -6.48% 442.08 ms +7.32% -7.7% -0.01%
domContentLoaded 893.65 ms +3.57% -1.94% 851.67 ms +3.24% -2.36% 4.93%
loaded 895.01 ms +3.57% -1.9% 852.74 ms +3.28% -2.32% 4.96%
firstContentfulPaint 498.21 ms +4.01% -2.73% 479.55 ms +7.39% -3.99% 3.89%
firstBlock 2494.18 ms +1.53% -1.62% 2387.36 ms +1.82% -2.31% 4.47%
type 26.17 ms +8.71% -6.99% 25.18 ms +12.87% -10.76% 3.93%
typeWithoutInspector 25.12 ms +5.18% -10.23% 22.84 ms +20.67% -0.74% 9.98%
typeWithTopToolbar 31.36 ms +15.27% -8.64% 29.45 ms +6.66% -3.94% 6.49%
typeContainer 10.01 ms +12.59% -7.69% 9.85 ms +7.72% -12.49% 1.62%
focus 142.64 ms +2.79% -2.53% 125.82 ms +6.76% -1.96% 13.37%
firstFocus 370.75 ms +0% -0% 295.17 ms +0% -0% 25.61%
selectAll 480.43 ms +0.74% -2.7% 468.96 ms +6.42% -4.31% 2.45%
undo 35.65 ms +7.18% -8.25% 31.83 ms +7.13% -7.07% 12%
listViewOpen 93.17 ms +12.17% -2.93% 82.99 ms +8.48% -1.78% 12.27%
inserterOpen 46.86 ms +4.42% -3.35% 47.35 ms +7.9% -5.89% -1.03%
inserterHover 14.59 ms +3.7% -7.27% 13.55 ms +11.37% -7.23% 7.68%
inserterSearch 10.17 ms +12.98% -8.95% 10.06 ms +15.11% -11.73% 1.09%
loadPatterns 698.65 ms +5.69% -1.55% 699.42 ms +5.36% -3.28% -0.11%
wpTotal 503.4 ms +4.93% -6.44% 483.26 ms +1.36% -6.95% 4.17%
wpMemoryUsage 14.81 MB +0% -0% 14.77 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric a20baa6 trunk % Change
serverResponse 402.57 ms +0.36% -6.22% 398.66 ms +1.42% -7.56% 0.98%
firstPaint 414.07 ms +13.12% -7.06% 420.64 ms +7.99% -12.29% -1.56%
domContentLoaded 824.34 ms +2.65% -1.82% 806.02 ms +1.01% -0.87% 2.27%
loaded 825.26 ms +2.66% -1.82% 806.93 ms +1.04% -0.85% 2.27%
firstContentfulPaint 459.64 ms +6.89% -1.64% 450.12 ms +2.01% -3.29% 2.11%
firstBlock 2433.33 ms +4.9% -1.11% 2411.54 ms +1.18% -1.59% 0.9%
type 16.58 ms +8.38% -5.43% 17.35 ms +2.71% -12.74% -4.44%
navigate 112.67 ms +4.89% -0.96% 112.88 ms +12.84% -2.89% -0.19%
loadPatterns 1334.7 ms +6.58% -11.27% 1409.6 ms +4.54% -5.5% -5.31%
loadPages 916.6 ms +1.29% -0.77% 928.64 ms +0.83% -0.53% -1.3%
wpTotal 393.44 ms +0.34% -6.35% 389.47 ms +1.44% -7.76% 1.02%
wpMemoryUsage 12.82 MB +0% -0% 12.79 MB +0% -0% 0.21%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

52c88a1 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Allows widget deletion to be undone in /test/e2e/specs/widgets/editing-widgets.spec.js, passed after 1 failed attempt.

Navigates the list via UP/DOWN arrow keys from action buttons in /test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator:  getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
Expected: focused
Received: inactive
Timeout:  5000ms

Call log:
  - Expect "toBeFocused" getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' }) with timeout 5000ms
  - waiting for getByRole('row', { name: 'Page Two Edit Actions' }).getByRole('button', { name: 'Edit' })
    14 × locator resolved to <button type="button" tabindex="-1" class="components-button is-small" id="view-list-0-176-primary-action-edit-post">Edit</button>
       - unexpected value "inactive"

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/dataviews-list-layout-keyboard.spec.js:243:5
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21

52c88a1 Run

@t-hamano t-hamano added the [Type] Bug An existing feature does not function as intended label Nov 17, 2026
Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URxCUqpueo5FHpbLJAC
@t-hamano
t-hamano marked this pull request as ready for review November 17, 2026 08:59
@ntsekouras

ntsekouras commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

I remember some back and forths design wise for this one. @WordPress/gutenberg-design can you chime in?

@jameskoster

Copy link
Copy Markdown
Contributor

I'm not convinced this is a design question. For me the design should follow the semantics. In other words, if the items are links then we should indicate that to the user somehow (typically with an underline). That way they can predict link behaviors (e.g. right-click open-in-new-tab) rather than having to guess. So the question is really; should the titles be links or buttons?

One thing I would say; the badge should probably be outside of the title element, or at least not inherit the underline.

The title of an item that renders as a link keeps its underline, so users
can tell it is a link. The page title badge, which inherited the underline
from the link, now renders as an inline block inside a wrapper, which stops
the underline from reaching it.

Co-authored-by: t-hamano <54422211+t-hamano@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011g9URyKcjmHwMrNzohTbkh
@github-actions github-actions Bot added [Package] Fields /packages/fields and removed [Package] DataViews /packages/dataviews labels Nov 19, 2026
@t-hamano t-hamano changed the title DataViews: Remove the underline from title links Fields: Remove the link underline from the page title badge Nov 19, 2026
@t-hamano

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback.

if the items are links then we should indicate that to the user somehow

While looking for previous discussions on this, I found #73489. There seems to be agreement there that link titles should be underlined. So I've changed the direction of this PR: the title keeps its underline, and only the badge no longer inherits it.

Note that the underline only appears when renderItemLink makes the wrapper itself an a element, which in Gutenberg currently means Site Editor v2 only. The v1 site editor uses onClickItem, which renders a button rather than a link, so it has no underline in the first place. Whether both should consistently use links is a separate discussion, I think.

@jameskoster

Copy link
Copy Markdown
Contributor

Could it make sense to add display: inline-block; text-decoration: none to Badge to fix this at the source and prevent it occurring elsewhere?

@t-hamano

t-hamano commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Could it make sense to add display: inline-block; text-decoration: none to Badge to fix this at the source and prevent it occurring elsewhere?

Good idea! I've concluded that this issue should be fixed in the Badge component.

Closing this in favor of #87074

@t-hamano t-hamano closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Fields /packages/fields [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants