Repository navigation
Commit d7411fa
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Wq5utqEodnDCBh6heq37AG)_
Fixes #36499
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:管理员在已安装(只读)应用的记录页「…」第一项就能「配置页签」,可拖动全部页签、隐藏或恢复关联页签,每个页签标明来自原包、其他包还是本环境;保存后所有人看到新排列,原包不动。自建应用的入口也挪到「…」第一项。
- 为什么做:本卡「记录页就地配置页签」的第二个也是最后一个合并请求,替管理员省去进 Studio 改已安装对象的绕路。
-
出错会怎样:只影响已安装对象记录页的页签排列,写在该应用配对的定制包里;管理员可再次进入配置改回,原包始终不变。定制总览读接口暂不列出页签排列,已另开卡跟进(定制总览列出页签排列)。
- 要你做什么:无(是否允许在已安装对象上隐藏附件、审批、动态三个内置页签,已另开决策卡等你裁定)。
## What changes
**Installed objects (card items 4 and 7).** On the record page of an
object whose package is installed read-only, 「Configure tabs」 is now
offered too. The gate is PR 1's admin gate (Studio opens the object,
posture `view` here) plus `useCustomizeDoorWalled()`: where the
customization door is walled (`group` / `isolated`), the entry is not
offered. The edit state is the same one PR 1 built: the design-mode
shell from #36437, reused unchanged.
- Every tab can be moved: the object's own lists, a list another package
brings, and the built-in 附件 / 审批 / 动态.
- A related tab can be hidden and shown again. A built-in tab cannot be
hidden here, because the `.custom` list cannot hide it (spec: "cannot be
hidden here"). An attachments tab the base does not draw waits in
「Hidden」 and can be shown from there.
- Each related tab carries a source mark: 「Original package」, 「From
PACKAGE」 or 「This environment」.
- 「Save」 writes the `relatedLists` of the pair's object extension
(`object_extension`, filed under the object's name, in the base's paired
`.custom` package), in #36498's shape. The write lists every shown tab
in order (a built-in by its bare name) and then every hidden related tab
as `{ list, hidden: true }`. A tab the list does not name is served
after the named ones.
- The pair is resolved through the ensure door (`POST
/packages/:id/ensure-customization`). That door creates the pair on the
first save, as Studio does. A pair the server does not list as writable
is refused before any write.
**One shared writer.** `views/objectExtensionArrangementSave.ts`,
`saveObjectExtensionArrangement`, is the only write of an installed
object's arrangement keys (`CUSTOM_ARRANGEMENT_KEYS`).
- It reads the pair's STORED extension and the object as stored (the
layered read).
- It replaces only the keys its caller returns. Every other key is kept:
`fields`, `fieldPatches`, `place`, the other arrangement key.
- It saves a draft with the first-write pin (`ifNoneMatch: '*'`), then
publishes. A refused publish discards that draft.
- It announces the refresh through the door.
The field-layout editor in #36505 is meant to be its second caller
(`fieldGroups`). #36505 is not implemented here.
`resolveRecordTabsSaveTarget` now answers `{ kind: 'package' } | { kind:
'pair' }`.
**The 「…」 entry is the first item (card item 1).** `page:header`
(`containers.tsx`): a host overflow entry that declares `leadsMenu:
true` is drawn first, ahead of Refresh, with a separator. Only host
entries can claim this place; an authored action cannot. The record
page's 「Configure tabs」 declares it, on self-built and installed objects
alike. No other entry declares it, so no other menu changes.
**A stored title is kept (fix to PR 1's write).** Since #36574, the
served `relatedLists` labels are translated for the reader. PR 1 wrote
the editor's labels back as they were, which would have stored a
reader's translation as the title. Now a tab's stored label is written
unless the administrator renamed it (`recordTabLabelToWrite`). This
holds on both paths.
**i18n.** New keys under `designMode.recordTabs`: `pairNotWritable`,
`builtinMoves`, `sourceBase`, `sourcePackage`, `sourceEnvironment`. They
are added to all eleven locales; zh-Hant is regenerated by
`gen-zh-hant`.
## Tests
New files, named for the card:
-
`ui/packages/app-shell/src/views/__tests__/objectExtensionArrangementSave-36499.test.ts`
(6)
-
`ui/packages/app-shell/src/views/__tests__/recordTabsInstalled-36499.test.ts`
(7)
-
`ui/packages/app-shell/src/views/__tests__/RecordTabsConfigInstalled-36499.test.tsx`
(3)
**Existing tests changed** (both are PR 1's):
-
`ui/packages/app-shell/src/views/__tests__/recordTabsConfigSave-36499.test.ts`:
- the doors gain `ensureCustomization` and `client.get`;
- TEXTS gains `pairNotWritable`;
- the read-only refusal case is replaced by the pair target;
- the seam test expects the pair target.
-
`ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx`:
- `renderHeader` takes `headerSystemActions`;
- a new describe has 2 cases for `leadsMenu`.
Ablations. The fix was committed first. Each mutation was written with
`ablation-replace.mjs`, and each restore was proven by blob == HEAD.
- Dropping the `leadsMenu` flag: 1 test red.
- `recordTabLabelToWrite` returning the served label: 2 tests red.
<details><summary>Test and gate runs at head c7f9b58 (all through
os-verify-lock)</summary>
- The card's files plus PR 1's: 7 files, 44/44 passed.
- `packages/app-shell/src/views/RecordDetailView.*`: 99 files, 826/826
passed.
- components `page-header*`, `layout-containers*`,
`horizontal-overflow*`, `page-tabs*`, plus plugin-detail
`RecordPageColumns*` and `RecordRelatedListRenderer*`: 64 files, 598/598
passed.
- i18n `src/__tests__`: 106 files, 1978 passed and 13 skipped.
- `ui/scripts/` (a derived family): 174 files, 5127 passed and 2
skipped.
- `type-check` (both `tsconfig.json` and `tsconfig.test.json`) for
app-shell, components and i18n: exit 0.
- `dispatch-gates --commands`: 41 derived families, all run, all exit 0.
`--ran` reconciles them as 41 run, 0 NOT-MEASURED.
- The 40 `ui` lint-workflow checks, including `check:spec-symbols`,
`check:i18n-keys`, `check:i18n-drift` and `check:metadata-write-doors`:
exit 0.
- `check:doc-examples`, `check:doc-snippets` and `check:readme-exports`
first answered PRECONDITION NOT MET because `@object-ui/cli` was not
built. After building it, all three gave exit 0.
- `check:new-line-citations`: exit 0.
- `check:test-source-alias` and `check:nul-bytes` (both derived): exit
0.
- eslint with the ADR-0054 `no-synthetic-event-trigger` ratchet, on the
24 changed ui files: exit 0.
</details>
At head 28193db (patch round 1, after a merge of main): own and PR 1
files plus `DataPillar.panelHold-27629` 8 files 49/49; `ui/scripts/`
5127 passed and 2 skipped; app-shell and components `type-check` exit 0;
41 derived families exit 0, with `--ran` reporting 0 NOT-MEASURED;
`check:i18n-keys`, `check:i18n-drift`, `check:spec-symbols`,
`check:new-line-citations` and the three `check:vi-mock-*` checks exit
0. The large neighbour suites (RecordDetailView.*, i18n, page-header)
were not re-run locally after this merge; CI runs them.
## Acceptance notes
- **The customizations read does not list an arrangement: moved to
#36626** (seat routing, 2026-11-23 04:26Z). After the save, `GET
/api/v1/packages/com.example.showcase/customizations` answered `200`
with every list empty. The extension itself is there: `GET
/api/v1/meta/object_extension/showcase_account?package=com.example.showcase.custom`
answers it. The read's contract is strict and names exactly three member
kinds, `extensions.kind` = `field` | `validation` | `index`, so a
`relatedLists`-only extension (and a `fieldGroups`-only one, for #36505)
has no entry to appear as. Making it appear is a spec and runtime
change, carried by #36626, not by this PR.
- **H2 (a per-tab source on `_relatedListsArrangement`) does not hold;
the narrow gap below is an accepted deviation** (seat routing,
2026-11-23 04:26Z; no card). The decoration carries `{ packageId,
hidden, unlisted }` and nothing per tab. The source marks are derived
from data the client already has:
- the child object's `_packageId`: the base means the original package;
`sys_metadata` or a `.custom` package means this environment; anything
else means that package;
- a relationship field named `__c` means this environment.
The remaining gap: a relationship field that another package's extension
adds to a base-owned child object shows as 「Original package」. Closing
it needs a per-tab source from the server. No spec or server change is
made here.
- **Built-in tabs stay locked here: hiding them goes to decision card
#36627** (seat routing, 2026-11-23 04:26Z). On installed objects 附件 / 审批
/ 动态 can be moved but not hidden: the spec says the `.custom` list
cannot hide them ("cannot be hidden here"). They are not renamable
either, on either path: a built-in entry is a bare name in the spec's
shape and carries no label, so there is no place to store a rename. Seat
ruling 7089839334 (no spec card for hiding 审批/动态 on self-built objects)
is unchanged.
- **Translated labels.** PR 1 combined with #36574 would have written a
reader's translated tab title into the stored definition on any save.
Fixed on both paths; see What changes.
- **Visible effect beyond the card.** 「Configure tabs」 now sits above
Refresh in every record 「…」 where it is offered, including on self-built
objects (PR 1 placed it after Refresh). No other menu entry moves.
- **Observation, not filed.** For an installed object, the layered
read's `code` layer (`GET
/meta/object/showcase_account/layers?package=com.example.showcase`)
answered the extension-folded `relatedLists`, while the showcase source
declares none. The writer reads entries in the order extension first,
then owner, so this does not change what is written. I note it because a
reader of `code` would take the result for the package's own definition.
- **CI patch round 1 (head 28193db).** At c7f9b58, `Test UI (13/16)`
went red on one test that this change does not touch:
`DataPillar.panelHold-27629` › "Show me" reopens the action…, a 3000 ms
`waitFor` on the held line. That test was last changed by #36597 on
main. No file in its import graph is in this diff, and the dom project
runs `isolate: true`, so no other file's mocks reach it. Under
os-verify-lock it passed alone (5/5) and with all 41 `DataPillar.*`
files on 4 workers (209/209). The merge group's CI for #36597 and the
later runs on main are green. I read it as a timing flake in a loaded
shard (that file took 10 s there), not a defect of this change, so no
code or test was changed for it. The new head is a merge of main
(3110de5), which re-runs CI.
- **H1 holds.** The extension is written as `object_extension` in the
pair, and only `relatedLists` is replaced (unit:
`objectExtensionArrangementSave-36499` keeps `fields`, `fieldPatches`,
`place` and `fieldGroups`). Live: the second save in the browser pass
read back the first save's extension and replaced only its list.
## Verification
Browser pass at head `0aacc5aad`, with the same code as this head; the
merge of main brought in no file this change reads.
- Booted example app: `examples/app-showcase` (`objectstack dev --ui
--seed-admin`, own port and DB). The console was rebuilt from this
branch.
- Installed read-only package: `com.example.showcase` (type app,
`writable: false`).
- Object: `showcase_account`, record Northwind.
- Before the first save: no `com.example.showcase.custom` package
existed, and the customizations read was empty.
- To show a tab from another package, the run's DB holds a QA package
`com.qa.tabs` with an object `qtab_visit` that looks up
`showcase_account`. It exists only in the run's DB.
<details><summary>Admin, 1440: reorder, hide, save, reload</summary>
- 「…」 read `Configure tabs, Refresh, Share, Change Owner, Delete`.
- Editor chips:
- `showcase_contact` [Original package]
- `showcase_field_zoo.f_lookup` [Original package]
- `showcase_field_zoo.f_lookups` [Original package]
- `qtab_visit` [From Tabs QA]
- 审批
- 动态
- I dragged Visits first, hid 「Field Zoo · Lookup → Accounts (multiple)」
and saved. The writes, in order:
- `POST /api/v1/packages/com.example.showcase/ensure-customization`
- `PUT
/api/v1/meta/object_extension/showcase_account?mode=draft&package=com.example.showcase.custom`
- `POST
/api/v1/meta/object_extension/showcase_account/publish?package=com.example.showcase.custom`
- Nothing was written to `com.example.showcase`.
- Tabs after save and after a reload: `Details, Visits, Contacts, Field
Zoo, Activity`.
- The pair's extension then read
`{"extend":"showcase_account","relatedLists":["qtab_visit","showcase_contact","showcase_field_zoo.f_lookup","sys_approval_request","sys_activity",{"list":"showcase_field_zoo.f_lookups","hidden":true}]}`.
- The served object carries `_relatedListsArrangement:
{"packageId":"com.example.showcase.custom","hidden":["showcase_field_zoo.f_lookups"],"unlisted":"shown"}`.
</details>
<details><summary>Original package unchanged</summary>
- `GET
/meta/object/showcase_account/layers?package=com.example.showcase`
answers `overlay: null`, `draft: null`, `provenance: package`,
`editable: false`.
- `GET /meta/object_extension?package=com.example.showcase` answers
`items: []`.
- `git status examples/` is clean.
- The customizations read: see Acceptance notes.
</details>
<details><summary>Another account (plain member), 1440 and
1280</summary>
- 「…」 read `Refresh, Share`: no entry.
- The member's served object carries the same `relatedLists` and the
same `_relatedListsArrangement`.
- Tabs drawn: `Details, Field Zoo, Activity`. The multi-lookup tab is
hidden. Visits and Contacts are not drawn because the member has no read
on `qtab_visit` and `showcase_contact` (`403 PERMISSION_DENIED` on the
data read), as before this change.
</details>
<details><summary>Admin, 1280: second save over the existing
extension</summary>
- The menu's first item is 「Configure tabs」.
- On reopening, the editor shows the saved order and 「Field Zoo · Lookup
→ Accounts (multiple)」 in 「Hidden」.
- I moved 动态 ahead of 审批, showed the hidden tab again and saved. The
same three writes followed (ensure, pinned draft, publish).
- After a reload: `Details, Visits, Contacts, Field Zoo · Lookup →
Account, Field Zoo · Lookup → Accounts (multiple), Activity`.
- A separate drag (not saved) moved 动态 to the very front, so built-ins
move to any place.
</details>
<details><summary>Self-built path (PR 1), admin, 1280</summary>
- On `qtab_account` (package `com.qa.tabs`, writable), 「…」 read
`Configure tabs, Refresh, …`.
- Chips carry no source mark.
- I dragged People first and saved. The writes were `PUT
/meta/object/qtab_account?mode=draft&package=com.qa.tabs`, then `POST
…/publish?package=com.qa.tabs`.
- After a reload: `People, Deals, Tickets, Attachments, Activity`.
</details>
The 「This environment」 mark is covered by
`RecordTabsConfigInstalled-36499` and `recordTabsInstalled-36499`. It
was not set up in the browser.
Screenshots (`/mnt/project-files/objectstack-seat2/shots/36499-pr2/`):
- `01-admin-1440-menu-first-item.png`: 「Configure tabs」 first in 「…」 on
the installed object
- `02-admin-1440-installed-edit-state.png`: the edit state with source
marks
- `03-admin-1440-installed-moved-hidden.png`: Visits moved first,
multi-lookup tab in 「Hidden」
- `04-admin-1440-installed-after-reload.png`: after save and reload
- `05-member-1440-installed-menu-no-entry.png`,
`05-member-1280-installed-menu-no-entry.png`: the member's 「…」 and tabs
- `06-admin-1280-menu-first-item.png`: the entry first at 1280
- `07-admin-1280-installed-reopened.png`: reopened on the saved
arrangement
- `08-admin-1280-installed-moved-restored.png`: 动态 moved, hidden tab
shown again
- `09-admin-1280-installed-after-reload.png`: after the second save and
reload
- `10-admin-1280-selfbuilt-edit.png`,
`11-admin-1280-selfbuilt-after-reload.png`: the self-built path
Files to read first, by risk:
1. `ui/packages/app-shell/src/views/objectExtensionArrangementSave.ts`:
which keys are kept and which are replaced, the pinned draft, publish,
and the discard on a refused publish.
2. `ui/packages/app-shell/src/views/recordTabsInstalled.ts`,
`installedTabsEntries`: what the pair's list holds (built-ins bare,
hidden related tabs, kept unknown entries, stored labels).
3. `ui/packages/components/src/renderers/layout/containers.tsx`:
`leadsMenu`, in the record bar and in the state-group menu.
Two-minute check: in `examples/app-showcase`, run `objectstack dev --ui
--seed-admin`. As admin, open any Account record and open 「…」. The first
item is 「Configure tabs」. Hide a tab, drag another, and save. `GET
/api/v1/meta/object_extension/showcase_account?package=com.example.showcase.custom`
answers the new `relatedLists`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ADHkmP8GZoB2rUETxwNEDv)_
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmP8GZoB2rUETxwNEDv -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 17f3db8 commit d7411fa
25 files changed
Lines changed: 1418 additions & 77 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- __tests__
- components/src
- __tests__
- renderers/layout
- i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5331 | 5331 | | |
5332 | 5332 | | |
5333 | 5333 | | |
5334 | | - | |
5335 | | - | |
5336 | | - | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
5337 | 5338 | | |
5338 | 5339 | | |
5339 | 5340 | | |
| 5341 | + | |
5340 | 5342 | | |
5341 | 5343 | | |
5342 | 5344 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
0 commit comments