openpencil/packages/pen-core/src
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
..
__tests__ fix(pen-core): preserve cornerRadius on media-clipping frames 2026-05-11 00:23:08 +08:00
element-builders fix(ai): sidebar-nav-v1 also canonicalises wrong-glyph icons via label 2026-05-09 21:34:00 +08:00
layout fix(pen-core): preserve cornerRadius on media-clipping frames 2026-05-11 00:23:08 +08:00
merge V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
normalize Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
variables Merge feat/rust-ification into v0.8.0 (Step 0 Rust workspace bootstrap) 2026-05-04 21:00:00 +08:00
arc-path.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
boolean-ops.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
constants.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
design-md-parser.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
font-utils.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
id.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
index.ts feat(pen-core): strip nested card-style decoration on inner frames 2026-05-11 00:17:02 +08:00
node-helpers.ts fix(types): re-export isBadgeOverlayNode as deprecated alias 2026-04-16 21:09:56 +08:00
normalize.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
path-anchors.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
sync-lock.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
tree-utils.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00