openpencil/crates
Fini ff72774385 feat(ai): inject role defaults (role-resolver I2)
Second increment of the role-resolver port. New `role_defaults` module ports
all 43 `registerRole` rules from role-definitions/index.ts + `applyDefaults` +
`detectThemeFromNode`. `resolve_tree_roles` now, after inferring a node's role
(I1), fills in that role's default visual/layout properties — theme-aware
(card/input/navbar/divider fills), parent-aware (cards stretch in a horizontal
row), and canvas-width-aware (mobile vs desktop padding).

Defaults are applied via a JSON round-trip merge that sets ONLY keys the model
left unset (AI-explicit always wins), mirroring the TS `record[key] ===
undefined` check; jian's camelCase + flattened container/text props let the
merge map straight onto the schema with no per-field hand-mapping. On any
(de)serialize failure the node is left untouched, so defaults can never drop a
node. Theme + canvas width are derived from the plan's root frame in
run_subtask and threaded down the walk.

The tiny-card guard now applies to EXPLICIT roles too (not just inferred): an
LLM-emitted role:"card"/"stat-card" on a node too small to be a card is stripped
before the defaults pass, so it can't inflate a 6×6 dot into a padded, shadowed
card (Codex review).

29 tests (theme detection, set-if-absent, AI-explicit-wins, theme/parent/
canvas-width variants, CJK typography, divider orientation, explicit+inferred
tiny-card strip, unknown role). Verified on a MiniMax-M3 run: 106 nodes,
search-bars/cards received role defaults, an explicit cornerRadius preserved.
2026-06-06 22:15:08 +08:00
..
op-acp
op-ai
op-ai-skills fix(ai): align subagent format contract on flat _parent 2026-06-06 15:44:02 +08:00
op-app feat(mcp): expand rust editor mcp surface 2026-06-05 22:19:08 +08:00
op-cli fix(ci): handle windows cli paths 2026-06-06 14:26:55 +08:00
op-codegen
op-design-lint Merge branch 'v0.8.0-new' of github.com:ZSeven-W/openpencil into v0.8.0-new 2026-05-24 13:03:26 +08:00
op-editor-core fix(canvas): keep auto-layout children in flow 2026-06-06 12:16:12 +08:00
op-editor-ui fix(ci): isolate deep layer fixture stack 2026-06-06 14:16:13 +08:00
op-figma fix(ai): read frame image search queries 2026-05-31 00:25:52 +08:00
op-git feat(panels): git-panel commit-detail diff, overflow menu, signature form 2026-06-02 09:42:03 +08:00
op-host-desktop feat(ai): disable MiniMax thinking for design subtasks 2026-06-06 15:44:14 +08:00
op-host-native fix(ci): isolate deep layer fixture stack 2026-06-06 14:16:13 +08:00
op-host-web fix(canvas): keep auto-layout children in flow 2026-06-06 12:16:12 +08:00
op-i18n feat(editor): add boolean exclude operation 2026-06-02 09:41:38 +08:00
op-mcp fix(mcp): resolve fit-content text bounds 2026-06-06 11:32:10 +08:00
op-opmerge
op-orchestrator feat(ai): inject role defaults (role-resolver I2) 2026-06-06 22:15:08 +08:00
op-pen-loader fix(mcp): resolve fit-content text bounds 2026-06-06 11:32:10 +08:00
op-smoke test(ai): add direct-client headless benchmark harness to op-smoke 2026-06-06 15:45:37 +08:00
wasm-libc-shim feat(mcp): expand rust editor mcp surface 2026-06-05 22:19:08 +08:00
CLAUDE.md