-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Image block: Disable behaviors dropdown if image has aspect ratio configured #52197
Conversation
Size Change: +79 B (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
Flaky tests detected in c6bda4c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5445600033
|
We should indicate this plan. Disabling because of the link or the aspect ratio have different reasons that the user should know. cc @jasmussen for User Experience opinion. |
96afb1d
to
c6bda4c
Compare
Looks good to me! 👍 I'd just wait for the opinion on the UX from a real designer but personally, I like the UX. |
We might want to revert back to the "No behaviors" state if aspect ratio is set to better indicate its not enabled. It currently might be perceived as "enabled but can't change". It's also a little weird because we label this option as "behaviours" vs "lightbox" yet the entire select is disabled vs just the "lightbox" option. This is something we can iterate on as we introduce more behaviors. In the short term, are we able to be more specific with the copy so that it doesn't sound so technical? e.g. "Lightbox can only be enabled when image aspect ratio is set to original". or "Lightbox is disabled when a link has been added to an image" |
I believe we should keep this consistent with the way adding a link disables the behaviors UI. Does this mean you think we should also make the link behavior operate the same way? (perhaps @jasmussen has thoughts)
Sure thing, yeah we would definitely revisit this once new behaviors were added.
I can do this. We need to account for both the link and aspect ratio though. Could the copy be as follows? Text in bold added by me: "Lightbox is disabled when a link has or aspect ratio has been added to an image" |
Are we only disabling the UI? What happens if we have aspect ratio and a lightbox set as default on the theme.json or the site editor? |
@c4rl0sbr4v0 We're disabling the lightbox functionality entirely. If you enable the lightbox by default via the theme.json, you see this in the block settings and the lightbox is disabled: |
I started exploring the possibility of directly supporting the Aspect Ratio: link. If we agree on an approach I can work a pull request and this one might not be needed. |
I'd prefer to ship the Lightbox v0.1 with support for images with the aspect ratio configured, instead of shipping this PR to disable the behaviors. |
I'll close the PR so we don't get confused. |
What?
The image lightbox is currently incompatible with the aspect ratio configuration in image block settings.
This PR disables the lightbox when an aspect ratio is specified.
Why?
We don't want to offer users broken experiences. Since the image lightbox is in early stages, we can plan to add to support for custom aspect ratios in a later version.
How?
It checks whether an aspect ratio is defined in the image block attributes, and if so, disables the dropdown. Since the lightbox is also disabled if a link is configured, the logic has also been revised to account for both scenarios.
Testing Instructions
original
— the lightbox should work.Testing Instructions for Keyboard
N/A
Screenshots or screencast
aspect-ratio-disable.mp4