Skip to content

Convert native search clusters and preserve navigation selectors #729

Description

@chubes4

Problem

Static-site header conversion currently loses two related semantic surfaces:

  • constrained search forms are recognized but preserved as core/html, so provider-specific search endpoints and adjacent icon toggles do not become functional native WordPress search
  • list-shaped navigation selectors such as ul.site-menu > li and ul.site-menu > li a are not fully retargeted to the runtime markup emitted by core/navigation, losing menu spacing and typography

The four-page mrfoxtalbot.weebly.com parity fixture demonstrates both gaps. Its header uses a GET /apps/search form with a single q input plus adjacent search/open/close controls, and desktop navigation styles carried by list/item/anchor selectors.

Proposed Direction

  1. Detect a constrained search cluster with one GET query input and optional adjacent search trigger controls.
  2. Convert it to dynamic core/search, using buttonPosition: button-only and buttonUseIcon: true for expandable icon-search patterns.
  3. Treat conversion as an intentional migration from provider-specific search endpoints to native WordPress search (s).
  4. Project accepted source form/input/button selectors onto core search runtime classes.
  5. Retarget source navigation list/item/link selectors onto the corresponding core/navigation runtime structure while preserving combinators, states, media rules, and specificity.
  6. Preserve complex/runtime-dependent search and filter forms as raw HTML.

Acceptance

  • eligible header search clusters render functional native WordPress search with an icon trigger
  • arbitrary forms remain losslessly preserved
  • source navigation typography, casing, item spacing, hover treatment, and responsive rules survive conversion
  • generated blocks validate in the editor
  • existing transformer contracts and parity fixtures pass
  • the four-page Weebly replay shows the repaired header on Home, Services, Team, and Contact

Evidence

  • Search detection currently returns HTML preservation: php-transformer/src/HtmlToBlocks/HtmlTransformer.php:7068-7112
  • Standalone constrained search already emits core/search: php-transformer/src/HtmlToBlocks/HtmlTransformer.php:7117-7163
  • Existing header contract locks the current gap: php-transformer/tests/contract/run.php:1611-1620
  • WordPress core provides icon-only expandable search through the Interactivity API: wp-includes/blocks/search.php

AI assistance

OpenAI gpt-5.6-sol through OpenCode was used to investigate current behavior, inspect the Weebly fixture and WordPress core implementation, and draft this issue. Chris Huber remains responsible for scope and implementation decisions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions