Repository navigation
docs(plugin-view): README 的 13 个 schema 示例按 ObjectView 真读的键面重写 - #5101
Merged
Merged
Conversation
README 里所有未加类型标注的 schema 字面量,用的键 ObjectViewSchema 一个都没 声明、ObjectView 一个都不读:对象名写成 `object`(真名 `objectName`,除 `type` 外唯一必填),并围绕不存在的 `viewMode` 组织了三种「视图模式」叙事,连同 `fields` / `mode` / `recordId` / `fieldConfig` / `nestedFields` / `tabs` / `searchable` / `sortable` / `filters` / `enableDelete` 一并如此。照抄任一示例 即静默渲染不出东西 —— ObjectViewSchema 继承的 BaseSchema 带 `[key: string]: any` 索引签名,excess property 检查整体失效,而这些块又都没有类型标注,连「必填 `objectName` 缺失」这唯一有牙的断言也不触发。 13 个块按声明面重写,每个键落笔前都对渲染器实测过读点:列表类型用 `defaultViewType`(以及 `listViews` / `defaultListView`),原「form view」/ 「detail view」两种叙事的真身是 `layout` 的 drawer/modal/page 单一记录面, 网格与表单配置分别落 `table` / `form`,`onCreate` / `onUpdate` / `onDelete` / `onSubmit` 回调族的真身是 `operations` 布尔开关加 `onNavigate`,工具栏用 `show*` 开关族。示例一律带 `ObjectViewSchema` 标注,使「缺 `objectName`」在 全部 15 个示例上成为编译错误。 三条结构事实直接写明:`dataSource` 是 `ObjectViewProps` 的必填 prop 而非 schema 键;create/edit/read 是同一记录面的内部状态而非可授权的 mode(故 `ObjectViewSchema['form']` omit 掉 `mode`);`ObjectView` 从 `table` / `form` 只转发固定的一组键而非整体透传,README 逐一列出,并写明本路径上的分页键是 `table.pageSize`。 ViewSwitcher / FilterUI / SortUI 三节未动 —— 其键面已逐条比对注册 `inputs`, 本就吻合。 Fixes #5077 Co-authored-by: Claude <noreply@anthropic.com>
Collaborator
Author
|
正文末尾提到的第二张卡已立:#5102 —— 本 PR 里 Generated by Claude Code |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Collaborator
Author
|
PM 验收:ACCEPT(session_01GTRjn8xBqp75dk7kFupVRt,objectui 分片) 实物核验:merge-base 验收要点:
三件套照常:本评论 → undraft → auto-merge(SQUASH)。 Generated by Claude Code |
yinlianghui
marked this pull request as ready for review
August 18, 2026 00:12
os-support-ai
pushed a commit
that referenced
this pull request
Aug 19, 2026
…anded Fixes #5271 objectui#5102 (PR #5274, merged) made ObjectView forward the canonical `table.pagination` / `.selection` / `.filter` / `.sort` on every rendering path, keeping `pageSize` / `selectable` / `defaultFilters` / `defaultSort` as working aliases. The two docs pages PR #5101 (README) and PR #5109 (docs-site mirror) wrote against the pre-#5102 reality — legacy-only — and now teach a stale caveat. Re-teach the canonical spellings as the recommended form without implying the legacy ones stopped working, and state the precedence read directly off the landed `ObjectView.tsx` / `ObjectGrid.tsx`: canonical wins when both are written; an active named view's own filter/sort still outranks anything on `table`; `table.columns` stays out of scope (#5269, still open, grid-path only). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Aug 23, 2026
…tack-ai#5102 landed (objectstack-ai#5289) Fixes objectstack-ai#5271 objectui#5102 (PR objectstack-ai#5274, merged) made ObjectView forward the canonical `table.pagination` / `.selection` / `.filter` / `.sort` on every rendering path, keeping `pageSize` / `selectable` / `defaultFilters` / `defaultSort` as working aliases. The two docs pages PR objectstack-ai#5101 (README) and PR objectstack-ai#5109 (docs-site mirror) wrote against the pre-objectstack-ai#5102 reality — legacy-only — and now teach a stale caveat. Re-teach the canonical spellings as the recommended form without implying the legacy ones stopped working, and state the precedence read directly off the landed `ObjectView.tsx` / `ObjectGrid.tsx`: canonical wins when both are written; an active named view's own filter/sort still outranks anything on `table`; `table.columns` stays out of scope (objectstack-ai#5269, still open, grid-path only). Claude-Session: https://claude.ai/code/session_01RV6yuVCxymHYE16PL9vQkE Co-authored-by: Claude <noreply@anthropic.com>
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 #5077
基线
671c0d320732345584038e45141f7175d044df8e(显式实 sha)。仅动packages/plugin-view/README.md+ 一个 changeset。前提门插曲(先读这一段)
按派发的 cast 感知口径复测卡面读数时,
pagination一格被推翻:src/ObjectView.tsx:1032有pagination: activeView?.pagination ?? (schema as any).pagination,普通
schema\.[A-Za-z_]*grep 看不见。据此停工报告(复测全表见#5077 评论),
PM 裁定取 A(只教声明成员,pagination 落规范位)。
落地时又发现裁定所依据的那条机制本身不成立,如实记录并据实改写:
table: { pagination: { pageSize: 25 } },依据是探针 E编译通过。但探针 E 的 rc=0 不构成读点证据 ——
ObjectViewSchema['table']的类型是
Partial< Omit< ObjectGridSchema, 'type' | 'objectName' > >,而keyof ObjectGridSchema因 BaseSchema 的[key: string]: any退化成string,Omit于是塌成纯索引签名:该类型零声明成员,塞任何键都编译通过(改前探针 H 的
zzzNotAGridKeyrc=0 正是同一原因)。ObjectView构建gridSchema是逐键白名单(:833-848),不读也不转发
table.pagination;本路径上唯一到得了 ObjectGrid 的分页键是table.pageSize(:846)。table.pagination写进 README —— 那会正好复制本卡要修的缺陷(教一个不被读的键)。两处按实测写
table.pageSize,并在 README 写明pageSize在ObjectGridSchema上被标记为 legacy、而本组件不读pagination。这一层已另立卡(见文末),本 PR 不引用其未来方向。
cast 感知逐键复测表
口径 = plain
schema.K+schema['K']+(schema as X).K+ 解构 + 中间变量,全包非测试文件。声明成员集取自构建产物(
checker.getPropertiesOfType= 42,required 仅
objectName/type,index signaturestring -> any),与卡面 ① 逐字一致。object/viewMode/mode/recordId/fieldConfig/nestedFields/tabssearchable/sortable/enableDeleteonCreate/onUpdate/onDelete/onSubmitdataSource(写在 schema 里)ObjectViewProps必填 prop(:145)fieldsschema.fields在SortUI.tsx(sort-ui,出半径)filtersFilterUI.tsx(filter-ui,出半径)pagination:1032,as any)table.pageSize正对照:
objectName21、form26 —— 与卡面 ② 的 20 行计数逐字相同。逐块判定 / 删因表
:26自动注册object+viewModeobjectName+defaultViewType,加类型标注:135Schema API 参考面object/viewMode?/fields?/onCreate?table/form转发键表:212Grid ViewviewMode:'grid'+fields+dataSourcedefaultViewType+table.columns/defaultSortdataSource是 prop:226Form ViewviewMode:'form'+mode:'create'+onSubmitlayout(drawer/modal/page)+form子配置form.mode,mode 是内部状态:243Detail ViewviewMode:'detail'+recordIdnavigation.mode+onNavigate(recordId, mode):257Createmode:'create'+onCreateshowCreate+operations.create;page 布局走onNavigate('new','edit'):272Read/Listpagination:true+searchable+filtersshow*+table.columns/defaultFilters/pageSize,并补listViews/defaultListView示例:287Updatemode:'edit'+recordId+onUpdateoperations.update+layout:303DeleteenableDelete+onDeleteoperations.delete:320ObjectQL 集成dataSource+paginationtable.pageSize:346Field ConfigurationfieldConfigtable.columns+form.fields/sections/customFields:382Nested ObjectsnestedFieldsform.subforms(childObject必填):400Tabs ViewviewMode:'tabs'+tabslistViews+showViewSwitcher+allowCreateViewform.layout无 tabs 取值:153/:172/:193(ViewSwitcher / FilterUI / SortUI)未动,diff 可验。探针读数分层
改前 8 项(A-H)已在 #5077 评论中登记,预判 8/8 命中,此处不重复。改后新增:
declared=true且读点 > 0;table.*4 个、form.*7 个全部在转发白名单内 —— ALL KEYS VERIFIEDtsc --strict --noEmitrc=0objectName⛔ 不拿探针绿冒充键面证据:上表第二行只证明「编译得过」,键面结论一律来自第一行的
读点核对与前述白名单实测。
门
pnpm exec turbo run type-check --concurrency=2:81 successful, 81 totalnode scripts/check-doc-links.mjs:Links are valid across 13 scan roots.node scripts/check-control-bytes.mjs:OK (scanned 4526 tracked text file(s));改动文件另行自扫[\x00-\x08\x0b\x0c\x0e-\x1f]无命中顺带立卡(不在本 PR 修)
(schema as any)从 object-view 节点读 31 个键转发给 renderListView,其中 27 个不是 ObjectViewSchema 声明成员 —— #5091 在 ObjectView 上的同形实例 #5097 ——ObjectView用(schema as any)读 31 个键转发给renderListView,27 个非声明成员(已按 ObjectGrid 用(schema as any)读的 4 个键不在GRID_QUERY_INPUTS里 —— #4648 要消除的「渲染器读得到、声明面否认」在这些键上仍然存在 #5091 同族入决策箱)。table/form声明面塌陷 + 转发白名单钉在 legacy 键上,另立卡见下条评论。Generated by Claude Code