Skip to content

Icons: ship required icons for admin bar and menu with public: false - #79451

Merged
fushar merged 1 commit into
trunkfrom
icons-admin-publicize
Sep 11, 2026
Merged

fushar merged 1 commit into
trunkfrom
icons-admin-publicize

Conversation

@fushar

@fushar fushar commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Part of #82723
Related to: WordPress/wordpress-develop#12270

What?

Make the following icons available to wp_get_icon() by adding public: false to the manifest.

  1. brush
  2. dashboard
  3. link
  4. media
  5. page
  6. pin
  7. plugins
  8. sites
  9. tool
  10. update

Why?

The above icons are needed as the replacement for the old dashicons in the admin UI.

Testing Instructions

It's way easier to test with WordPress/wordpress-develop#12270. Open the following Playground link, which test both that Core PR and this Gutenberg PR:

https://playground.wordpress.net/?core-pr=12270&gutenberg-pr=79451

Then:

  1. Verify you can see the new icons above (including core/wordpress):
image
  1. Go to Editor, add an Icon block, verify you cannot search the above icons:
image

Use of AI Tools

I used Claude Opus to generate the changes, then I also double checked it.

@fushar
fushar requested a review from t-hamano June 23, 2026 15:14
@github-actions github-actions Bot added the [Package] Icons /packages/icons label Jun 23, 2026
@github-actions

github-actions Bot commented Jun 23, 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: fushar <fushar@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: mcsf <mcsf@git.wordpress.org>

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

@fushar fushar added the [Type] Enhancement A suggestion for improvement. label Jun 23, 2026
@t-hamano

Copy link
Copy Markdown
Contributor

Thank you for your PR. However, it is difficult to move forward with this PR at this time.

  • It has not yet been thoroughly examined which icons will be shipped to the core and how.
  • The published icons will be available in the icon block, but icons for the management menu are not useful for post content.

It seems we need a flag to decide whether to expose icons in the Icon block, regardless of whether we move forward with #79102.

cc @mcsf @tyxla

@github-actions

Copy link
Copy Markdown

Flaky tests detected in 8cf726d.
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/28036189826
📝 Reported issues:

@tyxla

tyxla commented Jun 24, 2026

Copy link
Copy Markdown
Member

Commented on the related PRs. I felt like we had an agreement about a public flag already, so if that's true we should be able to move forward with the registration API and respectively with publishing the icons.

@t-hamano

Copy link
Copy Markdown
Contributor

The issue is that when an icon is published, it simultaneously becomes selectable within the icon block. For instance, few users would want to use icons like 'dashboard' or 'grid' in their post content.

I feel there is a need for a way to register icons in the icon registry without publishing them in the icon block, as I would like to propose here.

@tyxla

tyxla commented Jun 25, 2026

Copy link
Copy Markdown
Member

I feel there is a need for a way to register icons in the icon registry without publishing them in the icon block, as I would like to propose here.

Just to be sure I understand: are you saying public: false for such icons isn't sufficient?

@t-hamano

Copy link
Copy Markdown
Contributor

Just to be sure I understand: are you saying public: false for such icons isn't sufficient?

I see—so, this is what you mean? I believe this approach will allow us to achieve our goals without significantly altering the synchronization method between the core and Gutenberg.

[
	// Not shipped to the core
	{
		"slug": "one",
		"label": "One",
		"filePath": "library/one.svg"
	},
	// Published in the Icon block
	{
		"slug": "two",
		"label": "Two",
		"filePath": "library/two.svg",
		"public": true
	},
	// Not published in the icon block
	{
		"slug": "three",
		"label": "Three",
		"filePath": "library/three.svg",
		"public": false
	}
]

@tyxla

tyxla commented Jun 25, 2026

Copy link
Copy Markdown
Member

This sesms reasonable at first glance, but @mcsf had some thoughts previously, so I'd love to pick his brain here

@mcsf

mcsf commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This seems reasonable to me too. :)

@fushar

fushar commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

I'm implementing the suggestion as discussed above. Marking this PR as draft and will re-request for review when it's ready 🙂

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

📦 Bundle size

Size Change: 0 B

Total Size: 8 MB

From 6197662, not the current head. Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 004e059 trunk % Change
timeToFirstByte 59.35 ms +11.12% -5.48% 58.45 ms +10.35% -4.11% 1.54%
largestContentfulPaint 98 ms +6.12% -6.12% 100 ms +2% -6% -2%
lcpMinusTtfb 35.45 ms +16.5% -6.63% 36.35 ms +21.87% -5.64% -2.48%
wpBeforeTemplate 28.79 ms +17.02% -2.74% 28.91 ms +15.88% -3.29% -0.42%
wpTemplate 25.15 ms +2.43% -3.66% 25.33 ms +4.93% -4.62% -0.71%
wpTotal 55.57 ms +10.47% -6.06% 54.55 ms +11.09% -3.83% 1.87%
wpMemoryUsage 7.53 MB +0% -0% 7.49 MB +0% -0% 0.54%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric 004e059 trunk % Change
timeToFirstByte 48.85 ms +6.04% -2.97% 48.35 ms +5.79% -0.93% 1.03%
largestContentfulPaint 104 ms +5.77% -0% 104 ms +3.85% -0% 0%
lcpMinusTtfb 56.8 ms +2.9% -1.85% 55.8 ms +2.87% -1.43% 1.79%
wpBeforeTemplate 26.88 ms +6.62% -2.42% 26.93 ms +2.01% -1.41% -0.19%
wpTemplate 18.47 ms +2.76% -2.71% 18.43 ms +3.8% -1.57% 0.22%
wpTotal 45.79 ms +6.05% -3.25% 45.36 ms +5.67% -1.68% 0.95%
wpMemoryUsage 6.15 MB +0% -0% 6.10 MB +0% -0% 0.68%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric 004e059 trunk % Change
mediaProcessingJpeg 407.14 ms +1.2% -1.8% 403.39 ms +0.23% -0.13% 0.93%
mediaProcessingAvif 6079.08 ms +0.32% -0.3% 6084 ms +0.31% -0.16% -0.08%
mediaProcessingJpegToAvif 4177.5 ms +0.16% -0.09% 4204.67 ms +0.29% -0.22% -0.65%

media-upload

Metric 004e059 trunk % Change
jpegUploadProcessing 1458.91 ms +33.56% -2.03% 1431.99 ms +1.74% -0.93% 1.88%
pngUploadProcessing 220.74 ms +3.71% -5.41% 218.72 ms +1.89% -3.71% 0.92%
largeJpegUploadProcessing 1422.1 ms +1.68% -0.8% 1410.56 ms +0.96% -0.35% 0.82%
multipleImageUploadProcessing 1611.96 ms +1.03% -1.19% 1589.98 ms +1.73% -2.31% 1.38%

post-editor

Metric 004e059 trunk % Change
serverResponse 493.54 ms +3.27% -4.06% 488.56 ms +3.14% -2.3% 1.02%
firstPaint 258.8 ms +23.84% -34.65% 277.93 ms +14.69% -9.84% -6.88%
domContentLoaded 1048.19 ms +5.36% -2.43% 1048.47 ms +0.63% -1.54% -0.03%
loaded 1049.48 ms +5.36% -2.43% 1049.73 ms +0.63% -1.55% -0.02%
firstContentfulPaint 433.42 ms +7.18% -7.94% 422.22 ms +2.8% -2.99% 2.65%
firstBlock 3287.95 ms +0.78% -1.33% 3265.15 ms +0.17% -1.41% 0.7%
type 14.91 ms +8.52% -6.24% 15.63 ms +4.86% -11.07% -4.61%
typeWithoutInspector 14.76 ms +7.05% -3.12% 14.2 ms +13.24% -6.62% 3.94%
typeWithTopToolbar 18.58 ms +2.96% -4.41% 18.51 ms +6.81% -2.32% 0.38%
typeContainer 9.19 ms +11.64% -9.14% 8.5 ms +18.59% -4.59% 8.12%
focus 75.83 ms +10.09% -4.43% 72.87 ms +12.45% -2.28% 4.06%
firstFocus 172.51 ms +0% -0% 158.72 ms +0% -0% 8.69%
selectAll 625.89 ms +1.54% -1.31% 586.18 ms +3.89% -0.33% 6.77%
listViewOpen 71.35 ms +2.7% -1.16% 74.68 ms +6.91% -8.72% -4.46%
inserterOpen 22.18 ms +11.54% -13.17% 21.68 ms +7.7% -10.19% 2.31%
inserterHover 3.22 ms +10.56% -9.63% 3.17 ms +8.52% -11.67% 1.58%
inserterSearch 7.85 ms +6.88% -12.74% 8.15 ms +6.38% -3.68% -3.68%
loadPatterns 644.67 ms +4.29% -1.8% 627.57 ms +3.07% -3.99% 2.72%
wpTotal 483.48 ms +3.36% -4% 479.11 ms +3.22% -2.4% 0.91%
wpMemoryUsage 13.06 MB +0% -0% 13.02 MB +0% -0% 0.29%
wpDbQueries 54 +0% -0% 53.5 +0.93% -0.93% 0.93%

site-editor

Metric 004e059 trunk % Change
serverResponse 483.01 ms +2.2% -2.05% 460.63 ms +3.1% -2.87% 4.86%
firstPaint 266.96 ms +14.33% -18.92% 256.56 ms +10.17% -7.8% 4.05%
domContentLoaded 1104.17 ms +0.86% -1.23% 1094.54 ms +2.75% -1.75% 0.88%
loaded 1105.36 ms +0.88% -1.22% 1095.69 ms +2.75% -1.73% 0.88%
firstContentfulPaint 434.09 ms +1.48% -3.61% 426.31 ms +3.2% -1.43% 1.82%
firstBlock 4080.23 ms +0.52% -0.2% 4069.79 ms +1.43% -0.62% 0.26%
type 15.04 ms +4.19% -5.92% 15.47 ms +9.63% -8.14% -2.78%
navigate 101.69 ms +15.82% -2.14% 109.05 ms +3.69% -4.84% -6.75%
loadPatterns 1413.11 ms +14.72% -16.66% 1426.62 ms +10.4% -11.32% -0.95%
loadPages 1040.21 ms +1.29% -0.38% 1054.05 ms +2.45% -1.09% -1.31%
wpTotal 473.56 ms +2.29% -2.25% 451.1 ms +3.11% -3.11% 4.98%
wpMemoryUsage 12.02 MB +0% -0% 11.97 MB +0% -0% 0.35%
wpDbQueries 43.5 +1.15% -1.15% 43 +2.33% -0% 1.16%

520b671 Run

@fushar
fushar force-pushed the icons-admin-publicize branch from 6197662 to c51d56a Compare September 9, 2026 07:19
@fushar
fushar force-pushed the icon-public-false branch 3 times, most recently from 402e768 to a087ca3 Compare September 9, 2026 09:06
@fushar
fushar force-pushed the icons-admin-publicize branch from c51d56a to 4bef6f4 Compare September 9, 2026 10:03
@github-actions github-actions Bot added [Package] DOM ready /packages/dom-ready [Package] Hooks /packages/hooks [Package] i18n /packages/i18n [Package] is-shallow-equal /packages/is-shallow-equal [Tool] Jest console /packages/jest-console [Tool] npm-package-json-lint config /packages/npm-package-json-lint-config [Tool] WP Scripts /packages/scripts [Package] Url /packages/url [Package] Word count /packages/wordcount [Package] Deprecated packages/deprecated [Tool] Babel plugin makepot /packages/babel-plugin-makepot [Tool] Babel plugin import JSX pragma /packages/babel-plugin-import-jsx-pragma [Package] Blob /packages/blob [Package] Compose /packages/compose [Package] Core data /packages/core-data [Package] API fetch /packages/api-fetch [Package] HTML entities /packages/html-entities [Package] Viewport /packages/viewport [Package] DOM /packages/dom [Tool] Jest preset /packages/jest-preset-default [Package] Keycodes /packages/keycodes [Package] Plugins /packages/plugins labels Sep 10, 2026
@fushar

fushar commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Sorry for the mass ping everyone... bad git rebase with this stacked PR... 😓

Comment on lines -60 to -63
if ( has_action( 'admin_bar_menu', 'wp_admin_bar_command_palette_menu' ) ) {
remove_action( 'admin_bar_menu', 'wp_admin_bar_command_palette_menu', 55 );
}
add_action( 'admin_bar_menu', 'gutenberg_admin_bar_command_palette_menu', 55 );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this change intentional?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh i get it now. I think this probably should have its own PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually the only required one is this move: https://github.com/WordPress/gutenberg/pull/79451/changes#r3970437640

I also moved this one inside the if ( ! function_exists( 'wp_admin_bar_command_palette_menu' ) ) { check, to make it consistent. Also, I think it's more correct? We want to add the node and enqueue the style from this GB compat only when Core still does not support command palette (version < 7.0). I hope I'm not missing anything 😬

I tested WP 6.9 and 7.0 with this GB PR via Playground and things seem to be still working.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this probably should have its own PR.

I thought that, too, but I wanted to test everything with a single Playground link to make sure everything works well together 😄 I can take this one out and create another PR later when we're ready to merge things.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I ended up extracting it here: #82733

@tyxla tyxla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This ls looking good to me, but it would be good to get a final ✅ also from @t-hamano who had some prior feedback

@scruffian scruffian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should merge this, but only once #82634 has been rebased and merged. Thanks for all your work.

Marks the icons that WordPress/wordpress-develop#12270
adds to Core's icon library as `"public": false`: they are shipped and
registered for server-side use, but stay out of the icons REST API and so
out of the Icon block.

brush, dashboard, link, media, page, pin, plugins, post, sites, tool, update

`wordpress` is the twelfth icon that Core PR needs. It is already flagged
by #82634, which introduces the non-public state and uses it as its first
consumer, so it is not repeated here.

`false` rather than `true` because these are admin chrome, not post
content. Promoting an icon later is trivial; demoting one is a breaking
change.
@t-hamano t-hamano mentioned this pull request Sep 30, 2026
3 of 26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Icons /packages/icons [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants