Conversation
…b.com/ampproject/amp-wp into feature/3821-block-validation-sidebar
…-validation-sidebar
|
This is not ready for review, but I un-Drafted it to trigger the zip build. |
|
@johnwatkins0 the "Lint: JS" job is failing so zip builds won't occur. |
…-validation-sidebar
|
Plugin builds for 96c1a96 are ready 🛎️!
|
9386754 to
28cd8a3
Compare
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
…b.com/ampproject/amp-wp into feature/3821-block-validation-sidebar
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>
I think we can handle this better in the follow-up issue to adding filters and updating the design. @jwold is currently working on the visual design for that.
This is indeed problematic, but I'm not sure of the best solution given that the AMP plugin doesn't know what types of styles the theme might be applying to the editor. Similar issues can occur with core styles also. So I think we can probably leave this one alone.
Done in 1d6a0a3
Fixed in b1a6a11 |
pierlon
left a comment
There was a problem hiding this comment.
This works well so far. The only quirk I found is with the AMP toolbar button, where it can now be used to toggle the error panel in the sidebar. Is that intended? I'd imagine it should only be able to open the error panel.
amp_toolbar_button_click.mp4
Yes, I see what you mean. Updated in 29cf878. The button will only open the error, not close it. |
…821-block-validation-sidebar * 'develop' of github.com:ampproject/amp-wp: (95 commits) Simplify logic to ensure -1 <= limit_per_type <= PHP_INT_MAX Ensure amp_url_validation_limit_per_type filter returns int Mark URLValidationProvider and ScannableURLProvider as internal Guard against empty post ID causing global post to be returned by get_post() Make RecurringBackgroundTask::schedule_event() final Fix ability for BackgroundTaskDeactivator to unschedule hooks Reduce URLValidationCron frequency to daily Remove obsolete test assertion Make CronBasedBackgroundTask non-Conditional Update service name for SavePostValidationEvent and add to PHPSTORM_META Add missing $args to wp_next_scheduled() call after 1419ef4 Switch to google-github-actions/setup-gcloud action Only run PHPStan if there is a modified PHP file Run composer update Ensure alphabetical order for patches in composer.json Use PHPStan ignore for 'cannot cast array to int' Reorder composer.json fields Update param type for phpstan Remove obsolete amp_is_canonical() examples Reorder composer.json fields ...
|
Fixed in ec509b8: |
| <ErrorTypeIcon type={ type } /> | ||
| </div> | ||
| { type && ( | ||
| <div className={ `amp-error__error-type-icon amp-error__error-type-icon--${ type?.replace( /_/g, '-' ) }` }> |
There was a problem hiding this comment.
Optional chaining is unnecessary here since type && ensures it is defined, no?
| <div className={ `amp-error__error-type-icon amp-error__error-type-icon--${ type?.replace( /_/g, '-' ) }` }> | |
| <div className={ `amp-error__error-type-icon amp-error__error-type-icon--${ type.replace( /_/g, '-' ) }` }> |
| <a | ||
| <ExternalLink | ||
| href={ detailsUrl.href } | ||
| target="_blank" |
There was a problem hiding this comment.
Instead of _blank we may want this to be a consistent name like validated-url-post-${ postId } so that each of the View Details links will be routed to the same tab.
| <p> | ||
| { reviewLink && ( | ||
| <a href={ reviewLink } className="amp-sidebar__review-link" target="_blank" rel="noreferrer"> | ||
| <ExternalLink href={ reviewLink } className="amp-sidebar__review-link"> |
There was a problem hiding this comment.
Adding a target per https://github.com/ampproject/amp-wp/pull/5589/files/76171256101db27f82839d3832b3b614bac44534..66666f081bae2e6f2ecde9364cecdfa3caae635b?w=1#r549947592 above may make sense.
Co-authored-by: Pierre Gordon <16200219+pierlon@users.noreply.github.com>


Summary
Fixes #3821
Fixes #3673
On the editor screen, this moves all info about validation errors into a new editor sidebar.
Note: The new
BlockSourcesPHP class is used to get the plugin or theme name responsible for a block (if the block is registered in PHP). It depends on a filter that was introduced in WP 5.5, though, so in older versions of WP the "Source" line falls back to the registered block name (e.g.,contact-form/form) similar to how blocks are currently shown on the URL validation screen. Like this:Checklist