Skip to content

AMP validation error is not displaying at the block level in the Gutenberg editor. #1292

@hellofromtonya

Description

@hellofromtonya

As a user, I expect AMP validation notices to appear on each block that has an AMP issue.

  • AC1: Identify when and why the block level notices do not appear.
  • AC2: Ensure block level validation notices appear on with the block after saving and when the editor is in a clean state.

What we want

An AMP validation error should display at the block level within the Gutenberg editor to provide the user with more information at a granular level.

This is the UI notice we want:

amp-issue-block-level-notification

Noted problems

There are multiple contributing factors for this issue. Here is a list:

  • Gutenberg update changed filter hook name from blocks.BlockEdit to editor.BlockEdit.
  • Gutenberg update changed the block uid property from id to clientId.
  • Block uids go out-of-sync. Witnessed on page/editor load and intermittently.
  • Duplicated blocks cause all block level notices to disappear.
  • The warning notice remains after removing all affected blocks.
  • Both the top level and block level notices remain when turning off AMP on a post, i.e. switching the AMP toggle to off.

Metadata

Metadata

Labels

BugSomething isn't workingRelease

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions