Skip to content

Commit 70d07fd

Browse files
feat: an object's action layout per scope, pinned and more, set from the design mode (#36366) (#36629)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9XUZ1viPwnt3ZWuPpxejiN3)_ Fixes #36366 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up #36630 ADR notes: carrier #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: 「#36366 改成"列表"和"记录"两组,每组分"固定"和"更多"两段,等 #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: #36494 (row menu and right-click), #36495 (the `locations` vocabulary), #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 #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 #36635 and is untouched). - **Merge**: `origin/main` `6e643cc43e` merged in `d871e26fdb` with no conflict (it brings #36624's one writer and #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 #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` (#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, #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.** - #36583 (now on main): `designMode.recordTabs` and this PR's `designMode.pins` are both kept in the 11 locales. - #36411 (now on main): `de-quote-pairing-3876.test.ts` recounted by running it, 131. - #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): - #36606 conflicts in `de-quote-pairing-3876.test.ts`. - #36525 conflicts in `protocol.meta-types-degenerate-derivation.test.ts` and `object-lifecycle-panel-echo-decisions.test.ts`. - Whichever lands second recounts. #36624, #36587, #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: #36086`), and `skills/objectstack-ui/rules/actions.md` (#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>
1 parent 03cb550 commit 70d07fd

82 files changed

Lines changed: 3726 additions & 91 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/objectql': minor
4+
'@objectstack/lint': minor
5+
'@objectstack/metadata-core': patch
6+
'@objectstack/metadata-protocol': patch
7+
'@objectstack/platform-objects': patch
8+
'@object-ui/types': minor
9+
'@object-ui/components': patch
10+
'@object-ui/app-shell': patch
11+
'@object-ui/i18n': patch
12+
---
13+
14+
feat: an object arranges its actions per scope (`actionLayout`: pinned buttons and the 「More」 order), and the design mode sets it
15+
16+
Clause-②: yes (widening)
17+
Metadata-protocol: added
18+
Skills-docs: follow-up #36630
19+
20+
A page header draws at most three of its actions as buttons and puts the rest in its 「More」 menu. An object now arranges them itself with the new optional key `actionLayout` on `ObjectSchema` and `ObjectExtensionSchema`: `{ list?: Arm, record?: Arm }`, where `Arm = { pinned: string[], more?: string[] }`. `pinned` names the buttons in the order drawn, at most three (`[]` pins none); `more` orders the 「More」 menu; an action the scope places that neither part names goes to the end of 「More」 in its default order. A pinned action that is hidden leaves its button out, and no other action takes its place.
21+
22+
- `list` arranges the actions placed at `list_toolbar` and the list page's built-ins `$import` and `$export`. A built-in is only ever pinned: one named in `more` is refused with its reason, since not pinned the list page draws it in its own Import / Export menu.
23+
- `record` arranges the actions placed at `record_header` or `record_more`. It is a scope, not a page: the record page header, the side preview and a phone's bottom action bar all read it. A `page:header` that authors its own `actions` list keeps that list.
24+
- An arm left out (or the key left out) draws that scope exactly as before.
25+
26+
What each package gains:
27+
28+
- `@objectstack/spec`: the key and its shape refusals at every door (more than three pinned, a name given twice in one part or in both, a malformed name, a built-in the scope does not have, a built-in in `more`, since a built-in is only ever pinned), each with its reason. New exports `OBJECT_ACTION_LAYOUT_PINNED_LIMIT`, `OBJECT_ACTION_LAYOUT_SCOPES`, `OBJECT_ACTION_LAYOUT_BUILTINS` and the types `ObjectActionLayoutScope`, `ObjectActionLayout`, `ObjectActionLayoutArm`. The object form offers it under Advanced, one JSON row per arm.
29+
- `@objectstack/objectql`: `actionLayout` joins `fieldGroups` and `relatedLists` as a key only the base's paired `.custom` package writes on an `object_extension` (ADR-0146 D10). It is applied last, after every other layer, arm by arm: each arm it writes replaces the served arm for that scope whole, and an arm it leaves out stays. A manifest's `objectExtensions` entry now carries the key to the fold.
30+
- `@objectstack/metadata-protocol`: the one judge refuses `actionLayout` from any other package, naming the action's own `locations` and `order` as the way to place an action the package brings. Each door says it its own way: publish, restore and draft promotion of an `object_extension` 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.
31+
- `@objectstack/lint`: `validateObjectActionLayout` (`object-action-layout-unknown`, `object-action-layout-not-placed`, at `error`) refuses in `os validate`, `os build` and `os lint` a name, in either part, that is no action of the object or is not placed in the scope its arm arranges.
32+
- `@object-ui/types`: `arrangedHeaderActions(actions, arm, scope)`, the one reader both record headers and the list header apply, and `readActionLayoutArm`.
33+
- The console: both record headers (the default page's and an authored `page:header` with `placedActions: true`) and the list header draw the arrangement. In the design mode, 「Header buttons」 at the end of the page header lists the scope's actions under 「Pinned to header」 and 「Other」 (the 「More」 menu), each dragged into order; a dot moves an action between them, a fourth pin is refused with a toast, the header shows the change at once, and 「Save」 writes only the arms that changed: into the object's own package when it is writable, else into the installed object's customization package as an `object_extension`, through the one writer of an installed object's arrangement (`saveObjectExtensionArrangement`, whose patch type now takes the object-shaped `actionLayout`), which refuses a customization package the server does not list writable. A name the scope no longer offers is listed in the panel as left out. A name the header cannot draw is refused at save with its reason. New `@object-ui/i18n` keys under `designMode.pins`.

‎content/docs/data-modeling/object-extensions.mdx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ check that spelling first.
7171
| `description` | Same as `label`. |
7272
| `place` | **Applied once, after every extension's fields are merged.** Says where the fields, groups and child lists this extension brings go on the target — [below](#placing-what-you-bring). |
7373
| `fieldGroups`, `relatedLists` | **Only in a base's paired `.custom` package. Each replaces, whole.** The complete field arrangement and the complete tab list of the target, applied last — [below](#arranging-the-whole-record-page). In any other package they are refused, and `place` is the key to use. |
74+
| `actionLayout` | **Only in a base's paired `.custom` package. Applied arm by arm, last.** Each `list` or `record` arm it writes (`{ pinned, more }`) replaces the arm the target serves for that scope whole; an arm it leaves out stays. In any other package it is refused, and an action the package brings is placed by its own `locations` and `order`. See [choosing the header's buttons](/docs/ui/actions#choose-the-headers-buttons). |
7475
| `priority` | Not merged — it *orders* the merge. `0`–`999`, default `200`. |
7576

7677
Added fields are ordinary fields, so everything on the
@@ -276,7 +277,8 @@ D10). The object is extended, never replaced:
276277
- **An object takes no `overrides` declaration.** Declaring one on an object is refused,
277278
naming the extension as the route.
278279
- **The pair may arrange the whole record page.** Its extension, and no other package's,
279-
writes `fieldGroups` and `relatedLists` — [below](#arranging-the-whole-record-page).
280+
writes `fieldGroups` and `relatedLists` — [below](#arranging-the-whole-record-page) —
281+
and `actionLayout`, the order of the object's actions and which are header buttons.
280282

281283
{/* os:check */}
282284
```typescript

‎content/docs/deployment/cli.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ os compile --json # JSON output for CI pipelines
937937
→ Normalizing stack definition...
938938
→ Lowering inline handlers...
939939
→ Validating protocol compliance...
940-
→ Running author-time rules (76)...
940+
→ Running author-time rules (77)...
941941
→ Checking that every required capability has a provider installable in this edition...
942942
→ Collecting package docs (ADR-0046)... 0 collected
943943
→ Writing artifact...

‎content/docs/deployment/validating-metadata.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ A clean run walks the registry and reports timing:
867867
Config: /path/to/support-desk/objectstack.config.ts
868868
Load time: 21ms
869869
→ Validating against ObjectStack Protocol...
870-
→ Running author-time rules (76)...
870+
→ Running author-time rules (77)...
871871
→ Checking that every required capability has a provider installable in this edition...
872872
→ Checking package docs (ADR-0046)...
873873

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ visible: 'status != "resolved"'
311311
◆ Validate
312312
────────────────────────────────────────
313313
→ Validating against ObjectStack Protocol...
314-
→ Running author-time rules (76)...
314+
→ Running author-time rules (77)...
315315
316316
✗ Author-time rules failed (1 issue)
317317
• stack · action 'resolve_ticket' visible: bare reference `status` — a

‎content/docs/references/api/metadata.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,7 @@ Metadata query with filtering, sorting, and pagination
939939
| **description** | `string` | optional | Developer documentation / description |
940940
| **icon** | `string` | optional | Icon name (Lucide/Material) for UI representation |
941941
| **color** | `Enum<'gray' \| 'blue' \| 'teal' \| 'green' \| 'amber' \| 'orange' \| 'red' \| 'pink' \| 'purple'>` | optional | Object colour, one name from the fixed palette (gray, blue, teal, green, amber, orange, red, pink, purple). The console draws the object's icon as a white glyph on a rounded square of this colour, so one object looks the same wherever its icon appears. No free colour values. Omit to draw the neutral `gray`. |
942+
| **actionLayout** | `{ list?: object; record?: object }` | optional | The order of the object's actions and which are buttons, per action scope (`list`, `record`): `pinned` (at most 3 buttons, in order) and `more` (the 「More」 menu order; unnamed actions follow in their default order). Omit to keep each surface's own choice (each action's `order`). |
942943
| **isSystem** | `boolean` | optional (default: `false`) | Is system object (protected from deletion; defaults its org-wide sharing to public when no sharingModel is set — plugin-sharing) |
943944
| **managedBy** | `Enum<'platform' \| 'config' \| 'system-data' \| 'engine-owned' \| 'append-only' \| …>` | optional | Lifecycle bucket — platform (user CRUD) \| config (admin authored) \| system-data (platform-defined schema, admin/user-writable data) \| engine-owned (engine owns the lifecycle, no user writes) \| append-only (audit) \| synced (rows copied by a pull from a connector or federated source; read-only to members, and userActions cannot open a write) \| better-auth (identity). UI clients honour the resolved affordance matrix. |
944945
| **ownership** | `Enum<'user' \| 'business_unit' \| 'org' \| 'none'>` | optional | Record-ownership model: user (default — injects reassignable owner_id plus owning_business_unit_id) \| business_unit (unit-owned: owning_business_unit_id only, no owner_id) \| org \| none (no per-record owner, neither anchor). Distinct from the package own/extend contribution kind. |

‎content/docs/references/data/object.mdx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const result = ApiMethod.parse(data);
151151
| **description** | `string` | optional | Developer documentation / description |
152152
| **icon** | `string` | optional | Icon name (Lucide/Material) for UI representation |
153153
| **color** | `Enum<'gray' \| 'blue' \| 'teal' \| 'green' \| 'amber' \| 'orange' \| 'red' \| 'pink' \| 'purple'>` | optional | Object colour, one name from the fixed palette (gray, blue, teal, green, amber, orange, red, pink, purple). The console draws the object's icon as a white glyph on a rounded square of this colour, so one object looks the same wherever its icon appears. No free colour values. Omit to draw the neutral `gray`. |
154+
| **actionLayout** | `{ list?: object; record?: object }` | optional | The order of the object's actions and which are buttons, per action scope (`list`, `record`): `pinned` (at most 3 buttons, in order) and `more` (the 「More」 menu order; unnamed actions follow in their default order). Omit to keep each surface's own choice (each action's `order`). |
154155
| **isSystem** | `boolean` | optional (default: `false`) | Is system object (protected from deletion; defaults its org-wide sharing to public when no sharingModel is set — plugin-sharing) |
155156
| **managedBy** | `Enum<'platform' \| 'config' \| 'system-data' \| 'engine-owned' \| 'append-only' \| 'synced' \| 'better-auth'>` | optional | Lifecycle bucket — platform (user CRUD) \| config (admin authored) \| system-data (platform-defined schema, admin/user-writable data) \| engine-owned (engine owns the lifecycle, no user writes) \| append-only (audit) \| synced (rows copied by a pull from a connector or federated source; read-only to members, and userActions cannot open a write) \| better-auth (identity). UI clients honour the resolved affordance matrix. |
156157
| **ownership** | `Enum<'user' \| 'business_unit' \| 'org' \| 'none'>` | optional | Record-ownership model: user (default — injects reassignable owner_id plus owning_business_unit_id) \| business_unit (unit-owned: owning_business_unit_id only, no owner_id) \| org \| none (no per-record owner, neither anchor). Distinct from the package own/extend contribution kind. |
@@ -197,6 +198,13 @@ const result = ApiMethod.parse(data);
197198
| **_packageVersion** | `string` | optional | Owning package version. |
198199
| **_lockDocsUrl** | `string` | optional | Optional documentation link surfaced next to _lockReason. |
199200

201+
### Nested Shape: `Object.actionLayout`
202+
203+
| Property | Type | Required | Description |
204+
| :--- | :--- | :--- | :--- |
205+
| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. |
206+
| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as drawn in the record header (record page, side preview, a phone's bottom bar). Omit to draw it as before. |
207+
200208
### Nested Shape: `Object.userActions`
201209

202210
| Property | Type | Required | Description |
@@ -616,6 +624,7 @@ const result = ApiMethod.parse(data);
616624
| **label** | `string` | optional | Override label for the extended object |
617625
| **pluralLabel** | `string` | optional | Override plural label for the extended object |
618626
| **description** | `string` | optional | Override description for the extended object |
627+
| **actionLayout** | `{ list?: object; record?: object }` | optional | The arrangement of the extended object's actions, per scope (`list`, `record`), in the object's own shape. Written only by the object extension of the paired `.custom` package of the App the object belongs to (ADR-0146 D10). An extension in a package that is not a `.custom` package is refused at publish, by `os validate` / `os build` and at install, and the registry merge skips it with a warning; an action that package brings is placed by its own `locations` and `order`. A `.custom` package that is not this object's pair is not applied. Each arm written replaces the arm the object serves for that scope, whole, after every other layer; an arm not written stays as the object gives it, and removing the key, or uninstalling or disabling the package, restores it. |
619628
| **validations** | `any[]` | optional | Additional validation rules to merge into the target object |
620629
| **indexes** | `{ name?: string; fields: string[]; unique?: false \| 'global' \| 'organization' }[]` | optional | Additional indexes to merge into the target object |
621630
| **place** | `({ field: string; group: string; after?: string; before?: string } \| { list: string; after?: string; before?: string; label?: string; … } \| { group: object; after?: string; before?: string })[]` | optional | Where the fields, groups and child lists this extension brings go on the extended object. Each entry is one of: `{ field, group, after \| before }` — a field of this extension's own `fields`, into a field group (the extended object's, or one this extension adds), right after or before a member of that group; `{ group: { key, label, … }, after \| before }` — a field group of this extension's own (its `fields` may name only fields this extension adds, its `relatedList` only a child list of this package), right after or before a group of the extended object; `{ list, after \| before, label?, columns? }` — a child list of this package (a child object of the same package that points at the extended object, or object.field), right after or before a tab of the extended object (a relatedLists entry name, a built-in tab included), with that tab's own title and columns (each column a field of the child, judged as a relatedLists entry's columns are). Write `after` or `before`, or neither for the end. An anchor may be an item another placement brings, whatever order the two are written or registered in. An anchor nobody has puts the item at the end of its group, of the groups, or of the tabs (before the approvals and activity-stream tabs); a group that does not exist puts the field among the ungrouped fields. Nothing is dropped. Several items at one anchor follow ascending `priority`, then package name, so every build gives the same order. Placement arranges what the extended object declares: list placements apply when it declares `relatedLists`, group and field placements when it declares `fieldGroups`. Where it declares none, its automatic arrangement stays as it is and the item still shows there: the list in the automatic tab order, with this entry's `label` and `columns` not applied either (write them on the child's own lookup field as `relatedListTitle` / `relatedListColumns`, which apply on every parent), and the field among the fields in declaration order, its `after` / `before` not applied. The boot log names each placement that did not apply, with the object and the package; `os validate` names it too when the extended object is in the same stack. A child list another package brings shows even when the extended object's `relatedLists` does not name it: placed, at its place; unplaced, at the end of the tabs. An extension places only its own items: a field outside its own `fields` is refused here; a field the extended object declares (an owner field this extension redeclares for its display is still the owner's), a group key the extended object declares, and a list (or a group's `relatedList`) that is not a child object of its package are refused at `defineStack` where the objects are known; the merge skips each of them too, with a warning naming whose item it is. A group key another package's extension already adds is not refused: the merge adds it once and names the second. Applied once, by the registry merge, so the record page, the forms and Studio show one arrangement; uninstalling the package removes its items and leaves the extended object's own order as it was. Example: `place: [{ field: 'tax_id', group: 'basic', after: 'industry' }, { list: 'contract', after: 'opportunity', columns: ['name', 'amount'] }]`. |
@@ -724,6 +733,13 @@ const result = ApiMethod.parse(data);
724733
| **placeholder** | `string` | optional | Placeholder text rendered inside the empty input (the HTML placeholder attribute); disappears once a value is entered. Distinct from `inlineHelpText` (always-visible help rendered beside/under the input) and `description` (tooltip/developer documentation). |
725734
| **options** | `Record<string, { label?: string }>` | optional | Display patches of the base field's options, keyed by each option's stored `value` (which stays the vendor's); each entry takes the option display keys of BASE_FIELD_DISPLAY_WHITELIST. |
726735

736+
### Nested Shape: `ObjectExtension.actionLayout`
737+
738+
| Property | Type | Required | Description |
739+
| :--- | :--- | :--- | :--- |
740+
| **list** | `{ pinned: string[]; more?: string[] }` | optional | The list scope's arrangement: actions of the object placed at `list_toolbar`, as drawn on the list page toolbar, and `$import` / `$export` as pinned buttons (not pinned, they stay in the page's own Import / Export menu). Omit to draw it as before. |
741+
| **record** | `{ pinned: string[]; more?: string[] }` | optional | The record scope's arrangement: actions of the object placed at `record_header` or `record_more`, as drawn in the record header (record page, side preview, a phone's bottom bar). Omit to draw it as before. |
742+
727743
### Nested Shape: `ObjectExtension.indexes[number]`
728744

729745
| Property | Type | Required | Description |

0 commit comments

Comments
 (0)