fix(php-transformer): carry social icon color into shared header parts - #2240
Merged
Merged
Conversation
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.
Problem
After #2234, uniformly coloured social icons in page content render with the authored colour, but a shared header extracted to a template part still emits
core/social-linkswithouticonColorValue. Pages that use that part keep core's per-service brand colours.Root cause
The colour carry reads a monochrome glyph from asset metadata keyed for the compiling document. A root-relative icon URL matches that map on the entry document, whose directory is the web root, and misses it on every nested document. Shared-shell extraction then takes the dominant nested-page header, so the template part never receives the colour. Isolated shared-shell compilation also never received the payload reader the page path uses to sample referenced glyphs. Placeholder icons in the extracted header (a 1×1 stand-in for the same destination) had no local pixels to sample even when the real glyph was elsewhere in the document.
Fix
Extend the existing glyph-colour primitive, without a second mechanism:
Regression test
php tests/unit/social-links-icon-color.phpFails before the fix:
Passes after:
The added cases cover an embedded root-relative glyph, placeholder icons that share a destination with a real glyph, and a payload-referenced staged import. Mixed icon colours still leave core service colours alone.
Verification
Fresh import of the private capture with Static Site Importer
origin/main@ 6f0eff4 and this branch @ 6424fc2. The dev-package ZIP vendors the change (sameDestinationGlyphColor, web-root lookup key, shared-shell payload reader).Inner page that renders the header template part, 1440px, three header icons, 20×24 at x 1248 / 1278 / 1308, y 213 on both sites:
has-icon-colorhas-icon-colorhas-icon-colorSource header icons at the same x positions are 20×20 white glyphs. At 390 both sites collapse the header icons to 0×0; computed colour stays the brand colours on the baseline and
rgb(255, 255, 255)here.parts/header.htmlnow has onewp:social-linkswithiconColorValue#ffffff.Also passed:
php tests/unit/social-links-boundary.php,php tests/contract/shared-shell-plan.php.Fixes #2238
AI disclosure: implemented by xAI Grok 4.7 via OpenCode (
opencode run), orchestrated and reviewed by Claude (Anthropic).