Skip to content

fix(php-transformer): rank menu item displays by specificity for the flow layout - #2780

Merged
ellenbauer merged 1 commit into
trunkfrom
fix/stacked-menu-cascade-display
Oct 14, 2026
Merged

ellenbauer merged 1 commit into
trunkfrom
fix/stacked-menu-cascade-display

Conversation

@ellenbauer

@ellenbauer ellenbauer commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2726. Follow-up to #2742.

What was wrong

#2742 records core's flow layout for a list navigation whose items all declare a block-level display. On the real Dunbar Oaks (Wix) phone menu it does not fire, so "Annual Meetings" and "News & Events" are still cut off.

The check read each item's display with resolvedConditionalDisplay(). That takes the last matching declaration in source order and ignores specificity. The menu items match two device-scoped rules:

  • :where([data-dla-device-document="mobile"]) .BZjmPL>ul li{display:block}, specificity (0,1,2), earlier;
  • :where([data-dla-device-document="mobile"]) .FWN1UT{...;display:flex}, specificity (0,1,0), later.

The browser renders the items as block. The resolver returned flex, so the check saw flex items and core/navigation kept its flex row. The #2742 test missed this because its fixture had no competing weaker item rule.

What changed

  • NavigationPatternContext::cascadeDisplay(): the display from the specificity-ranked cascade over static and applying conditional rules (StyleResolver::controlSurfaceResolvedStyle()). It is a recognition signal only and is never projected, which is what that resolver is documented for.
  • NavigationPattern::withStackedBlockListLayout() reads the host, list and item displays through it.

Tests

  • tests/unit/navigation-stacked-block-list-layout.php now adds the Wix shape, a later and weaker .item{display:flex}, and a flex-items case: 8 assertions. On trunk 4 fail; all pass here.
  • capture-evidence-equivalence: the same nine cases as fix(php-transformer): stack declared block menu items in core flow layout #2742 move their style-rule candidate cache counters again. Replaying them on trunk and on this branch and diffing the normalized output shows no other change. Re-recorded and noted in the README.
  • composer test (memory_limit -1) passes on this branch, rebased on trunk 2a963f0 (v0.40.0).

Evidence on the real page

The Dunbar capture has since been removed from the scratch area, and new captures are on hold while the capture vocabulary changes (#2725), so I could not re-import Dunbar with this branch. What I have:

Regressions

  • Only list navigations whose cascade gives every item a block-level display with no display on the nav or its list change. The capture-evidence corpus (349 cases) shows no output change beyond cache counters.
  • I could not run fresh Studio imports for other sites: the captures here use the old capture vocabulary that trunk no longer reads (refactor: neutral capture vocabulary for Blocks Engine capture evidence #2725), and the current Studio CLI rejects the older importer packages.

Import proof (workbench, new-vocabulary captures)

Studio CLI create --from with the liberation workbench captures (DLA main 569c336). The baseline is SSI v1.31.2 with BE trunk 2a963f0 (wb-*-trunk). The proof package is the same ZIP with #2780, #2781 and #2783 merged on 2a963f0 (ssi-be-proof-2726-combined-e51205f.zip). iPhone user agent at 375; desktop at 1280. Quality gate passed on every import (quality_pass: true, fail_import: false). The proof sites are stopped, not deleted.

  • Dunbar Oaks, trunk (localhost:8952) against proof (localhost:8953), phone menu open:
    • trunk: the nav is display:flex, items are 100px wide at x=165, and "Annual Meetings" and "News & Events" are clipped;
    • proof: the nav is display:block, items are 155px wide at x=110, and all six labels show in full, matching the source.
  • Dunbar at 1280 and at 375 with the menu closed: 0 differing pixels.
  • stevenheaney90, trunk (localhost:8956) against proof (localhost:8957): the same Wix menu nav is now flow instead of flex. It is not visible on that page (no captured dialog), so 1280 shows 0 differing pixels. At 375, one of two screenshot runs is identical; the other differs only in a time-varying block (x 20 to 146, y 1300 to 1422) that also differs between two runs of the same site.

🤖 Generated with Claude Code

…flow layout

The stacked block list check from #2742 read each item's display with
resolvedConditionalDisplay(), which takes the last matching declaration in
source order. On the Wix phone menu that is `.FWN1UT{display:flex}`, which
the browser ranks below the earlier `.BZjmPL>ul li{display:block}`, so the
check saw flex items and core/navigation kept its flex row. The labels stayed
cut off.

Read the host, list and item displays from the specificity-ranked cascade
(static and applying conditional rules) instead. It is a recognition signal
only and is never projected.

Refs #2726

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellenbauer
ellenbauer marked this pull request as ready for review October 14, 2026 06:54
@ellenbauer
ellenbauer merged commit b43ba69 into trunk Oct 14, 2026
22 checks passed
@ellenbauer
ellenbauer deleted the fix/stacked-menu-cascade-display branch October 14, 2026 06:54
@ellenbauer

Copy link
Copy Markdown
Contributor Author

Merged after an independent review (approve). Follow-up to #2742: host, list and item displays are read from the specificity-ranked cascade as a recognition signal only, so Dunbar Oaks' phone menu gets flow layout and all six labels show in full. Import-proven on a fresh new-vocabulary capture: labels 155px wide, 1280 and 375-closed pixel-identical to trunk. Refs #2726. cc @chubes4

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