-
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: Disable lightbox editor UI for linked images #55141
Conversation
@@ -555,6 +557,14 @@ export default function Image( { | |||
lightbox: { enabled: newValue }, | |||
} ); | |||
} } | |||
disabled={ lightboxToggleDisabled } | |||
help={ |
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.
I'm not sure if this is the best way to add the help text — any thoughts on this appreciated!
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.
As far as I can tell, this is indeed the appropriate way 👍
@jasmussen @annezazu How does this look? Do we need any changes to the design or text? |
Size Change: +2.6 kB (0%) Total Size: 1.65 MB
ℹ️ View Unchanged
|
Flaky tests detected in f69033d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6437131436
|
Only have time for a quick look this morning, but wanted to just reiterate that this PR will not close the original issue, we still need #54916 (comment) as a followup when possible. A few quick details, though:
CC: @richtabor in case he has time to look. |
Just checking is this [the "followup"] expected for 6.4? I assume not as we're into Beta now. |
I think it is as it's a bugfix for the Lightbox. Isn't it acceptable to add bugfixes for 6.4 until October 17th? |
Sorry I was referring to what Joen said about the "followup" which is more than a bug fix. This particular PR is fine as a bugfix I believe 🙇 |
@jasmussen Thanks, the text has been updated 👍 |
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 👍 Thanks, Artemio!
I just cherry-picked this PR to the 6.4-rc1 branch to get it included in the next release: 1115e80 |
* Disable lightbox UI and add help text for linked images * Update help text
* List: fix forward merging of nested list (#55121) * Private APIs: Update consent string for unlocking access. (#55182) Replace the consent string with `I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress`. * useBlockSettings: add missing useMemo dependencies (#55204) * Remove the lightbox filter and view file when the lightbox setting is disabled. (#55120) * Remove the filter and view file of the lightbox when the lightbox setting is disabled. * Make sure to add filter and view file when needed. * Fix block comment indentation. * Patterns: Remove the version enforcement for npm in `engines` field (#55245) * Patterns: Remove the version enforcement for npm in `engines` * Regenerate the lock file * Remove `@return void` from PHP function docs. (#55237) # Conflicts: # packages/block-library/src/form/index.php * Image: Disable lightbox editor UI for linked images (#55141) * Disable lightbox UI and add help text for linked images * Update help text * Image: Stop crashing with Lightbox on image blocks without an image (#55269) * Stop crashing with Lightbox on image blocks without an image * Fix PHPCS error * Update fullscreen icon (#55021) * Template Part block: Fall back to current theme if no theme attribute is given. (#55217) * Template Part block: Fall back to current theme if no theme attribute is given. * Remove now unnecessary _inject_theme_attribute_in_template_part_block() call from pattern block. --------- Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com> Co-authored-by: Felix Arntz <felixarntz@google.com> --------- Co-authored-by: Ella <4710635+ellatrix@users.noreply.github.com> Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Co-authored-by: Jarda Snajdr <jsnajdr@gmail.com> Co-authored-by: Andrea Fercia <a.fercia@gmail.com> Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl> Co-authored-by: tellthemachines <tellthemachines@users.noreply.github.com> Co-authored-by: Artemio Morales <artemio.morales@a8c.com> Co-authored-by: Rich Tabor <hi@richtabor.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com> Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com> Co-authored-by: Felix Arntz <felixarntz@google.com>
Updates the npm packages and code for: * [WordPress/gutenberg#55121 List: fix forward merging of nested list] * [WordPress/gutenberg#55182 Update consent string for using private APIs.] * [WordPress/gutenberg#55204 useBlockSettings: add missing useMemo dependencies] * [WordPress/gutenberg#55120 Remove the lightbox filter and view file when the lightbox setting is disabled.] * [WordPress/gutenberg#55245 Patterns: Remove the version enforcement for npm in engines field] * [WordPress/gutenberg#55237 Remove `@return void` from PHP function docs] * [WordPress/gutenberg#55141 Image: Disable lightbox editor UI for linked images] * [WordPress/gutenberg#55269 Image: Stop crashing with Lightbox on image blocks without an image] * [WordPress/gutenberg#55021 Update fullscreen icon] * [WordPress/gutenberg#55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818]. References: * [WordPress/gutenberg#55298 Gutenberg PR 55298] Cherry-pick commits Follow-up to [56818], [56816]. Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya. See #59583, #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@56849 602fd350-edb4-49c9-b593-d223f7449a82
Updates the npm packages and code for: * [WordPress/gutenberg#55121 List: fix forward merging of nested list] * [WordPress/gutenberg#55182 Update consent string for using private APIs.] * [WordPress/gutenberg#55204 useBlockSettings: add missing useMemo dependencies] * [WordPress/gutenberg#55120 Remove the lightbox filter and view file when the lightbox setting is disabled.] * [WordPress/gutenberg#55245 Patterns: Remove the version enforcement for npm in engines field] * [WordPress/gutenberg#55237 Remove `@return void` from PHP function docs] * [WordPress/gutenberg#55141 Image: Disable lightbox editor UI for linked images] * [WordPress/gutenberg#55269 Image: Stop crashing with Lightbox on image blocks without an image] * [WordPress/gutenberg#55021 Update fullscreen icon] * [WordPress/gutenberg#55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818]. References: * [WordPress/gutenberg#55298 Gutenberg PR 55298] Cherry-pick commits Follow-up to [56818], [56816]. Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya. See #59583, #59411. Built from https://develop.svn.wordpress.org/trunk@56849 git-svn-id: http://core.svn.wordpress.org/trunk@56361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the npm packages and code for: * [WordPress/gutenberg#55121 List: fix forward merging of nested list] * [WordPress/gutenberg#55182 Update consent string for using private APIs.] * [WordPress/gutenberg#55204 useBlockSettings: add missing useMemo dependencies] * [WordPress/gutenberg#55120 Remove the lightbox filter and view file when the lightbox setting is disabled.] * [WordPress/gutenberg#55245 Patterns: Remove the version enforcement for npm in engines field] * [WordPress/gutenberg#55237 Remove `@return void` from PHP function docs] * [WordPress/gutenberg#55141 Image: Disable lightbox editor UI for linked images] * [WordPress/gutenberg#55269 Image: Stop crashing with Lightbox on image blocks without an image] * [WordPress/gutenberg#55021 Update fullscreen icon] * [WordPress/gutenberg#55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818]. References: * [WordPress/gutenberg#55298 Gutenberg PR 55298] Cherry-pick commits Follow-up to [56818], [56816]. Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya. See #59583, #59411. Built from https://develop.svn.wordpress.org/trunk@56849 git-svn-id: https://core.svn.wordpress.org/trunk@56361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates the npm packages and code for: * [WordPress/gutenberg#55121 List: fix forward merging of nested list] * [WordPress/gutenberg#55182 Update consent string for using private APIs.] * [WordPress/gutenberg#55204 useBlockSettings: add missing useMemo dependencies] * [WordPress/gutenberg#55120 Remove the lightbox filter and view file when the lightbox setting is disabled.] * [WordPress/gutenberg#55245 Patterns: Remove the version enforcement for npm in engines field] * [WordPress/gutenberg#55237 Remove `@return void` from PHP function docs] * [WordPress/gutenberg#55141 Image: Disable lightbox editor UI for linked images] * [WordPress/gutenberg#55269 Image: Stop crashing with Lightbox on image blocks without an image] * [WordPress/gutenberg#55021 Update fullscreen icon] * [WordPress/gutenberg#55217 Template Part block: Fall back to current theme if no theme attribute is given.] This change is part of fix for a performance regression re-introduced by [56818]. References: * [WordPress/gutenberg#55298 Gutenberg PR 55298] Cherry-pick commits Follow-up to [56818], [56816]. Props ellatrix, peterwilsoncc, jsnajdr, afercia, gziolo, isabel_brison, artemiosans, richtabor, bernhard-reiter, flixos90, mikachan, spacedmonkey, hellofromTonya. See #59583, #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@56849 602fd350-edb4-49c9-b593-d223f7449a82
What?
This PR disables the lightbox editor UI when a link has been configured for an image.
Why?
Addresses #54916
Configured links for images will override the lightbox, so we should provide an indication in the UI to signal this to the user.
How?
It checks to see if a link has been defined — if so, it disables the Expand on Click toggle and displays a help message.
Testing Instructions
Additionally, try toggling on Expand on Click before adding a link — see the toggle still gets disabled as expected.
Testing Instructions for Keyboard
N/A
Screenshots or screencast