-
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
Only suppress admin notices when JavaScript is enabled. #55403
Conversation
Size Change: +7 B (0%) Total Size: 1.66 MB
ℹ️ View Unchanged
|
Flaky tests detected in 44bcd1e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6542087269
|
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.
This looks correct to me.
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 for fixing this Peter ⭐
Marking this one with |
Need to rebase to bring in 7cbf38f which resolves the failing unit tests. Will do shortly. |
44bcd1e
to
e0286e3
Compare
Only suppresses the display of notices on the widget block editor screen if JavaScript is available.
* Unconditionally load the Gutenberg copy of the HTML Tag Processor (#55404) Temporary fix to resolve breaking tests in `trunk` after the WordPress 6.4 backport. * Revert "Unconditionally load the Gutenberg copy of the HTML Tag Processor (#55404)" This reverts commit 271587a. * Image: Reimplement lightbox trigger as a minimal button in corner of image (#55212) * Reimplement lightbox trigger as a minimal button in corner of image * Remove obsolete directives * Update directives to fire logic properly via image or button click * Ensure lightbox button only appears when hovering over image, not whole figure * Ensure close button does not receive focus when opening lightbox via mouse * Ensure button only receives focus when lightbox is closed via keyboard * Add comments * Prevent unnecessary focus being shown on mobile * Add dynamic positioning for button when image uses 'contain' setting * WORK IN PROGRESS - Begin accounting for various edge cases We need to account for the fact that an image can have custom dimensions, aspect ratio, cover or contain, captions, thumbnail dimensions, and potentially other scenarios. This commit begins to address those issues but notably fails in cases where one uses a horizontal image, at full scale, with custom aspect ratio, using 'contain'. It seems to work in all other cases that I've checked but needs more thorough testing and the code can probably be cleaner, and may contain some unnecessary items. * Simplify and improve button placement logic * Simplify logic to show button on hover * Fix styles * Simplify calls to showLightbox * Fix style inconsistency between browsers * Change button position slightly * Reduce button offset * Add style override for better consistency across themes * Fix logic so lightbox animates as intended; remove extraneous code * Update comment * [Edit Widgets] Only suppress admin notices when JS enabled. (#55403) Only suppresses the display of notices on the widget block editor screen if JavaScript is available. --------- Co-authored-by: Dennis Snell <[email protected]> Co-authored-by: Artemio Morales <[email protected]> Co-authored-by: Peter Wilson <[email protected]>
Updates for needed bugfixes in RC1: * [WordPress/gutenberg#55212 Image: Reimplement lightbox trigger as a minimal button in corner of image] * [WordPress/gutenberg#55403 [Edit Widgets] Only suppress admin notices when JS enabled.] Follow-up to [56849], [56818], [56816]. Props artemiosans, jameskoster, SantosGuillamot, aristath, czapla, joen, afercia, richtabor, peterwilsoncc, andraganescu, hellofromTonya, siobhyb. See #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@56961 602fd350-edb4-49c9-b593-d223f7449a82
Updates for needed bugfixes in RC1: * [WordPress/gutenberg#55212 Image: Reimplement lightbox trigger as a minimal button in corner of image] * [WordPress/gutenberg#55403 [Edit Widgets] Only suppress admin notices when JS enabled.] Follow-up to [56849], [56818], [56816]. Props artemiosans, jameskoster, SantosGuillamot, aristath, czapla, joen, afercia, richtabor, peterwilsoncc, andraganescu, hellofromTonya, siobhyb. See #59411. Built from https://develop.svn.wordpress.org/trunk@56961 git-svn-id: http://core.svn.wordpress.org/trunk@56472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Updates for needed bugfixes in RC1: * [WordPress/gutenberg#55212 Image: Reimplement lightbox trigger as a minimal button in corner of image] * [WordPress/gutenberg#55403 [Edit Widgets] Only suppress admin notices when JS enabled.] Follow-up to [56849], [56818], [56816]. Props artemiosans, jameskoster, SantosGuillamot, aristath, czapla, joen, afercia, richtabor, peterwilsoncc, andraganescu, hellofromTonya, siobhyb. See #59411. Built from https://develop.svn.wordpress.org/trunk@56961 git-svn-id: https://core.svn.wordpress.org/trunk@56472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Only suppresses the display of notices on the widget block editor screen if JavaScript is available.
Fixes #55384
Note: The PHP Unit tests are failing in
WP_Directive_Processor_Test
, it doesn't seem related so I am ignoring the problem for now.Why?
In WP-r56671 a notice was added to the widget screen indicating that JavaScript is required. This notice needs to be visible if JavaScript is unavailable.
How?
It adds
.js
as a parent selector to the CSS suppressing notices. WordPress adds the class to the body element if JS is available.https://github.com/WordPress/wordpress-develop/blob/6837a90e49e82192224472ac35fe2a9cc7a9e2ac/src/wp-admin/admin-header.php#L247
Testing Instructions
In Firefox and Chrome closing the dev tools should renable JavaScript.
Testing Instructions for Keyboard
Screenshots or screencast