Problem/Motivation

There are some hardcoded blocks which can't be placed, I think for display_builder_page_layout, this will be a blocker, src/Plugin/display_builder/Island/BlockLibraryPanel.php:

private const HIDE_BLOCK = [
  'help_block',
  'system_messages_block',
  'htmx_loader',
  'broken',
  'system_main_block',
  'page_title_block',
];

1: The help and system message should be available, either as blocks or as slot sources.
2: Currently the local tasks is implemented as a slot source (modules/display_builder_page_layout/src/Plugin/UiPatterns/Source/LocalTasksSource.php), the problem is that that way it does not obtain the config form from core/lib/Drupal/Core/Menu/Plugin/Block/LocalTasksBlock.php, so maybe need to make the local tasks available as block and no more slot source?
3: why local actions and local tasks, and page title slot source had been put into display_builder_page_layout? I understand that for main page content, but for the other they could theorically be used into entity view display or view, so why not move it into the main module?
4: module categories not appearing, see dedicated comment

Proposed resolution

Test to have blocks instead of slot sources.

Remaining tasks

User interface changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

grimreaper created an issue. See original summary.

grimreaper’s picture

grimreaper’s picture

Issue summary: View changes

Adding a feedback about block categories not respected.

Currently there are the following categories:
- the slot sources blocks
- Content management (from Dashboard module)
- List (Views)
- Menus
- Others

While on block layout when adding a block I see other categories:
- Chaos Tools
- Content block
- Sitemap
- System
- UI Patterns: I guess for those one it is normal as there is the Components library
- Webform
- etc.

I know that by default when a block plugin does not declare an explicit category, it fallback to the module providing the plugin. So maybe for some plugins it is that, but I have custom block plugins with explicit category not matching the providing module machine name and the category does not appear explicitly.

grimreaper’s picture

Provided a draft for last point.

grimreaper’s picture

Status: Active » Needs work
StatusFileSize
new47.7 KB

In display builder settings, only save enabled options. Example with exclude where no checkboxes checks but changes in the config.

See screenshot.

mogtofu33 made their first commit to this issue’s fork.

mogtofu33’s picture

Added a fix to not store empty values for exclude (and status).

Moved the choices group part of block as a helper because it was pretty hard to understand. Added a Unit test on it.
I changed the groups process with some new ones, and no more empty, with an arbitrary weight. @grimreaper if you can quickly review that it's still ok with your blocks? I put unknown at the bottom but perhaps could be higher.

grimreaper’s picture

Assigned: Unassigned » grimreaper

Thank! assigning I will test tomorrow

grimreaper’s picture

Assigned: grimreaper » Unassigned

That's way better!

I think other improvements could come later, no hurry.

grimreaper’s picture

Got warnings with block preview.

Maybe that's why it was disabled.

mogtofu33’s picture

Cannot reproduce on the navigation menu block, I guess its "Main Navigation"?
If so any other contrib module doing something on the menu block?
As you can see in the backtrace I don't really handle the render, UI Patterns is doing, perhaps there is some options missing as we have none for preview.

mogtofu33’s picture

Will merge the current work as it seems ok and keep the MR open for the follow up.
Will need an other fork for next work.

mogtofu33 changed the visibility of the branch 3547972-block-library-feedbacks to hidden.

pdureau’s picture

Status: Needs work » Postponed (maintainer needs more info)

What left do we need to do?

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

Status: Postponed (maintainer needs more info) » Needs work

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs work » Needs review
pdureau’s picture

Assigned: Unassigned » pdureau

Let's wait #3556521: Allows special blocks is merged before merging this one.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs review » Needs work

It seems to work well everywhere... but in /admin/structure/page-layout/{page_layout}/builder where I get:

Warning: Undefined array key "#display" in Drupal\Core\Render\Element\StatusMessages::generatePlaceholder() (line 54 of core/lib/Drupal/Core/Render/Element/StatusMessages.php).

Restoring this in DisplayBuilderPageVariant doesn't help:

      'content' => [
        'status_messages' => [
          '#type' => 'status_messages',
          '#weight' => -1000,
          '#include_fallback' => TRUE,
        ],

Also, "Messages" block don't generate a placeholder when rendered empty.

grimreaper’s picture

Hello,

As seen together, I do not reproduce the warning.

And messages block is never empty, there is a placeholder div in case JS generates messages.

pdureau’s picture

Assigned: Unassigned » pdureau
grimreaper’s picture

Assigned: pdureau » grimreaper
grimreaper’s picture

Assigned: grimreaper » Unassigned

Seen together, the remaining bug of Pierre was from an outdated version of ui_styles.

pdureau’s picture

Assigned: Unassigned » pdureau
pdureau’s picture

Assigned: pdureau » mogtofu33
Status: Needs work » Needs review
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Needs work
grimreaper’s picture

Status: Needs work » Needs review
pdureau’s picture

Assigned: Unassigned » mogtofu33

I will create a dedicated issue for beta2

pdureau’s picture

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.