openpencil/apps/web/src/canvas
Fini 5112bea716 fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill
Why: 2026-05-10 user report — "你看不到任何真正的生产级设计工具的希望"
called out three persistent visible issues with the food-app design:

  1. Search bar shows a "weird inner rounded border" (image 7) — the
     wrapper around address+search section sets fill + stroke +
     cornerRadius together. strip-redundant-section-fills only cleared
     the fill; the leftover stroke + cornerRadius kept drawing the
     visible inner pill, which has been there for a long time.

  2. Card image has all 4 corners rounded (image 8) — Taco Fiesta /
     Bella Italia cards show the food image with bottom corners
     rounded too, leaving them visually "ragged" against the title
     text below that's flush with the card surface.

(The third — Categories padding — is a layout/intent question; left
for later since it can't be auto-fixed safely without knowing whether
the design wants edge-to-edge content.)

What — two coordinated fixes:

  Fix #1: strip-redundant-section-fills now removes stroke and
  cornerRadius alongside the fill. A misroll wrapper sets all three
  together to "look like a card"; the fill gets stripped on detection
  but the leftover chrome kept drawing a phantom card outline. The
  three travel together so they should be cleared together. New test
  pins the search-bar wrapper case.

  Fix #2: new clipCardImageCorners pass in pen-core. When a card-shape
  parent (scalar cornerRadius > 0, 2+ children, first child is an
  image or canonical image-placeholder, image has its own scalar
  cornerRadius) is detected, set parent.clipContent = true and remove
  the image's scalar cornerRadius. The card's own corner clip then
  cleanly handles the image — top corners round with the card, bottom
  corners flush against the title below. 9 unit tests pin the
  conservative match policy (silent on standalone image, title-first
  card, array-form cornerRadius, cornerRadius:0, no image
  cornerRadius, nested cards, existing clipContent).

Wired into applyPostStreamingTreeHeuristics right after
unwrapFakePhoneMockups. 1448 / 1448 pen-core tests pass (was 1438; +10);
1110 / 1110 AI service tests still pass.
2026-05-09 21:42:00 +08:00
..
__tests__ V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
skia Merge feat/rust-ification into v0.8.0 (Step 0 Rust workspace bootstrap) 2026-05-04 21:00:00 +08:00
agent-indicator.ts V0.7.3 (#111) 2026-04-15 22:19:12 +08:00
canvas-constants.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas-document-sync.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas-layout-engine.ts fix(ai): clean card-image corners + strip wrapper stroke/cornerRadius with fill 2026-05-09 21:42:00 +08:00
canvas-node-creator.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas-sync-lock.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas-sync-utils.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas-text-measure.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
insertion-indicator.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
node-helpers.ts fix(canvas): require explicit role:'overlay' for layout-flow escape hatch 2026-04-16 21:07:40 +08:00
selection-context.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
skia-engine-ref.ts V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
use-layout-indicator.ts V0.5.0 (#67) 2026-03-22 09:44:04 +08:00