Experiment: Taxonomies implement auto-fill labels#77786
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +675 B (+0.01%) Total Size: 7.82 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in f3b879c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25113498607
|
tyxla
left a comment
There was a problem hiding this comment.
Nice work 👍
This works well in my testing, and code looks good.
I've made a few suggestions to address before merging it - let me know what you think!
22e5d34 to
f3b879c
Compare
| @@ -1,7 +1,13 @@ | |||
| @use "@wordpress/base-styles/colors" as *; | |||
There was a problem hiding this comment.
We once again missed declaring "@wordpress/base-styles" as a dependency, and yes, I agree that it is very easy and bound to miss such things. 😄
These things should be solved automatically once we handle #76195

Summary
Part of: #77600
Adds two actions inside the taxonomy edit form's Labels card to make the labels section less manual:
All %s,Edit %s,← Back to %s,No %s found., etc.). Disabled until both Plural and Singular are set.The Labels card's previous prose description is consolidated into a single help paragraph rendered above the buttons, with an extra sentence reminding users to re-run Auto-fill after a rename.
Also: rows in the taxonomies list are now
isItemClickableand route to the edit page on click.How it's wired
The two buttons are rendered inside the Labels card via a small "phantom field" — a
Fieldwith no value (no-opgetValue/setValue) whose customEditrenders the help paragraph and the button row. It's the first child oflabelsForm.fieldsand useslabelPosition: 'none'so the regular layout suppresses the auto-rendered field label.This is a workaround for
DataFormcard layouts having no first-class slot for header actions or arbitrary React among children. The hack is annotated with a comment inpackages/user-taxonomies/src/fields/labels.tsxnoting that adding native per-card action support toDataFormwould let us drop it.Translation note (read this if you test locale switching)
The auto-fill localizes labels at click-time using
sprintf(__('All %s'), plural). This relies on the standard WP JS-translation pipeline (.potextraction → translate.wordpress.org → JSON language packs →wp_set_script_translations()). Localwp-envdoes not auto-load the JS catalog for newly-added strings, so switching the admin locale (e.g. to Greek) currently produces English prefixes alongside the translated noun (e.g. "All Σκυλιά"). That's expected pre-shipping behavior and will resolve once translations land in the package's catalog.Testing instructions
labelscard play around with theauto-fill/clearaction buttons.Use of AI Tools
Opus 4.7 with steering, changes and review