fix: #3636787 The sign-in page renders no h1 since Display Builder 1.0.0-beta10

Summary

The sign-in screens that a Display Builder page layout draws have no h1 since Display Builder 1.0.0-beta10. The page layout now puts the page title in a level 1 heading, as the Display Builder release notes say.

Issue: https://www.drupal.org/node/3636787

Root cause

Display Builder 1.0.0-beta10 prints the page title source as the title text only, no longer in <h1 class="page-title"> (upstream issue 3621589). The sign-in page layout of the theme placed that source straight in the title slot of uikit_admin:sign_in, so the screen lost its h1. 02-09-01-display-builder.feature:17 failed with Expected 1 <h1>, found 0. in webship-js-test 3/3 on the pipeline of MR 17, an unrelated change to the suite.

The sign_in component prints its title slot as it is given, and its description said the page title block prints the h1. That holds for the regular screens, not for a page layout.

What changed

  • config/optional/display_builder_page_layout.page_layout.uikit_admin_sign_in.yml: uikit_admin:heading (heading_level: 1) in the title slot of uikit_admin:sign_in, with the page title in its title slot. The h1 sits inside .uikit-admin-sign-in__title, so .uikit-admin-sign-in__title h1 styles it as before, and the title text is unchanged.
  • uikit_admin.post_update.php, src/PageTitleHeading.php: uikit_admin_post_update_sign_in_page_title_heading() puts the page title placed straight in the title slot of an installed uikit_admin_sign_in layout in the heading. The layout is saved as a configuration import, so Display Builder makes it the present state of the builder too. It does nothing when the layout or Display Builder is missing, and a second run changes nothing.
  • composer.json: conflicts with drupal/display_builder before 1.0.0-beta10, whose page title prints an h1 of its own: the heading would nest a second one.
  • tests/features/02-09-01-display-builder.feature: the scenario also checks the title text in .uikit-admin-sign-in__title h1.
  • components/sign_in/sign_in.component.yml, components/sign_in/sign_in.twig, README.md: how a page layout places the page title.

The sign_in component does not wrap its slot in an h1 itself: the regular sign-in screens (no page layout) pass it the h1 of the page title block, so the component would print two. The other components that take a title, admin_topbar and admin_page, are left out of the component library of both Display Builder profiles and get their title from the page title block, so no other page layout of the theme is affected.

Testing

On a local site with the versions of the pipeline (Drupal 11.4.8, PHP 8.4, Display Builder 1.0.0-beta10, UI Patterns 2.0.23, UI Skins 1.2.1):

  • The old layout configuration fails 02-09-01-display-builder.feature:17 with the error above. With this change the feature passes (3 scenarios, 30 steps).
  • drush updb runs the post update on a site that had installed the old layout: the layout then equals the shipped one, /user/login prints one h1, and a second run changes nothing.
  • The regular sign-in screens still print one h1: 01-03-01-accessibility, 01-04-01-sign-in, 01-04-02-sign-in-options and 01-04-03-sign-in-states pass (42 scenarios, 470 steps).
  • phpcs (Drupal ruleset), phpstan (level 0), parallel-lint and composer validate report nothing on the theme. Composer refuses drupal/display_builder 1.0.0-beta9 next to the theme and accepts 1.0.0-beta10.

The pipeline of this MR is the check on the whole suite.

AI-Generated: Yes (theme fix)

Checkpoints:

  • File an issue
  • Addition/Change/Update/Fix
  • Testing to ensure no regression
  • Automated unit testing coverage
  • Automated functional testing coverage
  • UX/UI designer responsibilities
  • Readability
  • Accessibility
  • Performance
  • Security
  • Developer Documentation
  • User Guide Documentation
  • Reviewed by human
  • Code review by maintainers
  • Full testing and approval
  • Credit contributors
  • Review with the product owner
  • Release notes snippet
  • Release
Edited by Rajab Natshah

Merge request reports

Loading
Loading