Skip to content

Excerpt and description fields: Use the regular layout in the DataForm post summary - #82444

Closed
ntsekouras wants to merge 2 commits into
trunkfrom
fields-excerpt-description-regular-layout
Closed

ntsekouras wants to merge 2 commits into
trunkfrom
fields-excerpt-description-regular-layout

Conversation

@ntsekouras

@ntsekouras ntsekouras commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What?

Part of: #76076 (the excerpt field item under "Design tweaks")
Alternative to: #82423 (see #82423 (comment))

With the DataForm inspector, the excerpt field renders Add an excerpt as if it were a value when the excerpt is empty, with the same styling as a real excerpt. This is also problematic in cases the excerpt field would be rendered in DataViews, although that's not the case right now. The description fields of templates and patterns render nothing when empty, for the use case I mentioned, as it's also used in the site editor (DataViews).

#82423 keeps the panel layout and always shows the pencil. This PR tries the other option from that discussion and renders the excerpt and the template description fields inline with the regular layout, so what users see is the textarea with its placeholder. Per Joen's feedback the textareas start at 2 rows instead of 4.

The excerpt field also renders nothing when there is no value, same as #82423, since render is what DataViews would use.

Notes - Needs design feedback

  1. The form gets longer and the "Learn more about manual excerpts" link is now always visible. Do we want to keep the link?
  2. The label follows the regular layout's field label (uppercase and darker), which differs from the panel rows. Is this something we should try to address specifically here(overrides)? Should we consider how can we be consistent with labels between different DataForm layouts? Another way to go with this would be to remove the label altogether, kind of relying to the Learn more about manual excerpts↗ link to make the 'work' for users to understand this is the excerpt field? 🤔 I'm sharing a screenshot for that below:
Screenshot 2026-09-04 at 2 36 06 PM

This PR

Emtpy With value
Screenshot 2026-09-04 at 2 28 18 PM Screenshot 2026-09-04 at 2 21 43 PM

Trunk

Emtpy With value
Screenshot 2026-09-04 at 11 37 32 AM Screenshot 2026-09-04 at 11 37 20 AM

Testing Instructions

  1. Enable the "Editor Inspector: Use DataForm" experiment.
  2. Create a new post and open the Post tab in the sidebar. The excerpt should render as a textarea with the Add an excerpt placeholder.
  3. Add an excerpt, save and reload. The value should persist.
  4. Open a pattern in the post editor and a custom template in the site editor. Their description field should render the same way.
  5. In Preferences uncheck Excerpt and check the field is hidden.
  6. Everything else in the summary should work as before.

Use of AI Tools

Generated with Fable 5 and adjusted/reviewed manually.

Summary by CodeRabbit

  • Improvements
    • Post excerpts now appear inline with a regular layout and top labels.
    • Excerpt fields handle empty and non-empty content more consistently, without placeholder text when empty.
    • Description, pattern description, and excerpt text areas are more compact, displaying two rows instead of four.
    • Pattern descriptions and post excerpts can be edited directly in their text fields.
    • Template descriptions now use a regular layout.

@ntsekouras ntsekouras self-assigned this Sep 4, 2026
@ntsekouras ntsekouras added the [Type] Enhancement A suggestion for improvement. label Sep 4, 2026
@ntsekouras ntsekouras added Needs Design Feedback Needs general design feedback. [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Sep 4, 2026
@github-actions github-actions Bot added the [Package] Fields /packages/fields label Sep 4, 2026
@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 2a66c39b-042f-462b-88a4-44878d478d66

📥 Commits

Reviewing files that changed from the base of the PR and between da1ea9f and 72f9a0a.

📒 Files selected for processing (1)
  • packages/fields/CHANGELOG.md

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change renders excerpt fields inline for default post forms and blocks, updates excerpt value handling, reduces textarea heights, and changes PHP and end-to-end tests to verify direct textbox interaction.

Changes

Inline summary fields

Layer / File(s) Summary
Post-type layout configuration
lib/compat/wordpress-7.2/view-config-api.php, phpunit/view-config-api-test.php
Default-form post types, wp_block, and wp_template use regular layouts for excerpt and description fields. PHPUnit assertions verify the excerpt layout and label position.
Field rendering and controls
packages/fields/src/fields/excerpt/index.tsx, packages/fields/src/fields/description/index.tsx, packages/fields/src/fields/pattern-description/index.tsx, packages/fields/CHANGELOG.md
The excerpt field supports string and raw values, renders no content when empty, and uses two-row textareas. Description and pattern description textareas also use two rows. The changelog documents these updates.
Inline field end-to-end coverage
test/e2e/specs/editor/various/post-summary-dataform/post-summary.spec.js, test/e2e/specs/editor/various/post-summary-dataform/sidebar.spec.js
Tests locate Description and Excerpt textboxes directly and verify editing, persistence, panel preferences, and visibility.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 72f9a

This update documents the inline summary-field behavior without introducing implementation changes in the reviewed increment. No merge-readiness risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: excerpt and description fields now use the regular layout in the DataForm post summary.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 7 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fields-excerpt-description-regular-layout

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 4, 2026 •

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: ntsekouras <ntsekouras@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

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

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric df15538 trunk % Change
timeToFirstByte 52 ms +11.06% -4.62% 51.85 ms +8.29% -6.56% 0.29%
largestContentfulPaint 88 ms +4.55% -4.55% 88 ms +2.27% -4.55% 0%
lcpMinusTtfb 32.95 ms +18.36% -4.86% 31.95 ms +25.2% -4.85% 3.13%
wpBeforeTemplate 25.37 ms +16.12% -8.44% 24.97 ms +14.34% -7.89% 1.6%
wpTemplate 22.95 ms +4.31% -2.7% 22.4 ms +3.21% -4.55% 2.46%
wpTotal 48.54 ms +8.55% -5.58% 47.95 ms +7.13% -6.36% 1.23%
wpMemoryUsage 7.54 MB +0% -0% 7.50 MB +0% -0% 0.54%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric df15538 trunk % Change
timeToFirstByte 41.9 ms +11.1% -1.67% 42.25 ms +11.12% -4.38% -0.83%
largestContentfulPaint 88 ms +4.55% -0% 88 ms +4.55% -4.55% 0%
lcpMinusTtfb 45.85 ms +1.53% -3.05% 44.25 ms +3.28% -2.71% 3.62%
wpBeforeTemplate 21.26 ms +17.17% -2.16% 21.23 ms +11.82% -3.01% 0.14%
wpTemplate 17.73 ms +3.1% -3.38% 17.44 ms +2.92% -3.1% 1.66%
wpTotal 39.02 ms +11.17% -2.08% 38.96 ms +10.04% -3.44% 0.15%
wpMemoryUsage 6.16 MB +0% -0% 6.12 MB +0% -0% 0.68%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric df15538 trunk % Change
mediaProcessingJpeg 412.78 ms +1.51% -0.92% 418.29 ms +0.68% -0.94% -1.32%
mediaProcessingAvif 6369.3 ms +0.1% -0.19% 6368.66 ms +0.19% -0.1% 0.01%
mediaProcessingJpegToAvif 4447.9 ms +0.38% -0.12% 4453.71 ms +0.13% -0.09% -0.13%

media-upload

Metric df15538 trunk % Change
jpegUploadProcessing 1438.19 ms +1.62% -0.65% 1455.47 ms +0.89% -0.83% -1.19%
pngUploadProcessing 206.84 ms +2.21% -1.23% 220.49 ms +2.91% -3.49% -6.19%
largeJpegUploadProcessing 1420.94 ms +0.51% -0.23% 1431.84 ms +1.38% -1.02% -0.76%
multipleImageUploadProcessing 1604.36 ms +30.94% -0.27% 2042.91 ms +2.21% -21.96% -21.47%

post-editor

Metric df15538 trunk % Change
serverResponse 537.09 ms +4.07% -4.49% 544.85 ms +5.06% -1.64% -1.42%
firstPaint 263.67 ms +5.23% -11.55% 240.38 ms +15.69% -4.73% 9.69%
domContentLoaded 1309.67 ms +3.2% -0.44% 1337.21 ms +2.34% -1.08% -2.06%
loaded 1310.95 ms +3.21% -0.43% 1338.7 ms +2.34% -1.09% -2.07%
firstContentfulPaint 433.27 ms +4.08% -5.15% 444.85 ms +1.29% -1.41% -2.6%
firstBlock 3625.88 ms +0.69% -1.12% 3682.49 ms +0.42% -0.55% -1.54%
type 21.04 ms +6.8% -19.58% 19.66 ms +8.19% -16.99% 7.02%
typeWithoutInspector 20.96 ms +11.45% -19.32% 20.97 ms +7.63% -19.79% -0.05%
typeWithTopToolbar 22.04 ms +8.8% -11.8% 24.4 ms +6.52% -12.25% -9.67%
typeContainer 9.48 ms +6.96% -6.12% 9.73 ms +10.48% -11.92% -2.57%
focus 82.4 ms +4.88% -9.28% 87.71 ms +11.47% -15.44% -6.05%
firstFocus 176.88 ms +0% -0% 185 ms +0% -0% -4.39%
selectAll 630.75 ms +2.92% -4.18% 591.99 ms +7.27% -0.36% 6.55%
listViewOpen 73.48 ms +8.75% -12.04% 70 ms +10.4% -2.3% 4.97%
inserterOpen 24.75 ms +4.16% -9.82% 23.66 ms +5.28% -6.68% 4.61%
inserterHover 3.39 ms +8.85% -11.5% 3.54 ms +11.02% -7.63% -4.24%
inserterSearch 8.17 ms +14.08% -9.42% 8.86 ms +12.87% -16.59% -7.79%
loadPatterns 654.55 ms +1.19% -3.46% 642.15 ms +3.18% -1.49% 1.93%
wpTotal 527.55 ms +4.06% -4.62% 534.8 ms +5.18% -1.67% -1.36%
wpMemoryUsage 13.14 MB +0% -0% 13.10 MB +0% -0% 0.26%
wpDbQueries 54 +0% -1.85% 54 +0% -1.85% 0%

site-editor

Metric df15538 trunk % Change
serverResponse 540.71 ms +5.17% -2.87% 541.02 ms +3.44% -2.03% -0.06%
firstPaint 260.08 ms +7.42% -9.24% 240.41 ms +18.17% -0.39% 8.18%
domContentLoaded 1434.83 ms +1.63% -0.9% 1405.23 ms +0.95% -0.93% 2.11%
loaded 1436.21 ms +1.63% -0.89% 1406.42 ms +0.96% -0.93% 2.12%
firstContentfulPaint 447.3 ms +3.81% -0.87% 444.29 ms +0.45% -2.15% 0.68%
firstBlock 4561.61 ms +0.46% -1.46% 4479.74 ms +0.7% -0.99% 1.83%
type 19.91 ms +16.47% -19.54% 20.41 ms +10.49% -18.37% -2.45%
navigate 104.09 ms +9.08% -4.81% 100.97 ms +13.84% -3.5% 3.09%
loadPatterns 1308.52 ms +16.57% -2.87% 1402.01 ms +16.23% -5.97% -6.67%
loadPages 1262.16 ms +7.42% -5.81% 1189.19 ms +4.36% -2.35% 6.14%
wpTotal 530.87 ms +5.24% -2.8% 531.21 ms +3.5% -2.08% -0.06%
wpMemoryUsage 12.10 MB +0% -0% 12.05 MB +0% -0% 0.35%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

72f9a0a Run

🏁 Flaky tests

Show the failures

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.

should override reset styles and library styles in /test/e2e/specs/site-editor/styles.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.get: socket hang up
Call log:
  - → GET http://localhost:8889/wp-admin/themes.php
    - user-agent: Playwright/1.62.1 (x64; ubuntu 24.04) node/20.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_23778236db82f19306f247e20a353a99=admin%7C1788695252%7C1lAmDMcdC1Uxq3giTx735xjrdmhklri7W96DLzKO9n8%7Cc870ded9a02afb7e90f1034b65f940ff287fb2a00aca9c49ee55308a3685d7d1; wordpress_logged_in_23778236db82f19306f247e20a353a99=admin%7C1788695252%7C1lAmDMcdC1Uxq3giTx735xjrdmhklri7W96DLzKO9n8%7Cb623b42bcb65786ebe62c46aeb7e3d837c96dd3e561278b9dfdc873ba1116dcd; wp-settings-time-1=1788523388

    at RequestUtils.activateTheme (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/themes.ts:10:36)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/styles.spec.js:17:22

72f9a0a Run

@jasmussen

Copy link
Copy Markdown
Contributor

Thanks for trying this. When he's able to catch up, I'd love @jameskoster's thoughts on this.

Two things in the meantime:

  • I see a scrollbar. Can the excerpt field just grow vertically rather than scroll?
  • We should not add the big blue help text link that wasn't there before. If we have to add information in this space, we can explore an InfoTip.

@ntsekouras ntsekouras closed this Sep 8, 2026
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 Needs Design Feedback Needs general design feedback. [Package] Fields /packages/fields [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants