Skip to content

Stop rendering the empty search modal on every page - #458

Merged
jonasdekeukelaere merged 1 commit into
masterfrom
search-modal-h1
Oct 14, 2026
Merged

jonasdekeukelaere merged 1 commit into
masterfrom
search-modal-h1

Conversation

@daphneslootmans

@daphneslootmans daphneslootmans commented Oct 13, 2026 •

Copy link
Copy Markdown

The Bootstrap theme included the search modal on every page. Its visually hidden title is an h1, so every page had a second h1 next to the page heading. Nothing opens the modal and its body is empty.

  • The base template no longer includes the modal. The searchModal block stays available, so a theme or template that needs the modal can override it and include SearchModal.html.twig.
  • The modal title is now an h2, so including the modal never adds a second h1.

🤖 Generated with Claude Code

Summary by Sourcery

Make the Bootstrap search modal opt-in and preserve valid heading hierarchy when it is used.

Bug Fixes:

  • Prevent the unused search modal from being rendered on every Bootstrap-themed page.
  • Avoid adding an extra page-level h1 when the search modal is included.

Enhancements:

  • Keep the search modal available as an opt-in template block for themes and pages that need it.

The Bootstrap theme included the search modal on every page, which added
a second h1 next to the page heading. Nothing opens the modal and its
body is empty, so the base template no longer includes it. The searchModal
block stays available for templates that need the modal.

The modal title is now an h2, so including it never adds a second h1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The Bootstrap base template no longer renders an unused search modal on every page, while retaining an override hook for consumers that need it; the modal title is also changed to h2 to avoid adding a second h1 when included.

Flow diagram for optional search modal rendering

flowchart TD
    BaseTemplate[Bootstrap Base Template] --> SearchModalBlock{searchModal block}
    SearchModalBlock -->|default| NoModal[Render page without search modal]
    SearchModalBlock -->|theme or template override| SearchModal[Include SearchModal.html.twig]
    SearchModal --> ModalHeading[Render modal title as h2]
Loading

File-Level Changes

Change Details Files
Make the search modal opt-in instead of rendering it globally.
  • Leave the searchModal extension block available but empty by default.
  • Document that templates or themes must explicitly include SearchModal.html.twig when needed.
src/Frontend/Themes/Bootstrap/src/Layout/Templates/Base.html.twig
Prevent the modal from introducing an extra top-level heading.
  • Change the visually hidden modal title from h1 to h2 while preserving its styling and accessibility attributes.
src/Frontend/Themes/Bootstrap/src/Layout/Templates/SearchModal.html.twig

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@jonasdekeukelaere
jonasdekeukelaere merged commit 56cb55c into master Oct 14, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants