feat(detail): detail.stageField:false 关闭自动状态进度条#2066
Closed
baozhoutao wants to merge 2 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
detectStatusField() now returns null when an object def declares stageField: false (or null), suppressing the auto record:path stepper and skipping name/type-based detection. Lets non-linear status picklists hide the inappropriate ordered stepper. Default behavior unchanged. Closes #2065
The status-path opt-out must live where authors can actually set it. The spec's
ObjectSchema.create() rejects unknown top-level keys (NoExcessObjectKeys ->
never + build error), so a bare top-level `stageField` is unreachable on a
spec-authored object. The spec already exposes a `.passthrough()` `detail`
block documented as 'Detail-page UI hints consumed by @object-ui/plugin-detail
synth' — read the hint from `def.detail?.stageField` (author-reachable),
falling back to top-level `def.stageField` for raw/duck-typed defs.
Authors opt out via `detail: { stageField: false }`; `detail: { stageField:
'field' }` selects the path field. objectui-only; no framework change (the
detail block's passthrough already admits the key). Default behavior unchanged.
Closes #2065
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.
问题
详情/记录页 synth 会自动在记录顶部渲染有序状态进度条(
record:path)。判定逻辑detectStatusField()在没有显式 stage 提示时,会按名(status/stage/state/phase)或按类型自动命中一个字段。很多对象的
status其实是非线性 picklist(正常 / 暂停 / 作废),被强行渲染成有序进度条,语义与视觉都不对,且用户无法关闭。方案(已修正承载位置)
spec 的
object.zod.ts有一个.passthrough()的detail块,描述就是 "Detail-page UI hints consumed by @object-ui/plugin-detail synth"(已有renderViaSchema/hideReferenceRail/hideRelatedTab)。它是作者可达的 UI 提示落点。detectStatusField()改读def.detail?.stageField,顶层def.stageField保留为裸对象/单测的 back-compat 回退。detail: { stageField: false }(或null)→ 不渲染进度条,跳过自动探测;detail: { stageField: 'my_field' }→ 指定进度条字段。detail块本身就是.passthrough(),该键无需进 framework spec 即可合法通过校验并透传到客户端。默认行为零回归。测试
type-check:通过detail.stageFieldopt-out / 选字段、detail优先于顶层、顶层 back-compat、detail无 stageField 时回退等用例)Closes #2065