Commit 087af44
fix(examples): showcase 首页 "Create Task" 按钮改用 element:button 的内联 action (#6737)
`showcase_component_gallery` 的主 CTA 之前授权的是 `actionName: 'showcase_new_task'`
—— `ElementButtonPropsSchema` 从未声明这个键。schema 是 strip 模式,parse 直接把它
剥掉;renderer 只读 `props.action`,`handleClick` 第一行就是 `if (!action) return`。
结果是按钮正常渲染、正常可点,点击完全空转:不发请求、不开弹窗、不导航。
`element:button` 携带的是**内联** action(InlineActionSchema),它本来就不是"按名
引用已注册动作"——那是 `action:button`。所以修的是语料这一处,不是契约。
`type: 'modal'` + 字符串 `target` 由 objectui 的 `useActionModal.resolveModalTarget`
先按 page、再按 object 解析;`showcase_task` 不是任何 page 的名字,于是落到对象上,
打开 Task 的新建表单 —— 这才是一个写着 "Create Task" 的按钮该做的事。
Fixes #6597
Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
Co-authored-by: Claude <noreply@anthropic.com>1 parent 15370cd commit 087af44
1 file changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
| |||
0 commit comments