fix(examples): showcase home page "Create Task" button now carries element:button's inline action - #6737
Merged
Conversation
`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 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F8q5J1MQyocgtNspb15fSn
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-project-manager
marked this pull request as ready for review
August 8, 2026 13:50
os-project-manager
enabled auto-merge
August 8, 2026 13:50
This was referenced Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6597
What changed
One line — the primary CTA of
showcase_component_gallery(the showcase home page) inexamples/app-showcase/src/ui/pages/index.ts:Per the triage ruling: fix the corpus, not the contract. No change to
packages/spec, no change to the renderer, no change to lint. The declaration side (action) and the renderer have agreed all along — this one piece of corpus was the wrong side.I also added a comment explaining the trap itself. The corpus is read by humans and copied by AI authors, so "why
actionand notactionName" is worth more sitting next to the line than sitting in an issue.Precondition: is
showcase_new_taska registered action?Yes.
examples/app-showcase/src/ui/actions/index.ts:177definesNewTaskAction:type: 'modal',objectName: showcase_task,locations: ['global_nav'],refreshAfter: true,target: 'showcase_component_gallery'.But there is a fact here that decides what belongs inside
action, and it needs stating plainly:element:buttoncarries an inline action (InlineActionSchema) — it is not a by-name reference into the action registry. By-name reference isaction:button. The ActionRunner's modal branch readsaction.modal || action.target || action.params?.schema;nameis only an identifier and triggers no registry lookup at all. So thetype/targetwritten inline are the dispatch — they have to be spelled out in full.Which is why I ran both spellings in a real browser instead of copying the registry entry blind:
target: 'showcase_component_gallery'(copy the registry)target: 'showcase_task'(this PR)Copying the registry does "do something" — but a button labelled "Create Task" that wraps the home page inside a dialog creates no task, and this page's own docblock is explicit that it is "a clean welcome landing … and a primary action". A
type: 'modal'action with a stringtargetis resolved by objectui'suseActionModal.resolveModalTargetpage-first, then object;showcase_taskis not the name of any page, so it lands on the object and opens the create form. That is what the label says it does.The registry entry's own
targetpointing atshowcase_component_gallery(the global_nav command-palette "New Task" wraps the home page in a dialog for the same reason) is out of scope here and filed separately as #6739 — deliberately not fixed in this PR.Acceptance evidence: the click was actually run
The card noted this was only ever measured statically, never clicked. It has now been clicked — a real headless-chromium browser driving the showcase booted with
os dev --ui, signed in, at/_console/apps/com.example.showcase/page/showcase_component_gallery.Before (a no-op, matching the issue):
The button renders, is clickable,
disabledis false — and the click fires not a single request: no dialog, no navigation, no error.After:
The dialog is the Task create form (Title* / Project* / Assignee / Status* / Priority / Due Date + Cancel / Create). Filling only Title and pressing Create triggers validation as expected ("Project is required" plus the toast "Please check the highlighted fields: Project"); filling the rest and submitting closes the dialog with a success toast.
Server-side confirmation (not just the UI):
os validatebefore/afterReal run over the showcase corpus,
pnpm --filter @objectstack/example-showcase validate:component-props-unknown-key(this page)The warning that was there before:
After the change the whole corpus has zero
is not a prophits, and the total warning count drops by exactly one (the other 46 are untouched). This is one of the two entries on #5068's list blocking its error upgrade; the other one (theaction.paramsshape) is tracked by #5777 and is not part of this issue.Tests and gates
pnpm --filter @objectstack/example-showcase typecheck→ passpnpm --filter @objectstack/example-showcase test→ 15 files / 154 tests passedpnpm --filter './examples/*' run typecheck→ all Donepnpm lint→ EXIT=0check:*gates enumerated one by one from.github/workflows/lint.yml→ all EXIT=0 (includingcheck:nul-bytes)check:type-check-coverage/check:driver-conformance/check:stall-guard/check:skill-frame-sync/check:skill-compatibility/check:i18n/check:i18n-coverage/check:app-nav-i18n→ all EXIT=0Changeset
None; labelled
skip-changeset.@objectstack/example-showcaseisprivate: trueand is not in thefixedlist of.changeset/config.json— the package publishes nothing, so this PR carries no user-visible release.Generated by Claude Code