openpencil/packages/pen-core/src/layout
Fini 5755c8cd88 fix(pen-core): preserve cornerRadius on media-clipping frames
Codex stop-hook on the prior strip-nested-card-decoration commit
caught a regression: cornerRadius on a media-clipping frame
(`clipContent: true` wrapping an image / video, or roles like
`image-placeholder` / `thumbnail` / `cover-image`) is doing the
rounding work for the photo, not stacking card decoration. Blanket
stripping un-rounded the media against the user's clear intent —
typical pattern is

  card { cornerRadius: 16, clipContent: true }
   └─ image-placeholder { cornerRadius: 12, clipContent: true }
       └─ image

where the inner cornerRadius rounds the photo and the outer rounds
the card frame around it. After the prior pass the inner radius got
stripped (ancestor had cornerRadius too) → square corners on the
photo.

New `MEDIA_CLIP_ROLES` set + `isMediaClipper(node)` helper:
  - role match: image, image-card, image-placeholder, video,
    video-placeholder, media, media-thumbnail, thumbnail, cover,
    cover-image, gallery-item
  - shape match: clipContent: true AND has a direct image / video /
    media-roled child

Either signal preserves cornerRadius. Other decorations (stroke,
shadow) still get stripped — those ARE redundant card decoration
even on a media wrapper, since the photo's own outline + the
ancestor card already provide the visual frame.

Tests: 2 new cases — clipContent + image, and the role-only path
covering image-placeholder / thumbnail / cover-image / gallery-item.
2026-05-11 00:23:08 +08:00
..
clip-card-image-corners.ts fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill 2026-05-09 21:42:00 +08:00
convert-stacked-overlay-to-absolute.ts Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
engine.ts Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
expand-overflowing-fixed-height-cards.ts Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
inject-nav-surface-fill.ts Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
normalize-tree.ts fix(canvas): require explicit role:'overlay' for layout-flow escape hatch 2026-04-16 21:07:40 +08:00
strip-nested-card-decoration.ts fix(pen-core): preserve cornerRadius on media-clipping frames 2026-05-11 00:23:08 +08:00
strip-redundant-section-fills.ts fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill 2026-05-09 21:42:00 +08:00
text-measure.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
unwrap-fake-phone-mockup.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00