openpencil/apps/web/src
Fini 8f35361518 test(ai): extract Type 0 unwrap predicate as pure helper + 10 tests
Why: dd8eb0eb's unwrap pass (Type 0 single-component section root
hoist) was integration-tested via the live Playwright run but had no
unit coverage. The integration test won't catch regressions when
someone tightens the heuristics — and the load-bearing "do nothing"
guards (multi-section, mobile screen, desktop, 0/N children, non-frame
child) are exactly where a careless edit would silently flatten a
multi-page design.

What: split the helper into two — a pure predicate
shouldUnwrapSingleComponentSectionRoot(plan, root) returning bool, and
the existing unwrapSingleComponentSectionRoot(rootNodes, plan) which
calls the predicate then mutates the store. Predicate is exported.

10 new tests cover:
- 3 positive: wrapper id ends -root / wrapper id ends -section /
  wrapper name copies parent name
- 7 negative load-bearing guards: multi-section plan, mobile screen
  (height >= 480), desktop (width > 480), root with 0 children, root
  with multi children, wrapper with no children, wrapper with
  unrelated id+name, wrapper is non-frame (text / icon)

1080 / 1080 AI tests pass (was 1070; +10).
2026-05-09 20:59:36 +08:00
..
__tests__ V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
canvas Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
components Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
constants V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
hooks V0.7.3 (#111) 2026-04-15 22:19:12 +08:00
i18n V0.7.1 (#102) 2026-04-13 21:30:23 +08:00
lib fix(ai): refresh DeepSeek defaults to v4 model series 2026-04-26 06:29:53 +08:00
routes V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
services test(ai): extract Type 0 unwrap predicate as pure helper + 10 tests 2026-05-09 20:59:36 +08:00
stores Merge origin/v0.8.0 into feat/rust-ification 2026-05-03 21:00:00 +08:00
types V0.7.2-bugfix (#109) 2026-04-14 21:42:56 +08:00
uikit V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
utils Merge branch 'v0.8.0' of github.com:ZSeven-W/openpencil into v0.8.0 2026-05-05 22:51:00 +08:00
variables V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
router.tsx V0.7.0 (#95) 2026-04-11 23:25:13 +08:00
routeTree.gen.ts V0.5.0 (#67) 2026-03-22 09:44:04 +08:00
styles.css V0.7.0 (#95) 2026-04-11 23:25:13 +08:00