Repository navigation
fix(console): under draft preview a list column on a draft-only field no longer makes the whole list fail - #34936
Conversation
…only Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
plugin-form maps the underscore-private _draftOnly marker onto a field's disabled in ObjectForm and fromObjectSchema; the preview data source still leaves such fields out of every write. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
… the write census Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
…draft preview Under ?preview=draft the list data source answers getObjectSchema with the published document plus each draft-only field marked _draftOnly (the form half's readDraftPreviewObjectSchema). ListView leaves those names out of $select, $expand, $filter and $orderby and out of the Filter and Sort pickers, draws the column empty under its draft label, and notes a filter or sort it left out. The same wrap now covers ObjectDataPage and InterfaceListPage in preview. Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
…s; key the wrapper on its inputs Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
…tate Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
…rch sends Under draft preview a view whose searchableFields names a draft-only field sent it as $searchFields with every search term, and the data door refuses an undeclared search field with 400 INVALID_FIELD (checked whether or not a term rides). ListView now sends the declared list less the marked names, on its own fetch, the grouped grid, gantt, the server export and kanban lane paging. Pinned in the harness with a published control. Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
…half The form-half files resolve to main's squash, which carries rounds 3 and 4. Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB L1 review · 2026-11-17T17:58ZL1: ACCEPT I read at this head:
ChecklistShape. Draft,
A locale-only widening is L1's to review, per amendment 6946712960. No L2 is owed. The Scope. Every path is in the amended surface: Changeset. plugin-list, app-shell and i18n are all patch, and their src all moved. The text matches the diff. Code.
UI strings. The new key is in en, the 10 other packs (zh-Hans and zh-Hant included) and Tests. Real commands with exit codes. Control pins prove published fields still reach the door. Ablations: the projection strip turned 6 tests red and the Budget. 61,878 / 62,000 on the merged tree. The ceiling was not edited. Docs. None made false. Unrelated files: none. Must-fixNone. Should-fixNone. Notes / nits
CI at review time58 check-runs on this sha, all completed, 0 failed. Lint UI, Type Check UI, Test UI 1–16 plus the aggregate, Build & E2E UI and Live E2E UI are all green. RoutingL1 ACCEPT. No L2 (Clause-② is a locale-only widening) and not governed. The area lands this PR first, then #34944, which reads the marker this PR supplies. CI must be green on each landing head, and |
|
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX Landing · 2026-11-17T17:59Z · area o3-A
State: Merge standard: no must-fix or should-fix is open. L1's nits:
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44143121635 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX
Fixes #34807
Clause-②: yes (widening — one new @object-ui/i18n
list.*key only; no exported prop, no typed interface member; the_draftOnlyfield marker is an internal undeclared key on an untyped value)Metadata-protocol: none
Premise corrected: 6946635368
Ruling-ref: 6946403206
Surface-amendment: 6946712960
This PR ships the list half of the card. The form half landed as #34843 (13e0305); this branch was cut from it and has merged
origin/mainsince, so the diff below is the list half alone.维护者速读
?preview=draft)里,列表视图如果有一列是只存在于草稿中的字段,现在列表照常显示:这一列用草稿里的标签画出来、内容为空;查询、筛选、排序、搜索字段都不再带上这个字段。若用户的筛选或排序用到了它,列表上方会有一行说明「这个字段只在草稿中,发布前不参与筛选/排序」。ListView读到的标记集合为空,所有请求逐字节不变(对照测试钉住)。回滚即 revert 本 PR。ui/packages/plugin-list/src/ListView.tsx(omitDraftOnlyFilterFields剔除筛选条件、servedCols投影与searchFieldsSent三处,影响已发布包);ui/packages/app-shell/src/preview/unpublishedObjectReads.ts(usePreviewListDataSource与getObjectSchema的预览读取);ui/packages/app-shell/src/views/objectViewListRenderer.tsx(包装缓存按 objectDef 失效)。pnpm --dir ui exec vitest run packages/plugin-list/src/__tests__/ListView.harness.test.tsx packages/app-shell/src/preview/__tests__/unpublishedObjectReads.draftOnly-34807.test.tsx packages/app-shell/src/views/ObjectView.draftOnlyColumn-34807.test.tsx,预期 3 个文件、116 个测试全部通过。What changes
@object-ui/app-shell,preview/unpublishedObjectReads.ts:withUnpublishedObjectReads(ds, onUnpublished, readOverlay?): given the overlay read, itsgetObjectSchemaanswers the form half'sreadDraftPreviewObjectSchema. That is the published object document plus each field only the draft declares, under its draft label, marked_draftOnly: true, with the published sortability projection kept. Without the overlay read it behaves as before.usePreviewListDataSource(ds, revision)(module-level, not exported from the package): the adapter itself outside preview; inside preview, one wrapper per data source and revision. It caches on its inputs through a ref, not on a memo identity (ui/AGENTS.md chore: version packages #10).objectViewListRenderer.tsxpasses the metadata provider'sgetItem(read through a ref) as the overlay read. It keeps one wrapper per data source per draft-awareobjectDef, so a newly drafted field makes the list re-read its definition.ObjectDataPageandInterfaceListPagehandListViewusePreviewListDataSource(dataSource, objectDef).@object-ui/plugin-list,ListView:draftOnlyFields, a shared empty set outside preview).$selectcolumns, the speculative field harvest,$expand, and the server export's fields.$filter:buildEffectiveFiltergains an optionaldraftOnlyargument that strips every comparison on such a field from the merged node. This applies in the fetch, the child-view node and the export.$orderby(serverSort), and out of the$searchFieldsit sends with a search term.list.draftOnlyQueryDropped.$searchFieldsstrip (searchFieldsSent) covers the list's own fetch and every place the view'ssearchableFieldsis handed on: the grouped grid's node, gantt, the server export and kanban lane paging.@object-ui/i18n:list.draftOnlyQueryDroppedin all 11 locales (zh-Hant regenerated byscripts/gen-zh-hant.mjs), and inLIST_DEFAULT_TRANSLATIONS.Why
Under
?preview=drafta list view may show a column on a field the draft adds. The data door validates every$select,$filter,$orderbyand$searchFieldsname against the published object, so that one column made it refuse the whole list query with400 INVALID_FIELD(premise 6946635368). Preview stays read-only for data (ruling 6946403206, ADR-0037 Phase 1). The list therefore draws the draft column empty instead of asking the server for a field the server does not have.$searchFields, measured. The data door checks
searchFieldswhether or not a search term rides (the comment besidehost.assertSearchFieldsAreSearchableinprotocol-data-crud.tssays so). A temporary probe callingfindDatawith{ $search: 'spec', $searchFields: ['title', 'priority'] }answered{ code: INVALID_FIELD, status: 400, field: priority, param: $searchFields }. The string form gave the same answer. The control['title']was served. So the strip goes in the sameListViewhelper (refersToDraftOnlyField).Why the list strips the sort itself.
readObjectSortabilitydrops a field with no projection entry only when the published read served a projection. An older deployment, or a never-published object, serves none, soListViewstrips a draft-only sort explicitly (pinned both ways)._draftOnlyis the form half's underscore-private convention between@object-ui/app-shell(which sets it) and the plugins (which read it). It is never an authoring key and is never persisted.Tests
ui/packages/plugin-list/src/__tests__/ListView.harness.test.tsx, new top-level describeListView.draftOnlyColumn-34807(8 tests, per the shared-harness rule). Its data source refuses any request namingprioritywith400 INVALID_FIELD, as the data door does.$selectis exactly['id','title'], and there is no error.titlecondition is kept, and the note is shown.searchableFields: ['title','priority']and a search term,$searchis kept and$searchFieldsis['title']. CONTROL: with the field published, it is['title','priority'].$select,$orderbyand$filtercarry it and there is no note.ui/packages/app-shell/src/preview/__tests__/unpublishedObjectReads.draftOnly-34807.test.tsx:_draftOnlyunder the draft label and keeps the projection. CONTROL: no overlay read.ObjectDataPageandInterfaceListPagehandListViewthe wrapper in preview and the adapter itself outside it.ui/packages/app-shell/src/views/ObjectView.draftOnlyColumn-34807.test.tsx: the realObjectViewandListViewunder preview draw the list with the draft column, and no request namespriority. CONTROL: outside preview the request still sends it, and the list shows the error state.Ablation 1 (one-shot, restored): the projection strip removed
Committed first.
node scripts/ablation-replace.mjsreplaced? rawCols.filter(c => !refersToDraftOnlyField(c, draftOnlyFields))with? [...rawCols](anchor x1 to x0, blob 1fb8ed75e0e9 to 6eb1ac8619d8).The failures were the ObjectView preview test and the 5 draft-mode plugin-list pins; both controls stayed green. Restored: blob == HEAD (1fb8ed75e0e9),
git diff HEADempty. A first attempt was a no-op (the replacement? rawColswas already inside the anchor), which the tool refused; nothing ran, then the run above.Ablation 2 (one-shot, restored, head 509f3ea): the $searchFields strip removed
node scripts/ablation-replace.mjsreplacedconst kept = declared.filter((f) => !refersToDraftOnlyField(f, draftOnlyFields));withconst kept = [...declared];(anchor x1 to x0, blob 81e51912ceb8 to f39dd3325865), then ran the harness file.The published control stayed green under the mutation.
Acceptance notes
plugin-gridreads_draftOnly).plugin-gridis outside this PR's surface. The grid builds its own$selectandgroupByfrom the object definition, and in preview that definition declares the draft-only field, so it passes the grid's declared-field gates (passesProjectionGate,isProjectableField). Measured with the realListViewandobject-gridover a data source that refuses any request namingpriority:[title, priority], grouped by the publishedstatus:ListView's own fetch sent$select [id,title,status]and was clean, and the header query sentgroupBy [status]and was clean. Each group's row page sent$select [id,title,priority,status]and drewINVALID_FIELDinside the group.[title], grouped by the draft-onlypriority: the header query sent{ groupBy: ['priority'] }, and the grid drew "Error loading grid". The data door'sassertGroupByFieldsExistanswers an unknowngroupByname with400 INVALID_FIELD,param: 'groupBy'.ListViewhands it the stripped filter and the strippedsearchableFields.orgroups). A comparison on a draft-only field is removed from wherever it sits in the filter tree. A group left with one child becomes that child, and a group left with none disappears. Inside anandgroup, or at the top level, the removal widens the result, because one fewer condition must hold. Inside anorgroup it narrows that group (A or DbecomesA), so rows onlyDwould have matched are not shown. Anorgroup whose every child was draft-only disappears, which widens the result again. None of these matches what the draft would answer once it is published. It happens only in preview, and the note line names the field that was left out. An earlier report from this run called this simply theor-group widening; the narrowing half is the correction. Treating the dropped comparison as true would widen anorgroup to every row, which seemed worse than showing fewer rows with the note.withUnpublishedObjectReads's unpublished path, so the empty state keeps its publish sentence. A view sort on such an object also shows the dropped-sort note.i18n-locale-enreads 61,878 of 62,000 gzip bytes on the merged tree (122 B headroom), so the key stays in the eager en pack. The ceiling was not touched.Verification
Targeted tests, type-check and lint, head c34be37 (merged with origin/main 13e0305)
Earlier, before the merge (704c874):
packages/plugin-list/pluspackages/i18n/gave Test Files 276 passed (276), Tests 3768 passed | 13 skipped. The 139 app-shell files that import the touched views or the wrapper gave Test Files 139 passed (139), Tests 1326 passed.Derived gate families (dispatch-gates --commands, 41), --ran reconciliation, head c34be37
All 41 were run, each with its exit code captured before any pipe: all exit 0.
pnpm --dir ui exec vitest run scripts/gave Test Files 171 passed | 2 skipped (173), Tests 5077 passed | 2 skipped (5079).i18n eager budget, merged tree c34be37
The merged tree includes #34850 and #34851, which add en keys of their own. Under the verify lock:
pnpm install --frozen-lockfile, thenVITE_BASE_PATH=/console/ vite buildinui/apps/console, thennode scripts/check-eager-closure-budget.mjs. All three exited 0.node scripts/pm/overlap-check.mjs --branch=claude/issue-34807-draft-preview-list, run alone before every push. Last result: VERDICT clean exit 0, at c34be37 against origin/main 189358f and open PRs feat(studio): the permissions page speaks business wording; bulk buttons show on every row #34914, feat(ui): a timesheet list view, an editable row × weekday entry grid #34925, fix(app-shell,console): the invitation inbox's accept routes an unverified address to verification, and the verify screen says a link was sent only when one was #34929 and fix(i18n): title the AI drawer with the top-bar button's name in every locale #34930. feat(ui): a timesheet list view, an editable row × weekday entry grid #34925 sharesobjectViewListRenderer.tsx, and all of them share locale files; every one merges cleanly..changeset/34807-draft-preview-list-column.md: patch bumps for@object-ui/plugin-list,@object-ui/app-shelland@object-ui/i18n, with both declaration lines.com.example.trackerunder?preview=draft;!in the title, no narrowing arm).Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (No formatter ran. eslint on the changed files: 0 errors; the repo-widepnpm lintis CI's, not measured locally.)main, one pull request. (Series branch on the form half, merged withmain.)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code