Repository navigation
feat(console): preview images, PDF, text and CSV in the page from attachments and file fields - #36587
Conversation
…achments and file fields Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
… and wiring Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…refusal keeps its cause Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…pp-shell builds for; changeset Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…iew keys Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
… module scope Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
…s own clicks at its content Claude-Session: https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Flake reading — PR #36587 @ 6775877 · 2026-11-23T04:20Z
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract-review-claim: session_01ADHkmRB34k9WUWeGpRnVNm · head 6775877 · 2026-11-23T04:33Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract reviewServed-tier: The face is the ① Derived judgments
② Semver levelpatch for ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm 席位核对ACCEPT — PR #36587 @ 6775877 (head of record, full sha on the PR; main merged by the relay's update-branch onto 81b19aa) · card #36442 · L1 first read by area s2-B (area order rule 9) · 2026-11-23T04:34Z · contract review TIER_DEFAULT PASS 7091693978 at the same head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45112843268 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Second red — PR #36587 @ 6775877, merge queue · 2026-11-23T04:56Z
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract-review-claim: session_01ADHkmRB34k9WUWeGpRnVNm · head 6e7be24 · 2026-11-23T06:42Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm Contract reviewServed-tier: The face is the Delta from the record at 6775877 (7091693978, PASS)The head moved only by the relay's update-branch merge of ① Derived judgments
② Semver levelpatch for ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm 席位核对ACCEPT — PR #36587 @ 6e7be24 (head of record, full sha on the PR) · card #36442 · L1 delta read by area s2-B · 2026-11-23T06:44Z · contract review TIER_DEFAULT PASS 7093622909 at the same head · first ACCEPT 7091706488 at 6775877
|
… write Field change values (objectstack-ai#36290 part 1) (objectstack-ai#36641) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9NRmimMwnUgR1DbqgHtBWM3)_ Part of objectstack-ai#36290 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 管理员在 Studio 的字段设置和字段设计器里,原来的「记录历史」开关换成「字段修改值」三选一(默认 / 开 / 关),对象设置的「功能开关」里新增「字段修改值」;普通用户无感。 - 属于记录页「字段修改前后值」专题,落实「默认显示、对象或单个字段可关」的裁决:以前 Studio 写的是不再起作用的旧开关,管理员在界面上关不掉前后值。 - 若出错,管理员可能看到「默认」标成开而动态里实际不显示前后值(或相反),或关掉后回不到默认;改动只在设置界面,可直接撤回。 - 要你做的:无。 ## What changes Card objectstack-ai#36290 part ① (PR 3 of 4; ruling 7076513167 point 1: "Old → new is shown by default on every object's record page; an object, or a single field, can turn it off."). PR 1 (objectstack-ai#36399) gave the runtime `fieldHistory` (field) and `enable.fieldHistory` (object); objectstack-ai#36580 gave the metadata form a three-way `field-history` widget. The Studio's own producers still wrote the old key. This PR moves all three named in the release comment. **Field inspector** (`ObjectFieldInspector.tsx`, Advanced section) - The "Track history" box (`value={!!def.trackHistory}`, `patchDef({ trackHistory: v || undefined })`) is gone. Measured reason: since PR 1 a field's `trackHistory: false` reads like absent and `true` does only what `fieldHistory: true` does for a media or JSON type (spec describe of `FieldSchema.trackHistory`), so a second box beside Field change values could only mislead. A stored `trackHistory` is never written or removed here; it is still read, because `resolveFieldHistory` reads it. - New row "Field change values": Default / On / Off over the field's `fieldHistory`. Default removes the key (`unsetDefKey`, not a patch to `undefined`); On / Off write `true` / `false`. - Default names what it resolves to through `resolveFieldHistory` from `@objectstack/spec/data`, the predicate the activity writer uses. Unlike the form widget, this rail holds the object document, so it passes the object: an object with `enable.fieldHistory: false` makes every field's Default read "Default (Off)", and a note under the row says the object's off wins. - The row sits inside the existing `DisplayPatchLock`, so on a read-only base field it is locked with the same reason as its neighbours (`fieldHistory` is not on `BASE_FIELD_DISPLAY_WHITELIST`). **Object settings** (`ObjectSettingsPanel.tsx`, Features card) - New row "Field change values" (`enable.fieldHistory`), next to "Field change history" (`enable.trackHistory`). Ticked unless the stored value is a literal `false`. Unticking writes `false`; ticking again REMOVES the key (unset already means on, so no `true` the author did not need). Sibling `enable` keys are kept, as for every other row. - The Field change history description no longer says "pair with per-field history tracking to pick which field diffs are summarized" (no longer true); it points to Field change values. **Field designer** (`plugin-designer` `FieldDesigner.tsx`, the drawer behind `MetadataFieldsPage` and the `field-designer` SDUI type) - The Advanced section's Track History switch wrote `trackHistory: data.trackHistory === true` on every save, create and edit. It is replaced by Field Change Values with the same three choices. The update path no longer names `trackHistory`: a stored value rides the `...editingField` spread, and a created field carries neither key at Default. - Default's label depends on the type, which the author can change in the same drawer, and a drawer select's options are static. So the choice is drawn as two rows under form-local names, one per resolved default, each shown by a `visibleWhen` built from `resolveFieldHistory` over `DESIGNER_FIELD_TYPES` (with the field's stored `trackHistory`). The save reads the row shown for the saved type, which is the one on screen at the click. Neither form-local name reaches the model. - `DesignerFieldDefinition` (`@object-ui/types`) and its zod mirror gain an optional `fieldHistory`. Both save paths carry it: `MetadataFieldsPage` (`toDesignerField` / `fromDesignerField`) and `MetadataService.toFieldPayload`. Default writes `fieldHistory: undefined`, which overrides the carried value and is dropped on the wire, so a stored key is removed. That is the converters' existing clear-by-absence rule. - It cannot import `fieldHistoryChoice.ts`, because app-shell depends on plugin-designer. What it shares is the rule (`resolveFieldHistory` from `@objectstack/spec/data`). Its own copy of the choice-to-value mapping is two lines. Its strings are the language-pack keys `appDesigner.fieldDesigner.fieldHistory`, `fieldHistoryDefault`, `fieldHistoryOn` and `fieldHistoryOff`, in all 11 locales and the designer's defaults table. They replace `appDesigner.fieldDesigner.trackHistory`. **Shared logic** (`metadata-admin/fieldHistoryChoice.ts`, new): the three choices, the value each writes and their wording, used by both the inspector row and the objectstack-ai#36580 `field-history` widget (refactored onto it; its behaviour and its 10 pins unchanged). The controls stay separate on purpose: the widget is a `WidgetProps` renderer that sees one form row and no object; the inspector row is an `InspectorSelectField` with the inspector's label and lock semantics and the whole object in hand. **Strings** (studio namespace, en + zh; the other locales fall back to en by that namespace's design): `designer.field.fieldHistory`, `designer.field.fieldHistoryObjectOff`, `engine.studio.settings.capFieldHistory`, `engine.studio.settings.capFieldHistoryDesc`; `engine.studio.settings.capTrackHistoryDesc` reworded; `designer.field.trackHistory` removed with its box. Not in this PR: record-page rows (part ②, landed as objectstack-ai#36613), the per-field history card (part ③). ## Tests - New `ObjectFieldInspector.fieldHistory-36290.test.tsx` (7): Default (On) for a one-line type; Default (Off) for image / json / password and Default (On) once `trackHistory: true`; Off writes `false`, On writes `true`; Default after Off removes the key; no Track history box, no `trackHistory` written, a stored one kept; the object's off makes Default (Off) and shows the note; control: no note otherwise. - New describe in `ObjectSettingsPanel.test.tsx` (4): checked for unset and `true`, unchecked only for `false`; untick writes `false` with siblings kept; re-tick removes the key with siblings kept; labelled by its own title. - New `FieldDesigner.fieldHistory-36290.test.tsx` (9), on the real `FieldDesigner` with a drawer double that captures its schema and calls its own `onSuccess`. The cases: two rows and no Track History row, with the labels; for every designer type exactly one row's `visibleWhen` evaluates true (through `evalFieldPredicate`, the form's own evaluator), and it is the one `resolveFieldHistory` names; a stored `trackHistory: true` moves a media type to the Default (On) row; an untouched edit writes neither key; Off writes `false`, On on a media type writes `true`; a stored `false` opens as Off and Default removes it; a stored `trackHistory` is kept; a type changed in the drawer saves what is on screen; a created field at Default carries neither key. - New `MetadataFieldsPage.fieldHistory-36290.test.tsx` (4), on PUT bytes through the real page and a real `MetadataClient`. A stored `fieldHistory: false` survives and no `trackHistory` is written; a stored `trackHistory: true` survives and gains no `fieldHistory`; a field with neither key gains neither; every PUT field parses through `FieldSchema`. - Extended: `MetadataService.fieldKeyCarryOver.test.ts` adds `fieldHistory` to its populated entry and its clearable keys; `designer-zod-arms-10859.test.ts` adds `fieldHistory` to the fully populated `field-designer` document. - Forced test changes: `ObjectFieldInspector.displayPatchReason-28986.test.tsx` names the Field change values combobox instead of the removed Track history checkbox among the locked controls; `ObjectSettingsPanel.businessWording-36512.test.tsx` lists `enable.fieldHistory` among the keys the tab writes. `ObjectFieldInspector.externalIdNotOffered-26674.test.tsx` and `ObjectFieldInspector.retiredIndexed.test.tsx` listed Track history among the Advanced siblings that still render; they name Field change values, and (being edited) now pay the formula and lint loads at module top, as `check:test-source-alias` requires. `FieldDesigner.externalIdNotOffered-26674.test.tsx` and `MetadataFieldsPage.externalIdRoundTrip-26674.test.tsx` used the Track History row as their positive control; they now use the Field Change Values row. ## Acceptance notes - The field designer's Default label follows the drawer's type and the object is not in hand, so an object with `enable.fieldHistory: false` is not reflected there, the same accepted bound as objectstack-ai#36580's widget. Neither `FieldDesigner` nor `MetadataFieldsPage` is mounted by the Console today; both are published exports, and `field-designer` is a registered SDUI type. - A stored field `trackHistory: true` on a media or JSON type makes Default read "Default (On)"; such a field can still be turned off with Off, but not returned to the type's off-by-default without editing the key in the form. That is the resolver's answer, not a UI choice. - `ui/AGENTS.md` objectstack-ai#2 (package README and `content/docs/frontend/` page) not edited: outside this part's file surface. - Screenshots NOT MEASURED (no Console build or backend run here). ## Verification Read first, by risk: 1. `ui/packages/plugin-designer/src/FieldDesigner.tsx`: the `fieldHistoryRows` memo (two rows, `visibleWhen` built from `resolveFieldHistory`) and `fieldHistoryFromForm`, which picks the row for the SAVED type on both save paths. 2. `ui/packages/app-shell/src/views/studio-design/ObjectSettingsPanel.tsx`: `patchEnable` with `unsetWhenOn` (re-ticking removes `enable.fieldHistory`, keeps siblings). 3. `ui/packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.tsx`: the Field change values row and the object-off note inside `DisplayPatchLock`. Two-minute check: open Studio, an object, Settings, Features: "Field change values" is ticked. Untick, save, and reopen the object JSON: it shows `enable.fieldHistory: false`. Tick again: the key is gone. Then open a field's Advanced section: "Field change values" reads "Default (Off)" with the note under it. <details><summary>Runs (local, head 3b5b130 after merging origin/main 9e2a4ac)</summary> - Builds under the verify lock: the `@objectstack/{spec,formula,lint,client,sdui-parser}` closure, and `@object-ui/app-shell^...` again after the merge (VERDICT command-exit 0 each). - `type-check` (tsc plus `tsconfig.test.json`) of `@object-ui/app-shell`, `@object-ui/i18n`, `@object-ui/types` and `@object-ui/plugin-designer`: all four Done, exit 0 (after the merge; plugin-designer again at 3b5b130). - Post-merge union at ffa608d: `vitest run packages/app-shell/src/views/metadata-admin/inspectors/ packages/app-shell/src/views/studio-design/ObjectSettingsPanel packages/app-shell/src/views/metadata-admin/FieldHistoryWidget-36482.test.tsx packages/app-shell/src/views/metadata-admin/SchemaForm packages/plugin-designer/ packages/types/ packages/app-shell/src/services/ packages/i18n/ packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx` gave Test Files 851 passed (851) and Tests 16838 passed, 14 skipped. 3b5b130 changes only the designer pin's types; that file re-run: 9/9. - Pre-merge union at 3fa510b (`metadata-admin/`, `studio-design/`, `i18n/`) gave Test Files 1232 passed and 2 failed (1234). The 2 were sibling pins still naming Track history, fixed in 58cef60. - Ablations, each through `scripts/ablation-replace.mjs` (anchor 1 to 0), restored with blob equal to HEAD and `git diff HEAD` empty: - The inspector writes `trackHistory` again: 2 of 7 new inspector pins red. - The settings switch writes `true` instead of removing the key: 1 of 14 red. - The designer's update path writes `trackHistory: data.trackHistory === true` in place of `fieldHistory`: 7 of 13 red across the two new designer files. - `dispatch-gates --commands` at 3b5b130 derived 42 families; all 42 ran locally with exit 0; `--ran` reconciliation gives "42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN". - `overlap-check` at 3b5b130: VERDICT clean exit 0 against origin/main d7411fa (three commits past the merged 9e2a4ac; `git merge-tree` is also clean) and objectstack-ai#36634, objectstack-ai#36629, objectstack-ai#36606, objectstack-ai#36587, objectstack-ai#36525. - ui extras: `check:new-line-citations` 0, `check:i18n-keys` 0, `check:i18n-drift` 0, `check:i18n-dead-keys` 0. eslint on the changed source and test files: 0 errors, and no warnings on added lines. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPq6z7KER4Sr6Uu7Ht --------- Co-authored-by: Claude <noreply@anthropic.com>
…the design mode (objectstack-ai#36366) (objectstack-ai#36629) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9XUZ1viPwnt3ZWuPpxejiN3)_ Fixes objectstack-ai#36366 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up objectstack-ai#36630 ADR notes: carrier objectstack-ai#36086 (seat posts them) ## 维护者速读 - 管理员在设计模式里点页头最右边的「页头按钮」,能把列表页和记录页的动作分成「固定」(最多三个,可拖动排序)和「更多」(也可排序),保存后所有成员看到的页头都跟着变;记录页的设置同样作用于侧边预览和手机底栏。 - 属于「运行界面的设计模式」专题,解决按钮多时挤掉记录名、管理员又改不了页头的问题。 - 设置错了,管理员在同一面板里改回或取消即可;对象不写这项设置时,页头和今天完全一样。 - 无。 ## What changes `actionLayout` is a new optional key on `ObjectSchema` and `ObjectExtensionSchema`, in the format of the maintainer's ruling (2026-11-22T14:50Z, quoted in release 7087101113: 「objectstack-ai#36366 改成"列表"和"记录"两组,每组分"固定"和"更多"两段,等 objectstack-ai#36363 合并后,卡标记为p1,剩余任务放回队列」) and seat rulings 7077698148 / 7080672229: `actionLayout: { list?: Arm, record?: Arm }`, `Arm = { pinned: string[] (at most 3, required, may be []), more?: string[] }`. - **spec** (`packages/spec/src/data/object-action-layout.ts`): the shape and its refusals at every door (more than three pinned, a name twice in one part or across both, a malformed name, a built-in the scope does not have), each with a named reason; the object form offers one JSON row per arm under Advanced. Generated artifacts regenerated (api-surface, export-origins, authorable-surface, dropped-refinements counts, references); liveness row `object/actionLayout` is `live`, drilled into `list` / `record` and each into `pinned` / `more`, citing the record header, the list header, the fold and the design mode. - **objectql + metadata-protocol (patch round 2, M1)**: `actionLayout` is the third key of `CUSTOM_ARRANGEMENT_KEYS`, beside `fieldGroups` and `relatedLists` (ADR-0146 D10). Only the base's paired `.custom` package writes it on an `object_extension`; the one judge `judgeExtensionArrangement` refuses any other package's, each door in its own way: publish, restore and draft promotion answer `VALIDATION_ERROR` / 400; marketplace install refuses the package body with `VALIDATION_ERROR` / 422; `os validate` and `os build` exit non-zero and print the row; the registry fold skips the key and leaves a note. The registry applies the pair's arms last, in `applyCustomArrangement`, by role, arm by arm. A manifest's `objectExtensions` entry now carries the key to the fold (`objectExtensionContribution` dropped it). - **lint**: `validateObjectActionLayout` refuses, in `os validate` / `os build` / `os lint`, a name in either part that is no action of the object or is not placed in the scope its arm arranges. - **`@object-ui/types`**: `arrangedHeaderActions(actions, arm, scope)`, the one reader; `pinned` become buttons in pin order, the names `more` gives lead the overflow in that order, unnamed ones follow in their default order. - **console**: the synthesized record header (record page, the side preview's embedded mount, the phone's bottom bar) and an authored `page:header` with `placedActions: true` read `actionLayout.record`; the list header reads `actionLayout.list` with `$import` / `$export`. Under the design mode, 「Header buttons」 at the end of the header opens a two-part panel (「Pinned to header」 at most 3, 「Other」 = More), both parts draggable, a dot moving an action between them, a fourth pin refused with a toast; the mode's Save writes the object's own package when writable, else the installed object's customization package's `object_extension`, through the one writer of an installed object's arrangement, `saveObjectExtensionArrangement` (patch round 3). - **i18n**: `designMode.pins.*` in every hand-written locale, including the new `designMode.pins.stale` (names the arm sets that the scope no longer offers); zh-Hant regenerated. Object-form translations for the two arm rows in all 11 metadata-forms locales. ### 待审假设 (assumptions for review, shown to the maintainer, not ruled) 1. The key name `actionLayout`. 2. The `record` arm is a scope, not a page: the record header, the side preview and the phone bottom bar all read it. 3. An action the scope places that neither part names goes to the end of More, in its default order. 4. A hidden pinned action leaves its slot empty; no other action takes its place. 5. No arm (or no key) = today's drawing, exactly. 6. Among built-ins, only the list scope's `$import` / `$export` can be named, and only in `pinned`: one in `more` is refused with its reason (not pinned, the page still draws its own Import / Export menu). The record scope has none. 7. Only the base's paired `.custom` package writes `actionLayout` on an `object_extension`. Each arm it writes replaces the served arm for that scope whole, after every other layer (a tenant's arm for the same scope included); an arm it leaves out stays. 8. A `page:header` authored with its own `actions` list keeps that list; the design mode offers it no 「Header buttons」. 9. Save refuses: more than 3 pinned, a name in both parts, an unknown name, an action of the other scope (the last two at `os validate` and in the design mode's Save; see Acceptance notes for the server door). 10. Names the arm sets that the scope no longer offers are listed in the panel as left out and skipped by the reader. 11. With no list arm, the panel says "No button is pinned: every action is in More." while the bar end shows the page's Import / Export menu (`Import ▾`), and 「Other」 lists Import: for a built-in, 「Other」 means "in the page's Import / Export entries". The wording is kept as is. Out of scope: objectstack-ai#36494 (row menu and right-click), objectstack-ai#36495 (the `locations` vocabulary), objectstack-ai#36496 (the `selection` arm). ### Tests changed because the surface grew (named, each recounted by measurement, not by hand) - `packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts`: `object` 51 → 52. - `packages/platform-objects/src/apps/translations/object-collapsed-sections-echo-decisions.test.ts`: leaves 119 → 125, `advanced` 106 → 112. - `packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts`: positive control 760 → 763. - `ui/packages/i18n/src/__tests__/de-quote-pairing-3876.test.ts`: paired spans 127 → 131 and 127 / 127 / 0 → 131 / 131 / 0 (main's 127 after objectstack-ai#36370, measured again after the merge). - `ui/packages/app-shell/src/layout/__tests__/designModeHeaderPinsSave-36366.test.ts`: its `input` helper now types the pins as `ObjectPins` (the type-check read the old `string[]` shape as nine TS2353). - The CLI transcripts in `content/docs/deployment/cli.mdx`, `deployment/validating-metadata.mdx`, `getting-started/build-with-claude-code.mdx` and `ui/react-pages.mdx`: author-time rules 76 → 77, as `check:docs-transcript-drift` derives. - `packages/spec/src/compose-stacks-merge-collection-refusal.test.ts`, `packages/spec/src/compose-stacks-merge-config-object-refusal.test.ts`: `actionLayout` added to the config-object key list. ## Tests **Patch round 3, head `8a85482aea`** (L2 delta S5, N4, N5; S1 waits on objectstack-ai#36635 and is untouched). - **Merge**: `origin/main` `6e643cc43e` merged in `d871e26fdb` with no conflict (it brings objectstack-ai#36624's one writer and objectstack-ai#36621's app-menu entry). `origin/main` `9c283a11bf` still merges cleanly. - **S5, the L2-preferred route**: the installed-object branch of `saveObjectPins` now calls `saveObjectExtensionArrangement`, handing it only the composed `actionLayout`. That module's patch type is `{ [K in CustomArrangementKey]?: ExtensionArrangementValue... }`, a list for `fieldGroups` / `relatedLists` and `ObjectActionLayout` for `actionLayout`; its docblock names the header buttons as a caller. The writable-package branch, which writes the object itself, is unchanged. S3 holds: the composed value is the arms the stored extension holds with each changed arm replaced. New `designMode.pins.pairNotWritable` in the 11 locales (zh-Hant regenerated). - **Pins** (`designModeHeaderPinsSave-36366.test.ts`, 13 tests): a pair the server answers not writable is refused after the ensure call and before any read or write; through the one writer the stored `relatedLists`, `fieldGroups` and held list arm are kept and the publish announces itself; the S3 pins and the call-order pins (now ensure, get, layered, save, publish) pass. Ablation: composing over no stored `actionLayout` turned 2 red (the S3 held-arm pin and the S5 kept-keys pin), restored blob equals HEAD's. - **Docs and wording**: `actions.mdx` now reaches 「Header buttons」 through the app name at the top of the sidebar, then 「Edit app」. Changeset: `[]` pins none; the spec bullet names the built-in refusal in `more`; each door's own answer. `object.zod.ts`: the `actions` guidance and the comment above `membershipKeys` name `actionLayout` as a pair-only key beside `fieldGroups` and `relatedLists`. - **Reruns**, all exit 0: closure build; `check:generated` (no drift); ui 16 files plus `packages/i18n/` (122 files / 2134 passed, 13 skipped); spec 101 files naming `ObjectExtensionSchema` or the guidance (6725 passed); spec typecheck; app-shell, components and i18n type-check; 23 gate families (i18n, docs, changeset, liveness, facade, nul-bytes and others). Lines in the seat file. **Patch round 2, head `49a31750bc`** (L2 review M1, S2, S3, S4; the ADR-0085 §2 sentence and objectstack-ai#36086 untouched). No merge: `origin/main` `d7411fa373` merges cleanly. - **M1, chosen semantics: per-arm replacement, the pair only, applied last.** Measured first: every door already reads `CUSTOM_ARRANGEMENT_KEYS` through the one judge, so the mechanism applies as is. The five doors and where they call it: 1. publish, restore and draft promotion of an `object_extension`: `objectExtensionItemRefusal` in `packages/metadata-protocol/src/protocol-object-extension-item.ts`; 2. `os validate`: `packages/cli/src/commands/validate.ts`; 3. `os build`: `packages/cli/src/commands/compile.ts` (both CLI doors through `packages/cli/src/utils/extension-arrangement.ts`); 4. marketplace install: `packages/cloud-connection/src/marketplace-install-local-plugin.ts`; 5. the registry fold: `applyCustomArrangement` in `packages/objectql/src/registry-custom-arrangement.ts`, run last in `foldExtendersOntoDefinition`, skips a non-pair package's key and names it in a warning. The round-1 priority fold (`foldExtensionActionLayout`, `actionLayout` in `OBJECT_FOLD_SCALAR_KEYS`) is removed; `registry.ts` is back at main's 6426 lines. - **Pins replacing "partner 250 beats pair 150"**: a partner's `object_extension` save with `actionLayout` answers `VALIDATION_ERROR` / 400, one issue at `actionLayout`, nothing stored or served, the pair's save served (`packages/objectql/src/protocol-custom-arrangement.test.ts`); in the registry, partner at 250 against the pair at 150, and a partner registered after the pair, both serve the pair's arm (`registry-extension-action-layout.test.ts`); the judge names the path and prescribes the action's own `locations` and `order` (`protocol-extension-arrangement.test.ts`). - **S2**: `actionLayout` no longer yields to a tenant: the pair applies last, per arm, so a tenant's arm for another scope stays and the pair's arm wins for its own scope (two pins). - **S3**: the design-mode Save writes only the arms whose staged value differs from the served one, merged into the arms the document already holds; nothing changed means no call (three pins). - **S4**: chosen to refuse: the schema refuses a `$` built-in in `more` with its reason, the Save never writes one there, and the `pinned` describe, the form help (11 locales) and the docs say the list page still draws its own Import / Export menu; the `more: ['$import']` examples are gone. - Reruns, all `command-exit 0`: spec test 974 / 29634 and typecheck; metadata-protocol test 365 passed, 9 skipped; objectql test 634 / 14360; lint 228 / 9474; platform-objects 125 / 2126; typecheck of metadata-protocol, objectql, lint, cli; cli unit extension-arrangement files 3 / 48; cloud-connection install arrangement 1 / 5; ui 36366 files 6 / 59; `@object-ui/app-shell` type-check; `check:generated --fix` regenerated `content/docs/references/**` and rechecked green. Gate families this round's files touch: 25 run, exit 0; `check:i18n-coverage` exit 3, PREREQUISITE NOT MET (example apps unbuilt), NOT MEASURED locally, CI runs it. Lines in the seat file `objectstack-seat2/36366-gates-ran.txt`. - **Ablation, the per-arm fold**: `ablation-replace.mjs` replaced `layout = { ...(layout ?? running), [scope]` with `{}` as the base (blob `67155de2c30c` → `6f6b1a29855b`); 2 failed / 11 passed (arm by arm; the S2 tenant arm kept); restored blob equals HEAD's, `git diff HEAD` empty. - **Files beyond the claim (round 2)**: `packages/spec/src/data/field-customization.ts`, `packages/spec/src/data/object-extension-arrangement.test.ts`, `packages/metadata-protocol/src/protocol-extension-arrangement.ts` and its test, `packages/objectql/src/registry-custom-arrangement.ts`, `packages/objectql/src/engine-registration.ts`, `packages/objectql/src/protocol-custom-arrangement.test.ts`, `packages/cli/src/utils/extension-arrangement.ts` (comment only). **Patch round 1, head `6303c52011`.** The branch was merged with `origin/main` at `4ef1ea9779` (objectstack-ai#36612 landed) in `ebd99fe0dd`, then the changeset's Skills-docs line was changed. Only the families that merge touched were rerun, all exit 0: - ui i18n tests: 106 files / 1978 tests. - The 268 app-shell files below: 2294 tests. - platform-objects tests: 125 / 2126. - `@object-ui/app-shell` and `@object-ui/i18n` type-check. - `check:i18n` and `check:i18n-stale-fill`. - `gen:zh-hant` (no diff). - The four changeset gates. All of the following ran at head `564840dc1b`, the final commit of round 1, after the merge of `origin/main` at `ceaa70efcc`. Every heavy run went through `os-verify-lock.sh`; each line quotes its `VERDICT`. | Package | Command | Result | |---|---|---| | `@objectstack/spec` | `test` | 881 files / 28066 tests passed (`command-exit 0`) | | `@objectstack/spec` | `typecheck` | `command-exit 0` | | `@objectstack/objectql` | `test` | 634 / 14356 passed (`command-exit 0`) | | `@objectstack/objectql` | `typecheck` | `command-exit 0` | | `@objectstack/lint` | `test` | 228 / 9474 passed (`command-exit 0`) | | `@objectstack/lint` | `typecheck` | `command-exit 0` | | `@objectstack/metadata-core` | `test` | 27 / 1056 passed (`command-exit 0`) | | `@objectstack/metadata-core` | `typecheck` | `command-exit 0` | | `@objectstack/metadata-protocol` | the changed pin file | 18/18 passed | | `@objectstack/metadata-protocol` | `typecheck` | `command-exit 0` | | `@objectstack/platform-objects` | `test` | 125 / 2126 passed (`command-exit 0`) | | `@objectstack/platform-objects` | `typecheck` | `command-exit 0` | | `@object-ui/types` | tests | 390 / 10512 passed | | `@object-ui/types` | `type-check` | `command-exit 0` | | `@object-ui/components` | tests | 507 passed, 1 skipped / 4940 passed (`command-exit 0`) | | `@object-ui/components` | `type-check` | `command-exit 0` | | `@object-ui/i18n` | tests | 106 / 1978 passed (`command-exit 0`) | | `@object-ui/i18n` | `type-check` | `command-exit 0` | | `@object-ui/app-shell` | `type-check` | `command-exit 0` | | `@object-ui/app-shell` | tests (narrowed, see below) | 268 / 2294 passed (`command-exit 0`) | **The app-shell tests at the final head are narrowed, and this is declared.** - What ran: the 268 test files that name `RecordDetailView`, `objectViewPageHeader`, the design-mode header pins or `PageHeaderActions`, or whose names match those modules, objectstack-ai#36499's record tabs, or this card. - Why not `vitest related`: it ran out of heap at 4 GB. - The full app-shell suite last ran at `72ec1b2a2`, before the merge: 2416 files passed, 1 skipped / 22791 tests (`command-exit 0`, the lock held for 5634 s). CI runs the whole suite. **Found and fixed in this round:** `@object-ui/app-shell` `type-check` was red with nine TS2353 errors. The save test's `input` helper still typed the pins as a record of string arrays. vitest does not type-check, so the tests stayed green. Fixed in `649fc028b6`. <details><summary>Ablation (one reading): the More order</summary> - Target: `arrangedHeaderActions` in `ui/packages/types`, the line that ranks a `more`-named action. - Mutation: `scripts/ablation-replace.mjs` replaced `const moreAt = name && !seen.has(name) ? moreRank.get(name) : undefined;` with `undefined`. The anchor count went 1 → 0 and the blob changed `33d1f1de663b` → `2af6af57c9fb`. - `@object-ui/types` is aliased to `src` in `ui/vitest.config.mts`, so no build was needed. - Mutated run: 3 failed / 46 passed. All three `more`-order tests went red: the side preview and the authored `page:header` in `RecordDetailView.actionLayout-36366.test.tsx`, and the list toolbar in `objectViewPageHeader.actionLayout-36366.test.tsx`. Their controls without `more` stayed green. - Restore: `git checkout HEAD --`. The blob after restore read `33d1f1de663b` (HEAD's), and `git diff HEAD` was empty. </details> <details><summary>Gates: dispatch-gates at 564840d</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 130 families. All 130 ran, one line each (`command :: exit N`) in the seat file `objectstack-seat2/36366-gates-ran.txt`. - `--ran` reconciliation: "130 derived, 130 run, 0 NOT-MEASURED, 0 UNRUN". - Two families first exited 3 (PREREQUISITE NOT MET: the client and workspace dists were unbuilt): `check:skill-examples` and `check:dual-build-cjs-loads`. Both read 0 at the same head after the client and ui closure builds. - Found red in this round, and fixed: - `check:facade-delegation-only` (registry.ts at 6433 lines against a ceiling of 6426) now reads 6426. - `check:docs-transcript-drift` (four transcripts quoted 76) now reads 77. - Local-only families: - `check:skill-frame-freshness`: exit 0. - `check:dev-prereqs`: exit 1, "The workspace is not built". Some workspace packages have no `dist` on this box. That is a machine-state reading, not about this diff. </details> ## Acceptance notes - **Server save door.** It refuses only a malformed arrangement. Live reading on the CRM example (dev server, admin): `PUT /api/v1/meta/object_extension/crm_opportunity?package=com.example.crm.custom` with `actionLayout.list.pinned` naming 4 actions answered `422` `INVALID_METADATA`. The message read: "`actionLayout.list.pinned` names 4 actions; at most 3 are drawn as buttons, and every other action goes to 「More」. Keep the first 3 and move the rest to `more`." - A name that is no action of the object, or one not placed in the arm's scope, is refused only by `os validate` / `os build` / `os lint` (`object-action-layout-unknown` / `-not-placed`) and by the design mode's Save. - The lint rule is CLI only: the runtime snapshot carries no stack `actions`, so an action bound by `objectName` would read as unknown there. - **Door-level code+status.** The schema refusals are pinned in `packages/spec` (`object-action-layout.test.ts`); the door's `INVALID_METADATA` / 422 is the live reading above. Since patch round 2 the writer refusal is pinned at the save door with `VALIDATION_ERROR` / 400 (`protocol-custom-arrangement.test.ts`). - **`registry.ts` is a facade at its line ceiling.** Since patch round 2 the fold lives in `registry-custom-arrangement.ts`, and `registry.ts` differs from main only in one docblock line (6426, the ceiling not raised). - **The CLI transcripts count 77 author-time rules.** The new lint rule is the 77th. `check:docs-transcript-drift` derives 77 for `validate` and `build`, and four transcripts that quoted 76 now say 77: `deployment/cli.mdx`, `deployment/validating-metadata.mdx`, `getting-started/build-with-claude-code.mdx`, `ui/react-pages.mdx`. - **Live-run wording.** With no list arm, the panel's sentence and the bar's `Import ▾` menu: kept as is, listed as 待审假设 11. - **Export was not offered on the CRM opportunity list in the live run** (that view has no export door), so the run pinned Import. The record scope was not run live: `crm_opportunity` declares no actions of its own. The record header, the side preview and the phone bar are covered by the unit tests below. - **Merged with main, conflicts kept both sides.** - objectstack-ai#36583 (now on main): `designMode.recordTabs` and this PR's `designMode.pins` are both kept in the 11 locales. - objectstack-ai#36411 (now on main): `de-quote-pairing-3876.test.ts` recounted by running it, 131. - objectstack-ai#36612 (now on main): `ObjectViewPageBarActions` reads its Object settings path, then this PR's list arm. `exportDoor` is `exportPinned ? undefined : barEnd?.exportDoor`, and `moreShown` is `!!objectSettingsPath || !!description || !!listFavorite || (ioInMore && (importInMenus || !!exportDoor))`. - **Overlap with open PRs** (`overlap-check --branch=HEAD` at `ebd99fe0dd`, exit 1): - objectstack-ai#36606 conflicts in `de-quote-pairing-3876.test.ts`. - objectstack-ai#36525 conflicts in `protocol.meta-types-degenerate-derivation.test.ts` and `object-lifecycle-panel-echo-decisions.test.ts`. - Whichever lands second recounts. objectstack-ai#36624, objectstack-ai#36587, objectstack-ai#36386 and origin/main merge cleanly. - **Landing class.** The diff changes more than 3,000 lines, so under AGENTS.md §7(c) it lands like Tier H. - **Owed outside this PR.** The ADR-0085 §2 and ADR-0146 D10 notes (`carrier: objectstack-ai#36086`), and `skills/objectstack-ui/rules/actions.md` (objectstack-ai#36630). - **Follow-up, outside this diff (N5).** The door comments in `packages/cli/src/commands/compile.ts`, `packages/cloud-connection/src/marketplace-install-local-plugin.ts` and `packages/metadata-protocol/src/protocol-object-extension-item.ts` (step 8) still name only `fieldGroups`, `relatedLists` and `place`; the code reads `CUSTOM_ARRANGEMENT_KEYS` and already refuses `actionLayout`. Comment-only, carrier: the seat. ## Verification - One command (expect 3 files, all green): `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/objectViewPageHeader.actionLayout-36366.test.tsx packages/app-shell/src/views/RecordDetailView.actionLayout-36366.test.tsx packages/app-shell/src/views/RecordDetailView.phoneFace-27058.test.tsx` - One click: run the CRM example, open Opportunities, click the app name at the top of the sidebar, then **Edit app** in its menu, then **Header buttons** at the end of the bar. Click the dot beside Import and press **Save**. Outside the design mode the bar shows a plain **Import** button where `Import ▾` was. - Live-run screenshots (seat files, `objectstack-seat2/36366-shots/`): - `1-list-header-before.png`: the bar with `Import ▾`. - `2-panel-before.png`: the panel, 0/3 pinned, Import in 「Other」. - `3-panel-import-pinned.png`: 1/3, Import pinned. - `5-list-header-after.png`: the bar with an Import button. - `6-server-door-422.txt`: the door's 422 reading. https://claude.ai/code/session_01ADHkmQwVVCVuN69B7ThYrP 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmQwVVCVuN69B7ThYrP --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Fixes #36442
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
A shared
FilePreviewDialogin@object-ui/fields(decision #34781, option A), opened from a record's attachments and from a file field:imgelement only) via the lightbox's own image element (LightboxImageView, extracted fromImageLightbox); PDF in aniframeon the browser's own viewer, without asandboxattribute; plain text as text; CSV as a table, read with the GBK-awaredecodeSpreadsheetTextandparseDelimited, which moved down from@object-ui/plugin-grid(it now imports them from@object-ui/fields; no copy)..htmlname wins over a declared plain-text type.application/pdf, or a.pdfname when no type is declared. A.pdfname with another declared type (for exampleapplication/octet-stream) is unsupported, so the frame never receives bytes the browser would read as anything else./files/:id/urlwith the console's token, now onesignedUrlForboth use), and a refusal shows the download's own copy. On a file field the preview uses the field's own link (the stable/files/:idendpoint) and first asks it withredirect: 'manual': a redirect is the grant, a 401/403 is the refusal, so no byte moves twice.useIsMobilebreakpoint a PDF is offered in a new tab (the system viewer), never framed; image, text and CSV stay in the page.GETon the signed link from the page; when the browser refuses that read (no bucket CORS rule for the console origin), the dialog offers "Open in new tab" instead.RecordAttachmentsPanel, the row's name is now a button that opens the preview (download stays in the row's menu);FileValueAffordance(file-affordance.tsx), a plain click opens the preview, a modified click keeps the link's own new tab, and a click inside the dialog does not bubble to the grid row behind its portal.fields.filePreviewin all 12 packs (zh-Hant regenerated from zh-Hans by its generator).New public exports from
@object-ui/fields(preferred names, built under them):FilePreviewDialog,FilePreviewDialogProps,FilePreviewItem,decodeSpreadsheetText,parseDelimited. Alternatives considered:FileViewerDialog/FileViewerDialogProps/FileViewerItem.New
@object-ui/i18nkeys (every pack):fields.filePreview.title,fields.filePreview.previous,fields.filePreview.next,fields.filePreview.download,fields.filePreview.openInNewTab,fields.filePreview.loading,fields.filePreview.tooLarge,fields.filePreview.unsupported,fields.filePreview.denied,fields.filePreview.loadFailed,fields.filePreview.blocked,fields.filePreview.pdfOutside,fields.filePreview.truncatedRows,fields.filePreview.truncatedLines,fields.filePreview.empty.Read first, by risk:
filePreviewKind(which bytes may reach theiframe),useResolverinFilePreviewDialog.tsx(the refusal probe and the one-resolver-per-dialog rule), thenpreviewSignedUrl/signedUrlForinRecordAttachmentsPanel.tsx.Two-minute check:
pnpm --dir ui exec vitest run packages/fields/src/widgets/FilePreviewDialog-36442.test.tsxshows 51 passing.Tests
ui/packages/fields/src/widgets/FilePreviewDialog-36442.test.tsx: the kind table (Office, HTML, SVG, PDF-signal cases); each view and its element; SVG only asimg, noiframe/object, bytes never fetched; text drawn as text (a script tag in the file stays text); GBK CSV; the 1000-row cap; Office and HTML download only with nothing resolved, fetched or framed; too large per kind, a control at exactly the limit, and a text file judged on its bytes; the refusal fromresolveUrl, from the default probe (403), from the text read (403), with a redirect as the control; the CORS-blocked read offering the new tab; previous / next / arrow keys / wrap; download and new tab; phone PDF in a new tab and phone image in the page; the field link opening the preview, a modified click not, a refused field file, a Word field file.RecordAttachmentsPanel.test.tsx, new top-leveldescribe: the name opens the preview on the signed link, next walks to the next row's own link, a refused reader gets the download's copy (and the link is asked once), a Word file offers only the download and that download is the row menu's, the row menu still carries Download.importParsers.test.ts, newdescribe: the wizard'sparseDelimited/decodeSpreadsheetTextare the very functions@object-ui/fieldsexports.getByText('report.pdf')keep passing on the new name button.Acceptance notes
FileField.tsxand the cell renderer in the fields barrel, outside this card's claimed file surface. The attachments panel walks its whole list.useIsMobile, under 768 px), not a device check.fetch, which ignores the disposition; feat(cli): the console's frame-src names the storage origin a PDF preview frames, and nothing wider #36565 measured Chromium mounting its PDF viewer under that PR's sandbox header). The "Open in new tab" for a CSV would download it rather than display it once fix(service-storage)!: stored bytes outside the inline allow-list are served as attachments, with nosniff and a sandbox CSP #36518 lands.frame-srcand the text and CSV reads need the bucket CORS rule cli/storage: let the console frame a PDF from the storage origin, and document the bucket CORS the file preview needs #36443 documents; without them the dialog offers the new tab, as that card's contract states.FILE_DOWNLOAD_DENIED(field-owned files) has no friendly copy in the attachments panel's mapper; the panel only mapsATTACHMENT_DOWNLOAD_DENIED. The preview shows exactly what the download shows. Observation only.Verification
Screenshots: NOT MEASURED. Reason: the relay writes text bodies only and no write door here uploads an image to a pull request; a live Console run was not started in this container.
Package suites on the merged head (ab1feda, then c131bca and 81b19aa for the census fixes)
Ablation: delete the default probe's refusal (one line in useResolver)
Derived gate list on 81b19aa: 42 of 42 run, all exit 0
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE: "42 derived famil(ies) accounted for — 42 run, 0 NOT-MEASURED".check:type-check-debtand the uiscripts/suite ran under the shared verify lock.node scripts/pm/overlap-check.mjs: VERDICT clean exit 0.CI on 81b19aa: every required check green (Lint & Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate; Build Core skipped by its selector).
Two shared censuses the first CI round named are now satisfied without touching them: the dialog's width is
sm:max-w-[92vw] xl:max-w-5xl, a viewport-relative cap that keeps a margin at every width (the gutter census counts it as not wide), and the dialog stops its own clicks at its content rather than through a clickable wrapper element (the clickable-non-control census).🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmRB34k9WUWeGpRnVNm