Repository navigation
Commit b1eb500
fix(app-shell, data-objectstack, console): view, form, pair-action and report edits start from the stored item (objectstack#35054) (#35126)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8AJJJRiYjshMUNgyMZSqBsr)_
Closes #35054
Follows #35104 (app family). This PR is cut from `origin/main`, not
stacked on #35104; `overlap-check` merges it cleanly against both.
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:视图配置面板(含草稿续编)、视图管理的重命名/置顶/设为默认(适配器 `updateView`)、开发者 →
公开表单的发布与编辑、Studio
配对动作、报表快速编辑,这五处编辑现在都从未翻译的分层读取(`/layers`)取编辑底稿,不再用按语言翻译过的 `/meta` 返回值。
-
为什么改:保存口原样存储请求体。中文会话里拿翻译后的内容作底稿,一保存就把中文译文写成了源文本,其它语言的用户从此看到中文。这是维护者裁决路线
D 的第二批(第一批应用族见 #35104)。
-
风险与回滚:待处理草稿若分层读取不提供存储副本,或条目根本没有存储内容,这几处会拒绝编辑、什么都不写,不再退回用翻译副本。编辑中的预览显示源文本。回滚即还原本
PR,不涉及服务端、spec 或保存口。
-
先看:`ui/packages/app-shell/src/views/ViewConfigPanel.tsx`(新的底稿读取,以及预览只回传管理员改动过的字段);`ui/packages/data-objectstack/src/index.ts`
的
`updateView`(草稿/已发布两条路径的底稿);`ui/apps/console/src/pages/developer/PublicFormsPage.tsx`(`readStoredFormView`)。
- 两分钟验证:`cd ui && pnpm exec vitest run --maxWorkers=2
packages/app-shell/src/views/ViewConfigPanel.resumeEnvelope-10210.test.tsx
packages/data-objectstack/src/updateView.draft.test.ts`,预期全绿;其中「中文改标签后保存」用例断言存下的是源文本
`Everything`,不是 `全部线索`。
- 需要你做的:无,席位落地。
## What changes
Route D (maintainer ruling 6966131460): every edit surface fills its
buffer from the authored read, never from the translated `/meta` answer.
This PR covers the view family and the remaining items of the hand-off.
- **View config panel** (`ViewConfigPanel.tsx`). In edit mode, with a
metadata client, the panel reads the view's layers and its pending
draft, and seeds the inspector through `authoredBuffer` (the stored
draft, else the published item). While that read is in flight, or when
it is refused, there is no buffer: the inspector is hidden and Save is
disabled. A pending draft whose stored copy the layers do not serve is
refused with `draftUnreadable`. The draft bar's resume handler
(`onResume`) is gone: the panel's own read already opens on the stored
draft, and the read runs again after a publish or a discard from the
bar. Discard still replays the opening served view to the host's live
list.
- **Panel preview relay.** The panel now relays only the fields the
admin changed (compared by content with the buffer it opened, plus any
field relayed before) to the host's live list. The buffer is the stored
view while the host previews the served one. Relaying every field
presented untouched stored values as edits: the source text, and an
unprojected view's empty `columns`, which objectui#10694 judges against
the drawn defaults.
- **Adapter `updateView`** (behind Manage views Rename, Pin and Set as
Default). It reads the served draft and the layers together and merges
onto `authoredBuffer`'s body: the stored draft when one is pending, else
the stored published view. A pending draft the layers do not serve, or a
view with nothing stored, is refused with an error that says nothing was
written. The served `getItem` still runs on the published path for its
404 handling and for what `viewCustomizationHome` reads off it.
- **Developer → Public Forms** (`PublicFormsPage.tsx`). Publish and Edit
build their writes from the stored form view (`authoredPublished` over
`metadataClient.layered`), and the thank-you text is prefilled from the
stored copy. If the stored read fails, the editor does not open and the
toast says why.
- **Studio pair actions** (`pairObjectActions.ts`). Each listed pair
action is buffered from its layered read at the read package. A row with
nothing stored is marked `unserved`, and a patch on it is refused with
`draftUnreadable`.
- **Report quick edit** (`ReportView.tsx`). The served draft (`getDraft`
plus `extractDraftBody`) now goes into `authoredBuffer` instead of
`null`, so a pending report draft the layers do not serve opens no
editor.
## Tests
New pins:
- `ViewConfigPanel.resumeEnvelope-10210.test.tsx`, "edits the view as
its author stored it":
- a zh-CN label edit then save stores the source label (control: the
edited field changes);
- a pending draft opens on the stored draft with no `onResume`;
- an unserved draft is refused and Save is disabled;
- a layered refusal.
The objectui#10210 resume cases now run through the layered draft layer.
- `updateView.draft.test.ts`, "the stored view is the base": published
Pin, draft Set as Default, unserved refused, nothing stored refused.
- `PublicFormsPage.servedRule-11545.test.tsx`, "the Publish and Edit
writers write the stored form": three cases.
- `DataPillar.pairActions-30088.test.tsx`, "a pair action edits the
action as stored": two cases.
- `ReportView.authoredEditBuffer-35008.test.tsx`: the unserved pending
report draft case, plus a no-draft control.
Harnesses gained a `/layers` answer wherever a stored item is now read:
three data-objectstack suites, four Public Forms suites, three
ObjectView suites, and the report save-refusal suite. No assertion was
weakened.
## Acceptance notes
- **Guard over the save-door callers (item 4): no cheap one exists.
Reason:**
- The door census (`check:metadata-write-doors --list`) has 15 doors.
Most writers here (view panel, report, pair actions, resource editor) go
through the one generic `MetadataClient.save` door, which the census
deliberately does not enumerate per caller.
- The body's provenance passes through React state,
`buildViewConfigSaveBody` and `mergeViewPatch`, so it is not a syntactic
property of the caller. A token check ("the file mentions
`authoredBuffer` or `layered`") would pass a file that reads layers and
still saves the served body: a phantom check.
- A runtime tag on served bodies would need a change to every served
read path and to the client save door. That is outside this claim's
surface and against the ruling ("no save-door change").
- The pins above, each with an ablation that goes red, are the guard
this PR offers.
- **Mechanism assumptions, measured:**
- Draft writers use `authoredBuffer` with the served draft: the panel
via `readRuntimeDraft`, the report via `getDraft`, pair actions via the
served draft list, and `updateView`'s draft path.
- Live-row writers use the published authored read: Public Forms and
`updateView`'s published path.
- No item needed `ObjectStackAdapter.getAuthoredItem` (only in #35104),
and none copies it. Public Forms uses `useMetadataClient().layered` plus
`authoredPublished`, the primitives already on `main` (the `ReportView`
precedent). If the seat prefers `adapter.getAuthoredItem` there, that is
a follow-up after #35104 lands.
- **Previews show source text.** While editing, the view panel and
report previews show the stored source text, not the translation (as in
the #35080 precedent).
- **Public Forms read failure** reuses the existing `saveFailed` toast
key, to avoid new i18n keys outside the surface.
- **`updateView` on a draft-only view** relies on a real server
answering the draft layer in `/layers` (Studio's `readAuthoredDraft`
relies on the same).
- **Declared views opened from the view tabs** are stored `view` items,
so their layers serve them. The objectui#10694 harness now serves each
mounted view at `/layers`.
- **NOT MEASURED:** a live zh-CN after-leg against a running console.
Reason: unit-level pins only in this run.
## Verification
All test and build commands ran from the `ui` root under
`os-verify-lock`.
<details><summary>Pins and wide runs</summary>
- **Pin set** (console developer pages, pair actions, ViewConfigPanel,
ReportView): 25 files, 190 tests passed.
- **data-objectstack updateView suites**: 4 files, 44 tests passed.
- **Every app-shell suite that mounts the panel or ObjectView**: 98
files. 838 passed and 1 failed: `userListState-12418`'s view-editor save
case, whose harness had no `/layers` answer. After adding it, that file
passed 41/41.
- **Earlier wide run** (112 app-shell files naming the changed modules,
plus all of data-objectstack): 234 files, 232 passed. The 2 failing
files were `viewWriteRefusal-11583` and
`emptyColumnsNoProjection-10694`. Both are fixed in 33979a2 (harness
`/layers` answers, plus the panel's preview relay of changed fields
only), and the rerun passed 31/31.
- **type-check** of data-objectstack, app-shell and console: all three
Done, VERDICT 0.
</details>
<details><summary>Ablations (fix committed first; each leg restored,
blob equals HEAD, git diff HEAD empty)</summary>
| Ablation | Mutation | Result |
|---|---|---|
| A1 ViewConfigPanel | `initialDraft` falls back to `openingDraft` | 4
failed, 2 passed. Red on the stored label (`全部线索` instead of
`Everything`) and on the objectui#10210 resume cases. |
| A2 `updateView`, published | merge onto served `current` | 1 failed
(`游离测试列表` stored). |
| A2b `updateView`, draft | merge onto `servedDraft ?? stored` | 1
failed. |
| A3 PublicFormsPage | edit row from the served view | 1 failed (label
`联系我们(测试)` instead of undefined). |
| A4 pairObjectActions | buffer the served row | First attempt was a
no-op: the anchor replacement was not unique, so `ablation-replace`
refused, exited 1 and restored. Rerun with a unique marker: 2 failed, 5
passed. |
| A5 ReportView | pass `null` as the served draft | 1 failed (the
unserved case). |
| A6 panel preview relay | relay every field |
`emptyColumnsNoProjection-10694`: 2 failed, 15 passed. |
</details>
<details><summary>Gates</summary>
Local subset: the 40 families `dispatch-gates.mjs --commands` derives
for this diff, run at 33979a2. The list is unchanged at 383f859, and
`--ran` reconciles 40 derived, 40 run, 0 not measured, 0 unrun. Every
other family belongs to CI and is read from this PR's check-runs.
- `node scripts/check-adr-0087-registration.mjs --base origin/main`:
exit 0
- `node scripts/check-adr-0087-registration.mjs --self-test`: exit 0
- `node scripts/check-changeset-no-major.mjs --base origin/main`: exit 0
- `node scripts/check-closing-keyword-parity.mjs`: exit 0
- `node scripts/check-closing-keyword-parity.mjs --self-test`: exit 0
- `node scripts/check-comment-mask-corpus.mjs`: exit 0
- `node scripts/check-empty-changeset.mjs --base origin/main`: exit 0
- `node scripts/check-empty-changeset.mjs --self-test`: exit 0
- `node scripts/check-sdui-manifest.mjs`: exit 0
- `node scripts/check-sdui-manifest.mjs --self-test`: exit 0
- `node scripts/ci/snapshot-next.mjs --self-test`: exit 0
- `node scripts/pm/check-governed-queue-guard.mjs --self-test`: exit 0
- `node scripts/pm/release-rehearsal-clone.mjs --self-test`: exit 0
- `node scripts/release-pending-publish.mjs --self-test`: exit 0
- `pnpm --dir ui exec vitest run scripts/`: exit 0
- `pnpm --filter @objectstack/spec run check:duration-unit-keys`: exit 0
- `pnpm --filter @objectstack/spec run check:error-code-provenance`:
exit 0
- `pnpm check:adr-anchors`: exit 0
- `pnpm check:changeset-gate-self-tests`: exit 0
- `pnpm check:closed-ceremony-text`: exit 0
- `pnpm check:cross-package-test-inputs`: exit 0
- `pnpm check:dispatcher-error-vocabulary`: exit 0
- `pnpm check:driver-memory-census`: exit 0
- `pnpm check:engine-double-contract`: exit 0
- `pnpm check:error-status-conformance`: exit 0
- `pnpm check:gitlink-declared`: exit 0
- `pnpm check:nul-bytes`: exit 0
- `pnpm check:published-files`: exit 0
- `pnpm check:query-options-erasure`: exit 0
- `pnpm check:refd-timer-probe`: exit 0
- `pnpm check:registry-log-declared`: exit 0
- `pnpm check:rest-log-spy-declared`: exit 0
- `pnpm check:skill-identifier-liveness`: exit 0
- `pnpm check:test-source-alias`: exit 1 at 33979a2.
`ObjectView.emptyColumnsNoProjection-10694` reached `@objectstack/lint`
with no module-top load. Fixed in 383f859; rerun exit 0, and that file
passes 17/17.
- `pnpm check:tier-file-adoption`: exit 0
- `pnpm check:type-check-coverage`: exit 0
- `pnpm check:type-check-debt`: exit 0
- `pnpm check:undeclared-dep-imports`: exit 0
- `pnpm check:watch-hint-literal`: exit 0
- `pnpm check:where-matcher`: exit 0
- `check-platform-checklist --changed-from`: not run. No exported symbol
was renamed or deleted (`PairActionRow` only gains an optional
`unserved`).
- `os-verify-lock` timings were measured on a shared box.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbYRqkDAGuse5Wqbohi
<!-- signed: repo:objectstack#1 · os-warren ·
session_01JQwxbYRqkDAGuse5Wqbohi -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 94a2d8b commit b1eb500
21 files changed
Lines changed: 924 additions & 110 deletions
File tree
- .changeset
- ui
- apps/console/src/pages/developer
- packages
- app-shell/src/views
- studio-design
- data-objectstack/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
87 | 95 | | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| 100 | + | |
92 | 101 | | |
93 | 102 | | |
94 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
68 | 74 | | |
69 | 75 | | |
70 | 76 | | |
71 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| 91 | + | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
| |||
150 | 165 | | |
151 | 166 | | |
152 | 167 | | |
| 168 | + | |
153 | 169 | | |
| 170 | + | |
154 | 171 | | |
155 | 172 | | |
156 | 173 | | |
| |||
301 | 318 | | |
302 | 319 | | |
303 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
| 102 | + | |
91 | 103 | | |
92 | 104 | | |
93 | 105 | | |
| |||
0 commit comments