Skip to content

Consider displaying block errors in list view #41747

Open

Description

@jameskoster

Occasionally blocks exist on the canvas that will not render for one reason or another. It was discussed in other issues (#40617) whether we should omit incompatible blocks automatically, but that is tricky because incompatible blocks can be inserted indirectly, like copy/pasting a pattern.

Currently there is no consistent way to handle erroring blocks. Blocks in core tend to throw an error in lieu of their intended rendering:

There are a couple of problems with this:

  1. Blocks can occupy small spaces, and trying to fit a long error message into such a space can really mess with the layout and overall editing experience. Especially if there are many erroring blocks.
  2. Depending on the theme, it's not always clear at a glance whether the error is a legitimate part of the design or not.

As an alternative we might consider highlighting errors in List View:

Screenshot 2022-06-15 at 13 16 03

Here we can style rows to indicate errors (IE make them red), and have space to include a message. The button in the top bar can indicate how many errors there are at a glance.

cc @WordPress/gutenberg-design @ockham @c4rl0sbr4v0

Activity

  1. added
    [Type] Enhancement
    Needs Design Feedback
    [Feature] List View
    Needs Design
    on Jun 15, 2022
  2. ockham commented on Jun 15, 2022

    @ockham
    Contributor

    Thanks @jameskoster, I quite like this! 🙌 Just to clarify, would we still indicate somehow in the canvas that there is an error with a given block (e.g. by greying them out or adding a red border or something to that effect)?

    Also, would the pattern you suggest be amenable to adding buttons to resolve a given error (when possible), as discussed in #40614 and explored in #41603?

  3. jameskoster commented on Jun 15, 2022

    @jameskoster
    ContributorAuthor

    Just to clarify, would we still indicate somehow in the canvas that there is an error with a given block

    Good question. I think anything we do on the canvas is going to be afflicted by the two points above, which makes it tricky. As an alternative could we use a Snackbar to alert the user when an incompatible block has been inserted, and include an action to open List View to investigate?

    Otherwise I'm inclined to say it doesn't matter too much. It seems more important that the backend / frontend are matching, which hiding the 'broken' blocks will accomplish.

    Where there any flows in particular that you had in mind?

    Also, would the pattern you suggest be amenable to adding buttons to resolve a given error

    In most cases I expect the resolution would be to remove the block, which is already possible within the list view UI. I suppose we'd need to figure out a list of potential actions to determine whether the design can / should accommodate them.

  4. ockham commented on Jun 16, 2022

    @ockham
    Contributor

    In most cases I expect the resolution would be to remove the block, which is already possible within the list view UI. I suppose we'd need to figure out a list of potential actions to determine whether the design can / should accommodate them.

    So for the blocks that prompted me to file #40614 and #40617, the underlying problem is typically a post-specific or site-wide setting that would cause the block not to be rendered in the frontend, e.g.:

    In those cases, I thought it would make sense to offer the user an "easy fix" -- a button that would change the underlying setting (here: enable avatars site-wide, or enable commenting for the given post, respectively) so that the relevant block will be shown -- rather than suggesting them to remove the block altogether. (If their intent was to have the block there in the first place, it'd be otherwise more complicated to restore it -- they'd need to find the relevant setting, change it, and then come back to re-insert the block.)

  5. jameskoster commented on Jun 17, 2022

    @jameskoster
    ContributorAuthor

    Thanks for sharing the examples. Yeah I agree it seems fair to include actions like beneath the description for situations like these.

    Such examples also make me wonder whether there should be a severity factor applied to the errors. These feel more like warnings as the blocks are not broken per se.

    I'm also thinking we might use Snackbars as feedback upon insertion of blocks with errors / warnings.

    warning.mp4
  6. ockham commented on Jun 17, 2022

    @ockham
    Contributor

    Thanks James for this latest iteration -- looks good to me!

    Such examples also make me wonder whether there should be a severity factor applied to the errors. These feel more like warnings as the blocks are not broken per se.

    Sounds like a good idea 👍

    I'm also thinking we might use Snackbars as feedback upon insertion of blocks with errors / warnings.

    Also sounds good!

    Some errors / warnings might occur after the fact, i.e. the block is already part of a post (or template) when a setting is changed. But maybe it's fair to display the snackbar when the user opens the editor the next time? (As long as it's not too many blocks / warnings at once, I guess.)

  7. jameskoster commented on Jun 17, 2022

    @jameskoster
    ContributorAuthor

    Ah yes good point. Disabling comments on a post when the comments form block is already present for example. I think it would be ok to utilise the snackbar there, and to combine multiple errors into a single Snackbar to avoid pollution.

    It's probably something we'd have to feel out through some experimentation. The Snackbar may not even be necessary if we did something with the notification number on the list view button.

  8. jameskoster commented on Nov 8, 2022

    @jameskoster
    ContributorAuthor

    Leaving a note that this could also be a way to alert users to un-configured or empty blocks within a document.

  9. draganescu commented on Aug 30, 2023

    @draganescu
    Contributor

    I think this is a good solution to stop showing messages in the canvas.

    Users of assistive tech would still have to know they have broken or unconfigured blocks, so the blocks should still be "present" and focusable so the problems can be announced. This would make for invisible tabstops, and be a bit confusing in navigation mode as you'd move the caret in places that seem empty. How could we mitigate that visually?

    Also for reasons of cognitive accessibility I think we should stick to snackbars instead of relying solely on the notification count on the list view.

  10. jasmussen commented on Aug 31, 2023

    @jasmussen
    Contributor

    Not just users of assistive technologies, anyone. List view (or document outline) come to mind, but also the pre-publish flow could have a panel that lists unconfigured blocks.

    I'd use the default blueberry unread dot we use in a few other places, though, and consider having levels of error, such as "warning" (markup error, missing plugin) vs. "notice" (smaller issues like missing link or what brought us here, no pages which is harmless but good to know).

    By including it in the pre-publish flow, we not only surface any issues before publishing, we surface it to folks who might not use the list view.

  11. jameskoster commented on Aug 31, 2023

    @jameskoster
    ContributorAuthor

    Agreed on Snackbars, there's a demo including them in this comment.

  12. karmatosed commented on May 31, 2025

    @karmatosed
    Member

    I think moving this out of need design and feedback, to focus just on feedback makes sense. I will adjust the labels and we can always iterate.

  13. removed
    Needs Design
    on May 31, 2025
  14. Mamaduka commented on Jul 16, 2025

    @Mamaduka
    Member

    @jameskoster, @jasmussen, is there a plan to move forward with this?

    I'm asking because I think this placement would be more suitable for document-related warnings/errors, such as multiple main tags.

    I think we can also use the core notices store with a special type for displaying errors/warnings in the List View.

    Screenshot

    Image
  15. jasmussen commented on Jul 16, 2025

    @jasmussen
    Contributor

    IMO there needs to be a "linting" UI in the editor, yes. One that is accessible when you work with the doc, and one that can be resurfaced in the pre-publish flow.

    It needs to be relatively low prominence most of the time, since there won't be errors, and then it needs a bit more visibility when there are, and of course extensibility so that plugins can add types of warnings or recommendations, like even SEO advice or perhaps even grammar. Where that feature lives, it's unclear. I think the List panel as outlined here is a good proposal, but it's not the only one. And I think it needs a fresh design, alas I don't have capacity to help at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design Feedback[Feature] List View[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions