Skip to content

feat: block menus follow the shared menu parity fixture - #37

Merged
ABB65 merged 2 commits into
mainfrom
feat/menu-parity
Sep 25, 2026
Merged

ABB65 merged 2 commits into
mainfrom
feat/menu-parity

Conversation

@ABB65

@ABB65 ABB65 commented Sep 25, 2026

Copy link
Copy Markdown
Member

Copies contentrain-menu-parity@1 from Contentrain/ai #299 (pinned to its head 824937c; re-pinned to the merged main commit once #299 merges) and runs every case through Menus::from_blocks (tests/menu-parity.php, included by integration.php). 8/8 locally, 310 checks.

Aligned with wp-import's rules:

  • a left-out link's children move up to its parent (was: the whole subtree dropped, uncounted)
  • page list: public pages as a tree under parentPageID, by menu order then title (was: flat, every page)
  • site-relative addresses made absolute; # stays #
  • labels: tags stripped, entities decoded, whitespace collapsed
  • navigation slug: its own, navigation-<id> without one, -nav while a classic menu has it
  • an empty home-link label is Home

Menus::target() takes an optional lookup (post, term) and from_blocks() optional pages, so the fixture stands in for WordPress; the default is the site as before. Draft navigations passed in are ignored and navigations are ordered by id.

tests/menu-parity.php runs every case of contentrain-menu-parity@1
(copied from Contentrain/ai #299, pinned) through Menus::from_blocks,
with the fixture's public posts, terms and pages standing in for the
site. Aligned with wp-import: a left-out link's children move up to its
parent; a page list is a tree under parentPageID, by menu order then
title; site-relative addresses are absolute; labels have tags stripped
and entities decoded; a navigation keeps its own slug (navigation-<id>
without one), suffixed -nav while a classic menu has it; an empty home
link label is Home. target() takes a lookup so the fixture can stand in
for WordPress.
@ABB65

ABB65 commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

t6 QA — Bridge #37 (6f9c829): ONAY, bir birleşme koşuluyla

  • Fixture ai #299'un başındaki (ede0844) dosyayla bayt bayt aynı. menu-parity.php 8 vakanın hepsini from_blocks üzerinden koşuyor, CI yeşil.
  • Güvenlik:
    • Herkese açık olmayan bir post'ta $public false, öğe düşüyor ve alt öğeleri yukarı taşınıyor. Bir taslağın adresi menüye taşınmıyor.
    • wp_lookup link'i yalnız public post için üretiyor.
    • public_pages yalnız yayında ve parolasız sayfaları alıyor. Taslak ya da parolalı bir üst sayfanın altındaki sayfalar ağaçta hiç görünmüyor (fail-closed).
    • Taslak wp_navigation artık filtrede kalıyor.
  • Parity kuralları wp-import ile aynı: slug -nav kuralı, site-göreli adresin mutlaklaştırılması, label'da etiket ve entity temizliği.

Birleşme koşulu: menu-parity.pin şu an 824937c'yi gösteriyor. Bu, #299'un ilk commit'i; main'de değil ve squash sonrası dalla birlikte kaybolacak. Dosyanın kendi kuralı da "merged main commit". #299 birleşince pin main SHA'sına güncellenmeli ve fixture farkı sıfır olarak yeniden doğrulanmalı. Sonra birleştir.

Not (bloklamıyor): label() entity'leri çözüyor (&lt;b&gt; → <b>). Export JSON'da bu metin olarak kalıyor ve Astro metni kaçırdığı için sorun yok, wp-import da aynı şeyi yapıyor. Tüketici tarafında set:html ile basılmaması gerekiyor.

@ABB65

ABB65 commented Sep 25, 2026

Copy link
Copy Markdown
Member Author

t6 QA — Bridge #37 19d283b: koşul karşılandı, ONAY. menu-parity.pin → 09be01c (ai #299 merge, main'de). Fixture o commit'teki dosyayla bayt bayt aynı.

@ABB65
ABB65 merged commit 5058fa0 into main Sep 25, 2026
9 checks passed
@ABB65
ABB65 deleted the feat/menu-parity branch September 25, 2026 22:13
@ABB65 ABB65 mentioned this pull request Sep 27, 2026
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