Repository navigation
fix(php-transformer): rank menu item displays by specificity for the flow layout - #2780
Merged
Merged
Conversation
…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>
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.phpnow 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:
items=li:flex x6(host and list display empty). WithcascadeDisplay()all six resolve to block and the layout is recorded.rgb(233, 220, 211), but the nav is stilldisplay:flexand the items are 100px wide at x=165, with "Annual Meetings" and "News & Events" clipped.Regressions
Import proof (workbench, new-vocabulary captures)
Studio CLI
create --fromwith 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.display:flex, items are 100px wide at x=165, and "Annual Meetings" and "News & Events" are clipped;display:block, items are 155px wide at x=110, and all six labels show in full, matching the source.🤖 Generated with Claude Code