Skip to content

Normalize navigation labels for block validity#132

Merged
chubes4 merged 1 commit into
trunkfrom
fix-nav-semantic-parity-wave2
Jun 25, 2026
Merged

Normalize navigation labels for block validity#132
chubes4 merged 1 commit into
trunkfrom
fix-nav-semantic-parity-wave2

Conversation

@chubes4

@chubes4 chubes4 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Normalize HTML navigation labels before serializing core/navigation-link and core/navigation-submenu blocks.
  • Strip block-level wrapper tags and empty aria-hidden icon elements from navigation labels, matching the existing button label normalization behavior.
  • Add contract coverage for direct nav links, submenu labels, and nested nav links sourced from block-level label markup.

Matrix cluster summary

  • Missing core/navigation representation: 20 findings across header/footer/sidebar/main nav landmarks.
  • Navigation item count mismatch: 27 findings across ul/li/a, direct nav > a, footer/sidebar navs, and nested menus.
  • Nav landmark under-representation: 12 findings where source nav landmarks exceed generated core navigation blocks.
  • Item label/URL mismatch: 2 findings.
  • Navigation block validity: 5 findings from block-level markup inside serialized link labels.
  • Mobile drawer/runtime duplication also appears through runtime target diagnostics and existing dedupe coverage, but was not the smallest safe fix here.

Chosen fix

The clearest small, generic, high-confidence fix is navigation label normalization. It directly targets the wp_block_validity_navigation_block_level_link_markup history without fixture selectors and improves generated navigation validity for direct links, list menus, and nested submenu labels.

Verification

  • composer test

Expected matrix impact

  • Expected to clear or reduce the 5 navigation block validity findings with reason: Serialized link text contains block-level markup that WordPress static link blocks do not save as valid inline RichText.
  • Not expected to materially change missing menu, item count mismatch, or landmark mismatch buckets; those need broader navigation recognition/projection work.

AI assistance

  • AI assistance: Yes
  • Tool(s): openai/gpt-5.5 via OpenCode
  • Used for: Finding packet clustering, implementation, regression test drafting, and verification.

@chubes4 chubes4 merged commit ced0b85 into trunk Jun 25, 2026
1 check passed
@chubes4 chubes4 deleted the fix-nav-semantic-parity-wave2 branch June 25, 2026 19:31
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.

1 participant