Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages: Add "Set as posts page" action #67650

Merged
merged 18 commits into from
Dec 13, 2024
Merged

Conversation

mikachan
Copy link
Member

@mikachan mikachan commented Dec 5, 2024

What?

#65426 added the Set as Homepage action to Pages, so this is a follow-up which adds a "Set as posts page" action as well.

It also includes a few other smaller tweaks:

  • Ensures the "Move to trash" action is always at the bottom of the actions list
  • Moves getItemTitle to its own file as it's now being used in two actions
  • Removes the use of saveEditedEntityRecord in the "Set as homepage" and "Set as posts page" actions so it's more consistent with other similar use cases

Why?

Addresses part of the second task in this comment.

This means that more of the homepage display controls from Settings -> Reading are replicated within the Editor, which hopefully makes changing them easier from within the Editor.

How?

By adding one new action, "Set as posts page".

Testing Instructions

  1. Ensure you have not yet set a homepage or a posts page
  2. Go to Editor -> Pages
  3. Select the Actions menu
  4. Select 'Set as posts page'
  5. Ensure the selected page is set as the posts page

Screenshots or screencast

Both "set as" actions:
image

Posts page confirm modal:
image

@mikachan mikachan added [Type] Enhancement A suggestion for improvement. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Feature] DataViews Work surrounding upgrading and evolving views in the site editor and beyond labels Dec 5, 2024
@mikachan mikachan requested a review from jameskoster December 5, 2024 16:51
@mikachan mikachan self-assigned this Dec 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

Size Change: +209 B (+0.01%)

Total Size: 1.83 MB

Filename Size Change
build/components/index.min.js 228 kB -9 B (0%)
build/editor/index.min.js 115 kB +218 B (+0.19%)
ℹ️ View Unchanged
Filename Size
build-module/a11y/index.min.js 482 B
build-module/block-library/file/view.min.js 447 B
build-module/block-library/form/view.min.js 533 B
build-module/block-library/image/view.min.js 1.77 kB
build-module/block-library/navigation/view.min.js 1.16 kB
build-module/block-library/query/view.min.js 742 B
build-module/block-library/search/view.min.js 616 B
build-module/interactivity-router/index.min.js 3.04 kB
build-module/interactivity/debug.min.js 17.2 kB
build-module/interactivity/index.min.js 13.6 kB
build/a11y/index.min.js 952 B
build/annotations/index.min.js 2.26 kB
build/api-fetch/index.min.js 2.32 kB
build/autop/index.min.js 2.12 kB
build/blob/index.min.js 579 B
build/block-directory/index.min.js 7.26 kB
build/block-directory/style-rtl.css 1 kB
build/block-directory/style.css 1 kB
build/block-editor/content-rtl.css 4.47 kB
build/block-editor/content.css 4.46 kB
build/block-editor/default-editor-styles-rtl.css 394 B
build/block-editor/default-editor-styles.css 394 B
build/block-editor/index.min.js 259 kB
build/block-editor/style-rtl.css 15.7 kB
build/block-editor/style.css 15.7 kB
build/block-library/blocks/archives/editor-rtl.css 84 B
build/block-library/blocks/archives/editor.css 83 B
build/block-library/blocks/archives/style-rtl.css 90 B
build/block-library/blocks/archives/style.css 90 B
build/block-library/blocks/audio/editor-rtl.css 149 B
build/block-library/blocks/audio/editor.css 151 B
build/block-library/blocks/audio/style-rtl.css 132 B
build/block-library/blocks/audio/style.css 132 B
build/block-library/blocks/audio/theme-rtl.css 134 B
build/block-library/blocks/audio/theme.css 134 B
build/block-library/blocks/avatar/editor-rtl.css 115 B
build/block-library/blocks/avatar/editor.css 115 B
build/block-library/blocks/avatar/style-rtl.css 104 B
build/block-library/blocks/avatar/style.css 104 B
build/block-library/blocks/button/editor-rtl.css 265 B
build/block-library/blocks/button/editor.css 265 B
build/block-library/blocks/button/style-rtl.css 555 B
build/block-library/blocks/button/style.css 555 B
build/block-library/blocks/buttons/editor-rtl.css 291 B
build/block-library/blocks/buttons/editor.css 291 B
build/block-library/blocks/buttons/style-rtl.css 345 B
build/block-library/blocks/buttons/style.css 345 B
build/block-library/blocks/calendar/style-rtl.css 240 B
build/block-library/blocks/calendar/style.css 240 B
build/block-library/blocks/categories/editor-rtl.css 132 B
build/block-library/blocks/categories/editor.css 131 B
build/block-library/blocks/categories/style-rtl.css 152 B
build/block-library/blocks/categories/style.css 152 B
build/block-library/blocks/code/editor-rtl.css 53 B
build/block-library/blocks/code/editor.css 53 B
build/block-library/blocks/code/style-rtl.css 139 B
build/block-library/blocks/code/style.css 139 B
build/block-library/blocks/code/theme-rtl.css 122 B
build/block-library/blocks/code/theme.css 122 B
build/block-library/blocks/columns/editor-rtl.css 108 B
build/block-library/blocks/columns/editor.css 108 B
build/block-library/blocks/columns/style-rtl.css 420 B
build/block-library/blocks/columns/style.css 420 B
build/block-library/blocks/comment-author-avatar/editor-rtl.css 124 B
build/block-library/blocks/comment-author-avatar/editor.css 124 B
build/block-library/blocks/comment-author-name/style-rtl.css 72 B
build/block-library/blocks/comment-author-name/style.css 72 B
build/block-library/blocks/comment-content/style-rtl.css 120 B
build/block-library/blocks/comment-content/style.css 120 B
build/block-library/blocks/comment-date/style-rtl.css 65 B
build/block-library/blocks/comment-date/style.css 65 B
build/block-library/blocks/comment-edit-link/style-rtl.css 70 B
build/block-library/blocks/comment-edit-link/style.css 70 B
build/block-library/blocks/comment-reply-link/style-rtl.css 71 B
build/block-library/blocks/comment-reply-link/style.css 71 B
build/block-library/blocks/comment-template/style-rtl.css 200 B
build/block-library/blocks/comment-template/style.css 199 B
build/block-library/blocks/comments-pagination-numbers/editor-rtl.css 122 B
build/block-library/blocks/comments-pagination-numbers/editor.css 121 B
build/block-library/blocks/comments-pagination/editor-rtl.css 238 B
build/block-library/blocks/comments-pagination/editor.css 231 B
build/block-library/blocks/comments-pagination/style-rtl.css 245 B
build/block-library/blocks/comments-pagination/style.css 241 B
build/block-library/blocks/comments-title/editor-rtl.css 75 B
build/block-library/blocks/comments-title/editor.css 75 B
build/block-library/blocks/comments/editor-rtl.css 842 B
build/block-library/blocks/comments/editor.css 842 B
build/block-library/blocks/comments/style-rtl.css 637 B
build/block-library/blocks/comments/style.css 637 B
build/block-library/blocks/cover/editor-rtl.css 631 B
build/block-library/blocks/cover/editor.css 631 B
build/block-library/blocks/cover/style-rtl.css 1.7 kB
build/block-library/blocks/cover/style.css 1.69 kB
build/block-library/blocks/details/editor-rtl.css 65 B
build/block-library/blocks/details/editor.css 65 B
build/block-library/blocks/details/style-rtl.css 86 B
build/block-library/blocks/details/style.css 86 B
build/block-library/blocks/embed/editor-rtl.css 331 B
build/block-library/blocks/embed/editor.css 331 B
build/block-library/blocks/embed/style-rtl.css 419 B
build/block-library/blocks/embed/style.css 419 B
build/block-library/blocks/embed/theme-rtl.css 133 B
build/block-library/blocks/embed/theme.css 133 B
build/block-library/blocks/file/editor-rtl.css 326 B
build/block-library/blocks/file/editor.css 326 B
build/block-library/blocks/file/style-rtl.css 278 B
build/block-library/blocks/file/style.css 279 B
build/block-library/blocks/footnotes/style-rtl.css 198 B
build/block-library/blocks/footnotes/style.css 197 B
build/block-library/blocks/form-input/editor-rtl.css 229 B
build/block-library/blocks/form-input/editor.css 229 B
build/block-library/blocks/form-input/style-rtl.css 357 B
build/block-library/blocks/form-input/style.css 357 B
build/block-library/blocks/form-submission-notification/editor-rtl.css 344 B
build/block-library/blocks/form-submission-notification/editor.css 341 B
build/block-library/blocks/form-submit-button/style-rtl.css 69 B
build/block-library/blocks/form-submit-button/style.css 69 B
build/block-library/blocks/freeform/editor-rtl.css 2.6 kB
build/block-library/blocks/freeform/editor.css 2.6 kB
build/block-library/blocks/gallery/editor-rtl.css 946 B
build/block-library/blocks/gallery/editor.css 951 B
build/block-library/blocks/gallery/style-rtl.css 1.83 kB
build/block-library/blocks/gallery/style.css 1.82 kB
build/block-library/blocks/gallery/theme-rtl.css 108 B
build/block-library/blocks/gallery/theme.css 108 B
build/block-library/blocks/group/editor-rtl.css 334 B
build/block-library/blocks/group/editor.css 334 B
build/block-library/blocks/group/style-rtl.css 103 B
build/block-library/blocks/group/style.css 103 B
build/block-library/blocks/group/theme-rtl.css 79 B
build/block-library/blocks/group/theme.css 79 B
build/block-library/blocks/heading/style-rtl.css 188 B
build/block-library/blocks/heading/style.css 188 B
build/block-library/blocks/html/editor-rtl.css 346 B
build/block-library/blocks/html/editor.css 347 B
build/block-library/blocks/image/editor-rtl.css 799 B
build/block-library/blocks/image/editor.css 799 B
build/block-library/blocks/image/style-rtl.css 1.6 kB
build/block-library/blocks/image/style.css 1.59 kB
build/block-library/blocks/image/theme-rtl.css 137 B
build/block-library/blocks/image/theme.css 137 B
build/block-library/blocks/latest-comments/style-rtl.css 355 B
build/block-library/blocks/latest-comments/style.css 354 B
build/block-library/blocks/latest-posts/editor-rtl.css 139 B
build/block-library/blocks/latest-posts/editor.css 138 B
build/block-library/blocks/latest-posts/style-rtl.css 520 B
build/block-library/blocks/latest-posts/style.css 520 B
build/block-library/blocks/list/style-rtl.css 107 B
build/block-library/blocks/list/style.css 107 B
build/block-library/blocks/loginout/style-rtl.css 61 B
build/block-library/blocks/loginout/style.css 61 B
build/block-library/blocks/media-text/editor-rtl.css 321 B
build/block-library/blocks/media-text/editor.css 320 B
build/block-library/blocks/media-text/style-rtl.css 552 B
build/block-library/blocks/media-text/style.css 550 B
build/block-library/blocks/more/editor-rtl.css 427 B
build/block-library/blocks/more/editor.css 427 B
build/block-library/blocks/navigation-link/editor-rtl.css 644 B
build/block-library/blocks/navigation-link/editor.css 645 B
build/block-library/blocks/navigation-link/style-rtl.css 192 B
build/block-library/blocks/navigation-link/style.css 191 B
build/block-library/blocks/navigation-submenu/editor-rtl.css 295 B
build/block-library/blocks/navigation-submenu/editor.css 294 B
build/block-library/blocks/navigation/editor-rtl.css 2.2 kB
build/block-library/blocks/navigation/editor.css 2.2 kB
build/block-library/blocks/navigation/style-rtl.css 2.24 kB
build/block-library/blocks/navigation/style.css 2.23 kB
build/block-library/blocks/nextpage/editor-rtl.css 392 B
build/block-library/blocks/nextpage/editor.css 392 B
build/block-library/blocks/page-list/editor-rtl.css 378 B
build/block-library/blocks/page-list/editor.css 378 B
build/block-library/blocks/page-list/style-rtl.css 192 B
build/block-library/blocks/page-list/style.css 192 B
build/block-library/blocks/paragraph/editor-rtl.css 236 B
build/block-library/blocks/paragraph/editor.css 236 B
build/block-library/blocks/paragraph/style-rtl.css 341 B
build/block-library/blocks/paragraph/style.css 340 B
build/block-library/blocks/post-author-biography/style-rtl.css 74 B
build/block-library/blocks/post-author-biography/style.css 74 B
build/block-library/blocks/post-author-name/style-rtl.css 69 B
build/block-library/blocks/post-author-name/style.css 69 B
build/block-library/blocks/post-author/editor-rtl.css 107 B
build/block-library/blocks/post-author/editor.css 107 B
build/block-library/blocks/post-author/style-rtl.css 188 B
build/block-library/blocks/post-author/style.css 189 B
build/block-library/blocks/post-comments-form/editor-rtl.css 96 B
build/block-library/blocks/post-comments-form/editor.css 96 B
build/block-library/blocks/post-comments-form/style-rtl.css 527 B
build/block-library/blocks/post-comments-form/style.css 528 B
build/block-library/blocks/post-content/style-rtl.css 61 B
build/block-library/blocks/post-content/style.css 61 B
build/block-library/blocks/post-date/style-rtl.css 62 B
build/block-library/blocks/post-date/style.css 62 B
build/block-library/blocks/post-excerpt/editor-rtl.css 71 B
build/block-library/blocks/post-excerpt/editor.css 71 B
build/block-library/blocks/post-excerpt/style-rtl.css 155 B
build/block-library/blocks/post-excerpt/style.css 155 B
build/block-library/blocks/post-featured-image/editor-rtl.css 729 B
build/block-library/blocks/post-featured-image/editor.css 726 B
build/block-library/blocks/post-featured-image/style-rtl.css 347 B
build/block-library/blocks/post-featured-image/style.css 347 B
build/block-library/blocks/post-navigation-link/style-rtl.css 215 B
build/block-library/blocks/post-navigation-link/style.css 214 B
build/block-library/blocks/post-template/editor-rtl.css 99 B
build/block-library/blocks/post-template/editor.css 98 B
build/block-library/blocks/post-template/style-rtl.css 399 B
build/block-library/blocks/post-template/style.css 398 B
build/block-library/blocks/post-terms/style-rtl.css 96 B
build/block-library/blocks/post-terms/style.css 96 B
build/block-library/blocks/post-time-to-read/style-rtl.css 70 B
build/block-library/blocks/post-time-to-read/style.css 70 B
build/block-library/blocks/post-title/style-rtl.css 162 B
build/block-library/blocks/post-title/style.css 162 B
build/block-library/blocks/preformatted/style-rtl.css 125 B
build/block-library/blocks/preformatted/style.css 125 B
build/block-library/blocks/pullquote/editor-rtl.css 134 B
build/block-library/blocks/pullquote/editor.css 134 B
build/block-library/blocks/pullquote/style-rtl.css 351 B
build/block-library/blocks/pullquote/style.css 350 B
build/block-library/blocks/pullquote/theme-rtl.css 167 B
build/block-library/blocks/pullquote/theme.css 167 B
build/block-library/blocks/query-pagination-numbers/editor-rtl.css 121 B
build/block-library/blocks/query-pagination-numbers/editor.css 118 B
build/block-library/blocks/query-pagination/editor-rtl.css 154 B
build/block-library/blocks/query-pagination/editor.css 154 B
build/block-library/blocks/query-pagination/style-rtl.css 237 B
build/block-library/blocks/query-pagination/style.css 237 B
build/block-library/blocks/query-title/style-rtl.css 64 B
build/block-library/blocks/query-title/style.css 64 B
build/block-library/blocks/query/editor-rtl.css 527 B
build/block-library/blocks/query/editor.css 527 B
build/block-library/blocks/quote/style-rtl.css 238 B
build/block-library/blocks/quote/style.css 238 B
build/block-library/blocks/quote/theme-rtl.css 233 B
build/block-library/blocks/quote/theme.css 236 B
build/block-library/blocks/read-more/style-rtl.css 138 B
build/block-library/blocks/read-more/style.css 138 B
build/block-library/blocks/rss/editor-rtl.css 101 B
build/block-library/blocks/rss/editor.css 101 B
build/block-library/blocks/rss/style-rtl.css 288 B
build/block-library/blocks/rss/style.css 287 B
build/block-library/blocks/search/editor-rtl.css 199 B
build/block-library/blocks/search/editor.css 199 B
build/block-library/blocks/search/style-rtl.css 660 B
build/block-library/blocks/search/style.css 658 B
build/block-library/blocks/search/theme-rtl.css 113 B
build/block-library/blocks/search/theme.css 113 B
build/block-library/blocks/separator/editor-rtl.css 100 B
build/block-library/blocks/separator/editor.css 100 B
build/block-library/blocks/separator/style-rtl.css 248 B
build/block-library/blocks/separator/style.css 248 B
build/block-library/blocks/separator/theme-rtl.css 195 B
build/block-library/blocks/separator/theme.css 195 B
build/block-library/blocks/shortcode/editor-rtl.css 286 B
build/block-library/blocks/shortcode/editor.css 286 B
build/block-library/blocks/site-logo/editor-rtl.css 806 B
build/block-library/blocks/site-logo/editor.css 803 B
build/block-library/blocks/site-logo/style-rtl.css 218 B
build/block-library/blocks/site-logo/style.css 218 B
build/block-library/blocks/site-tagline/editor-rtl.css 87 B
build/block-library/blocks/site-tagline/editor.css 87 B
build/block-library/blocks/site-tagline/style-rtl.css 65 B
build/block-library/blocks/site-tagline/style.css 65 B
build/block-library/blocks/site-title/editor-rtl.css 85 B
build/block-library/blocks/site-title/editor.css 85 B
build/block-library/blocks/site-title/style-rtl.css 143 B
build/block-library/blocks/site-title/style.css 143 B
build/block-library/blocks/social-link/editor-rtl.css 309 B
build/block-library/blocks/social-link/editor.css 309 B
build/block-library/blocks/social-links/editor-rtl.css 727 B
build/block-library/blocks/social-links/editor.css 724 B
build/block-library/blocks/social-links/style-rtl.css 1.51 kB
build/block-library/blocks/social-links/style.css 1.51 kB
build/block-library/blocks/spacer/editor-rtl.css 346 B
build/block-library/blocks/spacer/editor.css 346 B
build/block-library/blocks/spacer/style-rtl.css 48 B
build/block-library/blocks/spacer/style.css 48 B
build/block-library/blocks/table-of-contents/style-rtl.css 83 B
build/block-library/blocks/table-of-contents/style.css 83 B
build/block-library/blocks/table/editor-rtl.css 394 B
build/block-library/blocks/table/editor.css 394 B
build/block-library/blocks/table/style-rtl.css 640 B
build/block-library/blocks/table/style.css 639 B
build/block-library/blocks/table/theme-rtl.css 152 B
build/block-library/blocks/table/theme.css 152 B
build/block-library/blocks/tag-cloud/editor-rtl.css 144 B
build/block-library/blocks/tag-cloud/editor.css 144 B
build/block-library/blocks/tag-cloud/style-rtl.css 266 B
build/block-library/blocks/tag-cloud/style.css 265 B
build/block-library/blocks/template-part/editor-rtl.css 368 B
build/block-library/blocks/template-part/editor.css 368 B
build/block-library/blocks/template-part/theme-rtl.css 113 B
build/block-library/blocks/template-part/theme.css 113 B
build/block-library/blocks/term-description/style-rtl.css 126 B
build/block-library/blocks/term-description/style.css 126 B
build/block-library/blocks/text-columns/editor-rtl.css 95 B
build/block-library/blocks/text-columns/editor.css 95 B
build/block-library/blocks/text-columns/style-rtl.css 165 B
build/block-library/blocks/text-columns/style.css 165 B
build/block-library/blocks/verse/style-rtl.css 98 B
build/block-library/blocks/verse/style.css 98 B
build/block-library/blocks/video/editor-rtl.css 441 B
build/block-library/blocks/video/editor.css 442 B
build/block-library/blocks/video/style-rtl.css 192 B
build/block-library/blocks/video/style.css 192 B
build/block-library/blocks/video/theme-rtl.css 134 B
build/block-library/blocks/video/theme.css 134 B
build/block-library/classic-rtl.css 179 B
build/block-library/classic.css 179 B
build/block-library/common-rtl.css 1.08 kB
build/block-library/common.css 1.08 kB
build/block-library/editor-elements-rtl.css 75 B
build/block-library/editor-elements.css 75 B
build/block-library/editor-rtl.css 11.8 kB
build/block-library/editor.css 11.8 kB
build/block-library/elements-rtl.css 54 B
build/block-library/elements.css 54 B
build/block-library/index.min.js 222 kB
build/block-library/reset-rtl.css 472 B
build/block-library/reset.css 472 B
build/block-library/style-rtl.css 15 kB
build/block-library/style.css 15 kB
build/block-library/theme-rtl.css 708 B
build/block-library/theme.css 712 B
build/block-serialization-default-parser/index.min.js 1.12 kB
build/block-serialization-spec-parser/index.min.js 2.87 kB
build/blocks/index.min.js 53 kB
build/commands/index.min.js 16.1 kB
build/commands/style-rtl.css 955 B
build/commands/style.css 952 B
build/components/style-rtl.css 12.4 kB
build/components/style.css 12.4 kB
build/compose/index.min.js 12.7 kB
build/core-commands/index.min.js 3.09 kB
build/core-data/index.min.js 74.3 kB
build/customize-widgets/index.min.js 11 kB
build/customize-widgets/style-rtl.css 1.35 kB
build/customize-widgets/style.css 1.35 kB
build/data-controls/index.min.js 641 B
build/data/index.min.js 8.69 kB
build/date/index.min.js 18 kB
build/deprecated/index.min.js 458 B
build/dom-ready/index.min.js 325 B
build/dom/index.min.js 4.66 kB
build/edit-post/classic-rtl.css 578 B
build/edit-post/classic.css 580 B
build/edit-post/index.min.js 13.4 kB
build/edit-post/style-rtl.css 2.75 kB
build/edit-post/style.css 2.75 kB
build/edit-site/index.min.js 221 kB
build/edit-site/posts-rtl.css 7.46 kB
build/edit-site/posts.css 7.46 kB
build/edit-site/style-rtl.css 13.6 kB
build/edit-site/style.css 13.6 kB
build/edit-widgets/index.min.js 17.7 kB
build/edit-widgets/style-rtl.css 4.09 kB
build/edit-widgets/style.css 4.09 kB
build/editor/style-rtl.css 9.32 kB
build/editor/style.css 9.32 kB
build/element/index.min.js 4.82 kB
build/escape-html/index.min.js 537 B
build/format-library/index.min.js 8.05 kB
build/format-library/style-rtl.css 476 B
build/format-library/style.css 476 B
build/hooks/index.min.js 1.65 kB
build/html-entities/index.min.js 445 B
build/i18n/index.min.js 3.58 kB
build/is-shallow-equal/index.min.js 526 B
build/keyboard-shortcuts/index.min.js 1.31 kB
build/keycodes/index.min.js 1.46 kB
build/list-reusable-blocks/index.min.js 2.13 kB
build/list-reusable-blocks/style-rtl.css 852 B
build/list-reusable-blocks/style.css 852 B
build/media-utils/index.min.js 3.58 kB
build/notices/index.min.js 946 B
build/nux/index.min.js 1.62 kB
build/nux/style-rtl.css 749 B
build/nux/style.css 745 B
build/patterns/index.min.js 7.37 kB
build/patterns/style-rtl.css 687 B
build/patterns/style.css 685 B
build/plugins/index.min.js 1.86 kB
build/preferences-persistence/index.min.js 2.06 kB
build/preferences/index.min.js 2.9 kB
build/preferences/style-rtl.css 554 B
build/preferences/style.css 554 B
build/primitives/index.min.js 829 B
build/priority-queue/index.min.js 1.54 kB
build/private-apis/index.min.js 972 B
build/react-i18n/index.min.js 630 B
build/react-refresh-entry/index.min.js 9.47 kB
build/react-refresh-runtime/index.min.js 6.76 kB
build/redux-routine/index.min.js 2.7 kB
build/reusable-blocks/index.min.js 2.55 kB
build/reusable-blocks/style-rtl.css 256 B
build/reusable-blocks/style.css 256 B
build/rich-text/index.min.js 10.3 kB
build/router/index.min.js 5.42 kB
build/server-side-render/index.min.js 1.94 kB
build/shortcode/index.min.js 1.4 kB
build/style-engine/index.min.js 2.04 kB
build/token-list/index.min.js 581 B
build/url/index.min.js 3.9 kB
build/vendors/react-dom.min.js 41.7 kB
build/vendors/react-jsx-runtime.min.js 556 B
build/vendors/react.min.js 4.02 kB
build/viewport/index.min.js 965 B
build/vips/index.min.js 36.2 kB
build/warning/index.min.js 250 B
build/widgets/index.min.js 7.16 kB
build/widgets/style-rtl.css 1.16 kB
build/widgets/style.css 1.16 kB
build/wordcount/index.min.js 1.03 kB

compressed-size-action

Copy link

github-actions bot commented Dec 5, 2024

Flaky tests detected in 35cea15.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12294916692
📝 Reported issues:

@jameskoster
Copy link
Contributor

Nice :)

I miss an option to set the posts page as the homepage, but I appreciate we can't do that yet because it means the 'page' would vanish from the data view.

More importantly for now... If you reset the homepage when a posts page exists, the modal doesn't inform the user about which page will become the homepage. This feels like an important detail to communicate. I noticed that performing this action creates this configuration in reading settings:

Screenshot 2024-12-06 at 14 17 27

Unless I'm mistaken, there aren't any practical scenarios where you'd want to configure your pages this way? I wonder... do we need this 'Reset homepage' action? If you want to change the homepage it's easy to perform 'Set as homepage' on another page. There's also something a bit uncanny about the 'Reset homepage' labelling which we can solve by removing that action. What do you think?

One other tiny detail; can we adjust the order of actions so that 'Move to trash' is always last?

We may need to follow up to add some separation in this menu, it's getting quite long. cc @fcoveram as you've been thinking about that.

Copy link

github-actions bot commented Dec 6, 2024

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: mikachan <mikachan@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: oandregal <oandregal@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: paaljoachim <paaljoachim@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>

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

@mikachan
Copy link
Member Author

mikachan commented Dec 6, 2024

Unless I'm mistaken, there aren't any practical scenarios where you'd want to configure your pages this way? I wonder... do we need this 'Reset homepage' action? If you want to change the homepage it's easy to perform 'Set as homepage' on another page. There's also something a bit uncanny about the 'Reset homepage' labelling which we can solve by removing that action. What do you think?

I agree, maybe we don't need the 'Reset homepage' option at all, as it does feel a bit strange. I started with 'Unset homepage' (and 'Unset posts page'), but the 'unset' wording didn't feel right either.

Or, perhaps instead of "Reset homepage", the option should be along the lines of "Reset homepage to latest posts", and this option both unsets the static homepage and posts pages and then sets the latest posts as the page on front. This could be explained to the user in a notice in the confirmation modal.

Another option could be to have the "Your latest posts" option separate from these actions, as a toggle somewhere outside of the pages table.

One other tiny detail; can we adjust the order of actions so that 'Move to trash' is always last?

Yes! Done in 2cc8058.

@jameskoster
Copy link
Contributor

Yeah the whole reset homepage flow needs a bit more thought imo, probably worth exploring that one separately, but I'm not sure it's really needed.

To be honest I'm on the fence about 'Reset posts page' as well. This flow is essentially serving a scenario where the user no longer wants a blog on their site, but in that case I suspect that simply deleting the page is more intuitive. I'd welcome more feedback from @gutenberg-design on that.

@jameskoster jameskoster requested a review from a team December 9, 2024 10:42
@jasmussen
Copy link
Contributor

Indeed, setting seems the important action. Resetting seems a bit riskier in terms of having as a feature there. Here's what happens. I take an existing page, and set it as posts page:

Screenshot 2024-12-09 at 11 46 07

Now it's a posts page:

Screenshot 2024-12-09 at 11 46 17

Here's resetting the posts page:

Screenshot 2024-12-09 at 11 46 22

On one hand, this works sort of as expected, and with improved confirmation text, this may be okay to ship as is, because it mostly works and when you can set a page, in context it feels reasonable to also unset it.

But the larger question really is the philosophical one: setting a posts page is really confusing. In the example I shared above, I set a fully populated section of my site as a "posts" page, which in effect means the content on that page is now "gone". It's hidden by the fact that the page serves only as a URL or slug to where your posts will show up, but the entire contents are now replaced by the posts template. This is how WordPress works, and has worked for a while, and at least the immediate preview frame on the right helps make it clear what happens: perhaps a "undo" snackbar can help here?

The alternative is to rethink how posts pages work, at least in the site editor. The old approach can still work, but as a thought experiment: what if you only had "Set as homepage" as an option, not "posts page", and if you wanted to create a posts page, you could choose it in a dropdown on this modal?
Screenshot 2024-12-09 at 11 51 24

Page/Homepage/Posts Page

In effect, you'd create a posts page, literally: a new page for that purpose, so you'd never have the confusion of seeing an empty page, or a page full of content, get replaced by a template. And that would be how you unset it too: delete the posts page.

What do you think?

  • Remove set and unset posts pages, keep only homepage, and explore setting the posts page as an action in the "New Page" dialog? (Noting, the dropdown option would only be there if you didn't already have a posts or homepage set).
  • Keep this as is, but update the text in the confirm modal.

@paaljoachim
Copy link
Contributor

Currently in the Site Editor it looks like this:

Screenshot 2024-12-09 at 06 11 46

A Posts Page and a Homepage has been defined.

This means that this PR will add inside the 3 dots contextual drop down menu.
Set as homepage
Set as posts page

That seems natural.
I will assume that also the WP Settings -> Reading "Your homepage displays" will also be adjusted at the same time.

In addition one can also reset the homepage and posts page.

A few things....
Can one set a page as homepage and posts page? What happens if one tries this. Based on the WP reading settings I noticed this warning: "Warning: these pages should not be the same!"
As a user I might define the homepage to also be the posts page because I want posts to be on the front/homepage.

Currently in the Reading Settings one has to click to define Your homepage displays - Your latest posts. Defining Homepage and Posts page are then greyed out. One can not any longer set any of these.
The Site Editor removes the labels and does not show which page is the Homepage that contains Posts. As there is no label for it any longer. There can be confusion as to which page is actually the Homepage that contains posts.


The Site Editor: The current process of defining a posts page removes the content of the page.
The Site Editor Posts page one is able to see the outline of blog posts images and an excerpt and more. It can not be edited.

Should a posts page contain the default Query Loop block that can be edited? If there was preexisting content should that still be available below the Query Loop block? So that the predefined Posts page still has the content available, but now also contains an editable Query Loop block above it. This way one does not loose the information one had earlier on the page but can choose to later on adjust/remove it. At the same time one can then customize the default Query Loop block to how one wants to see the Posts page.

@jameskoster
Copy link
Contributor

@jasmussen to clarify; you're advocating for not having the following actions:

  • Reset homepage
  • Reset posts page
  • Set posts page

And instead offering a dedicated flow for creating a posts page, where one doesn't exist (#63667)?

If so I think it can work, and inherently clarify some of the points outlined by Paal, but we need to find the right design in 63667.

@jasmussen
Copy link
Contributor

Sorry I should be clearer.

I'm advocating for choosing one of two paths.

  1. We keep these options, all 4 (set/reset homepage, set/reset posts page), and improve the text in the Confirm dialog.

  2. We go a different direction:

  • Keep only set/reset Homepage in the context menu
  • Add a dropdown in the "Add new" button, or better yet a split button.
  • The split button includes "Add posts page", and "Add homepage" options. Either is present when either is unset.
  • The way you then "unset" a posts page, is to delete the page.

I don't really have a strong opinion either way. I think the latter is better. But it's a taller undertaking, and the former works today, in this PR, and is not as bad in practice as it sounds. So it could be a matter of doing 1 for now, and then upgrading to 2 depending on need.

@jameskoster
Copy link
Contributor

Thanks for clarifying. I agree in general, but lean towards omitting the 'Reset' actions in both paths. The value-add is limited imo.

packages/editor/src/utils/index.js Outdated Show resolved Hide resolved
packages/editor/src/components/post-actions/actions.js Outdated Show resolved Hide resolved
Comment on lines 42 to 54
// Save new posts page settings.
await saveEditedEntityRecord( 'root', 'site', undefined, {
page_for_posts: 0,
show_on_front: isPageOnFrontSet ? 'page' : 'posts',
} );

// This second call to a save function is a workaround for a bug in
// `saveEditedEntityRecord`. This forces the root site settings to be updated.
// See https://github.com/WordPress/gutenberg/issues/67161.
await saveEntityRecord( 'root', 'site', {
page_for_posts: 0,
show_on_front: isPageOnFrontSet ? 'page' : 'posts',
} );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about this, but wouldn't just saveEntityRecord work correctly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't know much about these functions, but I believe ideally just saveEditedEntityRecord should be required, as that calls saveEntityRecord. However, using saveEntityRecord on its own does seem to work successfully, so maybe we could just use that function in these cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the codebase some more at other uses of these functions, and saveEntityRecord is often used on its own (rather than saveEditedEntityRecord as I expected), so I've removed saveEditedEntityRecord from both the "Set as homepage" and "Set as posts page" actions. They still work fine so I think this is a nice refactor!

Commit with these changes is here: 2cfd817.

createSuccessNotice( __( 'Posts page reset' ), {
type: 'snackbar',
} );
} catch ( error ) {
Copy link
Contributor

@t-hamano t-hamano Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this exception error actually possible? Because saveEntityRecord doesn't seem to throw any exceptions by default.

https://github.com/WordPress/gutenberg/blob/add/more-homepage-actions/packages/core-data/README.md#saveentityrecord

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's nice to have the catch block anyway, to catch any other errors (like a network error maybe). But I completely see your point, I don't think saveEntityRecord throws any exceptions.

@t-hamano
Copy link
Contributor

Should we discuss the reset option in a separate issue/PR to keep the scope of this PR as small as possible?

Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com>
mikachan and others added 2 commits December 10, 2024 12:05
@mikachan
Copy link
Member Author

Should we discuss the reset option in a separate issue/PR to keep the scope of this PR as small as possible?

I think it depends on the consensus around the paths described in this comment, and this PR can be updated to reflect these changes:

  1. Keep all 4 options (set/reset homepage, set/reset posts page), or;
  2. Keep only set/reset Homepage in the context menu, and then implement more options outside of the context menu (Create and set a page_for_posts in the site editor #63667)

I would lean more towards the second option, keeping the set/reset Homepage in the context menu, and discuss the designs for the posts page settings in #63667 as a next step. My biggest concern with keeping all 4 options is the amount of new page actions being included in this menu.

The Site Editor removes the labels and does not show which page is the Homepage that contains Posts. As there is no label for it any longer. There can be confusion as to which page is actually the Homepage that contains posts.

I think this is one of the most confusing homepage states for a user when in the Editor. Perhaps we could have a separate UI just for the homepage somewhere on the Pages data view, which may be linked to the design we go with in #63667 (i.e. maybe there's an "Edit homepage settings" option in this dropdown menu).

@paaljoachim
Copy link
Contributor

Following the existing logic of the labels.
When the homepage shows posts it would be natural to have it contain homepage label and a posts label. Showing the user at a quick glance which page is the homepage/front page as well as which page is the posts/blog page. Having both labels on the same page just tells the user that one has selected to show the blog on the front page.

@jameskoster
Copy link
Contributor

Should we discuss the reset option in a separate issue/PR to keep the scope of this PR as small as possible?

That makes sense to me. I'm not convinced about the value of the 'Reset...' actions.

@mikachan
Copy link
Member Author

When the homepage shows posts it would be natural to have it contain homepage label and a posts label.

This makes sense, however, when the homepage is set to show the latest posts, there isn't a page to assign these labels to. However, perhaps we could create a faux page in the Pages data view that has these labels, or some other UI in the data view to indicate the current homepage settings.

That makes sense to me. I'm not convinced about the value of the 'Reset...' actions.

I agree, I think the need for having the reset actions is probably an indicator of the missing UI around the homepage settings. In that case, I could reduce this PR to just adding the "Set as posts page" action, and remove both the "reset" actions for now, and then open up a new issue to continue discussing the next steps for the homepage settings.

@t-hamano
Copy link
Contributor

I think the need for having the reset actions is probably an indicator of the missing UI around the homepage settings.

I think this will be related to the admin redesign, which is one of Phase 3 (See #1111). Eventually, I expect the functionality for the display settings to be implemented in the new Settings screen, but I think it will be a very long way before that happens.

@mikachan mikachan changed the title Pages: Add more homepage display actions Pages: Add "Set posts page" action Dec 11, 2024
@mikachan mikachan changed the title Pages: Add "Set posts page" action Pages: Add "Set as posts page" action Dec 11, 2024
@mikachan
Copy link
Member Author

I've updated this so that it now only adds the "Set as posts page" action, and then a few other smaller changes:

  • The "Move to trash" action should now always be at the bottom of the actions list
  • The getItemTitle function has been moved from the "Set as homepage" action file to its own file since it's now being used in two actions
  • saveEditedEntityRecord has been removed from both the "Set as homepage" and "Set as posts page" actions, as it seems only saveEntityRecord is needed

This is ready for another review! 🙇

@jameskoster
Copy link
Contributor

I'm seeing the following error when enacting 'Set as posts page':

TypeError: Cannot read properties of undefined (reading 'title')
    at getItemTitle (http://pizza.local/wp-content/plugins/gutenberg/build/editor/index.min.js?ver=11fcc0c26246d9b0ad34:34647:19)
    at SetAsPostsPageModal (http://pizza.local/wp-content/plugins/gutenberg/build/editor/index.min.js?ver=11fcc0c26246d9b0ad34:14061:173)
    at mf (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:105:412)
    at Qk (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:250:214)
    at Ri (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:195:185)
    at Ok (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:195:116)
    at Nd (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:194:492)
    at Qf (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:187:439)
    at Li (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:189:234)
    at db (http://pizza.local/wp-content/plugins/gutenberg/build/vendors/react-dom.min.js?ver=18:79:182)

In terms of design this is probably good to go, but there are a couple of smaller details to consider...

Should we group the 'Set as...' actions in a flyout to tidy the menu up a bit?

menu

Though I appreciate 'posts page' is an established piece of WordPress nomenclature, 'Set as posts page' isn't especially intuitive for those unfamiliar with the term. I'd welcome alternative suggestions if anyone has a good idea. The best I could come up with was 'Set as latest posts archive', but that's not much (if any) improvement.

@mikachan
Copy link
Member Author

I'm seeing the following error when enacting 'Set as posts page':

I'm hoping this is fixed with the latest commit in f60fa36, which uses a similar check to the homepage action to prevent a similar error we were seeing there.

That flyout menu looks good and I like the grouping of these actions. Would the actions only be grouped when there was more than one of them, or would it still show if only either the homepage or posts page actions were available? I guess for consistency in the menus, it might be best if they were always grouped into the separate menu.

'Set as posts page' isn't especially intuitive for those unfamiliar with the term.

Yes agreed, but I'm also struggling to think of alternatives! Maybe "Set as blog page"?

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we group the 'Set as...' actions in a flyout to tidy the menu up a bit?

I'm not sure if the current Actions API supports submenus🤔

@youknowriad @oandregal Do you know anything about this?

@youknowriad
Copy link
Contributor

I'm not sure if the current Actions API supports submenus🤔
@youknowriad @oandregal Do you know anything about this?

It's not supported right now, also hard to think of a good API for it. We could explore it if needed.

@jameskoster
Copy link
Contributor

Nice, it's working now :)

If adding the flyout isn't trivial let's not worry about it.

@mikachan
Copy link
Member Author

Thanks @jameskoster!

If adding the flyout isn't trivial let's not worry about it.

Yeah, it's not trivial, but it would still be nice to revisit it later.

@jameskoster
Copy link
Contributor

This one seems in a good spot to me, pending code review :)

@mikachan mikachan merged commit 9bdbada into trunk Dec 13, 2024
66 checks passed
@mikachan mikachan deleted the add/more-homepage-actions branch December 13, 2024 17:29
@github-actions github-actions bot added this to the Gutenberg 20.0 milestone Dec 13, 2024
@mikachan
Copy link
Member Author

Thanks all! We had a few design-related discussions here which I think can continue over in #63667.

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 [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.
Development

Successfully merging this pull request may close these issues.

7 participants