openpencil/packages
Fini 7c553586e9 fix(ai): strip dark hedge fill on container-role wrappers holding 2+ same-role children
Why: 2026-05-10 user report — the food-app "Featured" block landed
with a black background on a cream page. The wrapper had role='card'
AND held 3 restaurant cards each with role='card'. The existing
strip-redundant-section-fills pass treats role='card' as PROTECTED
(cards legitimately own their fills) so the black hedge fill survived.
Visible result: a giant black band between Categories and Popular Near
You that doesn't fit the cream page bg — exactly the "莫名其妙的背景颜色"
issue the user called out.

Root cause: the existing wrapper detection (hasNestedFilledComponent)
only fires for ATOMIC roles (search-bar / button / input / badge /
chip / tag / pill). Container-role wrappers around same-role children
were never matched, so a card-of-cards misroll kept its fill.

What: new hasMultipleSameRoleChildren predicate. Treats a frame as a
section-level wrapper (eligible for safe-dark / safe-light fill
stripping) when ALL of:
  - frame role is in CONTAINER_PROTECTED_ROLES (card / banner /
    pricing-card / feature-card / image-card / testimonial /
    metric-card / gallery-item / phone-mockup)
  - frame has ≥ 2 children with the SAME role
  - existing safe-hex / root-match check still applies

Net effect: the Featured wrapper's #000000 fill is now stripped, the
section inherits the cream page bg as intended, and the 3 inner
restaurant cards keep their own white surface fills (each was
role='card' but only 1 child of the same role per card, so the
predicate is silent on them).

3 new it() cases pin: Featured-block misroll (3 cards inside) gets
stripped, single-same-role-child stays untouched, banner-wrapping-
banners pattern also strips. 25 / 25 strip tests pass (was 22; +3).
1438 / 1438 pen-core tests pass overall.
2026-05-09 21:40:00 +08:00
..
agent-native@e1f90cab96 chore(agent): bump agent-native to v0.4.0 release 2026-04-17 19:04:15 +08:00
pen-acp Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-ai-skills feat(ai-skills): aesthetic-hygiene rules in layout.md (preventive, not just curative) 2026-05-09 21:28:00 +08:00
pen-core fix(ai): strip dark hedge fill on container-role wrappers holding 2+ same-role children 2026-05-09 21:40:00 +08:00
pen-engine Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-figma Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-mcp feat(ai): aesthetic detector — mixed-sibling-padding (mirror cornerRadius rule) 2026-05-09 21:26:00 +08:00
pen-react Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-renderer Merge feat/rust-ification into v0.8.0 (Step 0 Rust workspace bootstrap) 2026-05-04 21:00:00 +08:00
pen-sdk Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
pen-types Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
CLAUDE.md V0.7.0 (#95) 2026-04-11 23:25:13 +08:00