-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block Patterns List: Fix visual title and tooltip inconsistencies #64815
Conversation
Size Change: +14 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
Flaky tests detected in a54ffc6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11755727831
|
79c12e9
to
973e4aa
Compare
#### showTitle | ||
|
||
Whether to show the block pattern title. User-defined patterns always show a title regardless of this prop. | ||
|
||
- Type: `boolean` | ||
- Required: No | ||
- Default: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add missing documentation
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @isuke01. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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. |
Why this exception? |
In this PR, I introduced a rule called "In modals, always show the visual title". As a result, it means that only the modal after creating a custom template did not follow this rule.
|
Thanks for the PR! I think what complicated things a bit more is the I didn't check thoroughly right now, but I'm wondering if the I'm all for consistency, but should we keep the initial |
973e4aa
to
a54ffc6
Compare
Sorry for the late reply.
That's true. I've removed the BTW, this PR will also improve the Change Design popover: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
I find it a bit weird that user patterns have always the title displayed, but I don't have the context for that decision and is not related to this PR.
Fixes #64632
Related to #64166, #60160
What?
This PR resolves inconsistencies and introduces clearer rules for the title and tooltip in the
BlockPatternList
component.Why?
I think there are three problems with this component currently:
How?
In this PR, I apply the following rules wherever the
BlockPatternsList
component is used to resolve these inconsistencies:To achieve this, I removed the
showTitlesAsTooltipshowTitle
prop from theBlockPatternsList
component. Whether or not to show a tooltip is determined solely by whether or not to show the visual title, i.e. theshowTitleshowTitleAsTooltip
prop.I am also aware that in some places the visual title is intentionally hidden. One example is #60160. Respecting this approach, the visual titles remain unchanged in this PR, with one exception.
The only visual change in this PR is the modal after creating a custom template:
This is the result based on the rule "In modals, always show the visual title", but we can change the title "Fallback content" or make an exception and not display a visual title.
Testing Instructions
Check where the
BlockPatternsList
component is used and make sure there are no visual changes.Make sure that visual titles and tooltips are displayed based on the following rules:
Pattern inserter
Pattern inserter (mobile)
Template Parts Design panel
Explore all patterns modal
Template Parts replace modal
Main inserter > Search pattern
Query Loop block > Choose a pattern modal
Swap Template modal
After creating a custom template
After creating a new page
Transform a Query Loop block to a pattern