Repository navigation
Commit c6075a7
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9Wq5utqEodnDCBh6heq37AG)_
Refs #36499
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:系统管理员在自建应用的记录详情页「…」里多了「配置页签」,可就地拖动排序、隐藏/恢复、改名后保存,所有人看到新的默认页签顺序;普通成员看不到入口。
- 为什么做:属于「记录页就地配置」专题的第一步(本卡第一个合并请求),替管理员省去进 Studio 改对象定义的绕路。
- 出错会怎样:只影响自建应用对象的记录页页签排列;保存写成对象的已发布定义,管理员可再次进入配置恢复原样,读者自己的拖动顺序不受影响。
- 要你做什么:无。
## What changes
On the desktop full record page of an object whose package is writable,
a workspace administrator who may author metadata gets 「Configure tabs」
in the record's 「…」 menu. It is not offered on a phone, in a drawer or a
pane, or on an authored record page. Choosing it puts the page in an
edit state in place:
- A bar across the top, with 「Configure tabs」 on the left and 「Cancel」
and 「Save」 on the right. It has the design-mode bar's look. The
design-mode shell is reused unchanged: no change to DesignModeBar,
designMode.tsx or unsavedEdits.
- The tab row becomes an editor. The administrator can:
- drag tabs to reorder them (dnd-kit, keyboard too);
- hide a tab into a 「Hidden」 area and show it again from there;
- rename a tab;
- hide the attachments tab.
- Some tabs cannot be moved, hidden or renamed in the editor. They are
shown with a lock:
- 审批 and 动态, which the page always draws last;
- lists another package brings.
- 「Adjust field groups」 opens the object in Studio.
- The record stays on screen as the preview, in the draft's order. The
reader's own arrangement is set aside while the edit state is open.
- 「Cancel」 writes nothing.
- Leaving with a change held asks first, through the existing
unsaved-edits seam.
「Save」 writes the object's `relatedLists` over the object **as stored**
(the layered read with `packageId`), never the served object. It saves a
draft with the first-write pin (`ifNoneMatch: '*'`) into the object's
own package, then publishes it. A refused publish resets that draft, and
a pending Studio draft is refused with its own sentence. This mirrors
the design-mode menu's save. All writes go through one seam,
`resolveRecordTabsSaveTarget`, which returns `{kind: 'package',
packageId}` for a writable package and `null` for anything else. PR 2
adds the installed `.custom` target there.
How the list is written:
- A tab is hidden by leaving it out of the object's own list.
- A rename becomes the entry's `label`.
- The stored entry's `columns` are kept.
- Entries the editor does not arrange (审批 / 动态 names, a list it does not
offer) are kept after the entry they followed.
- If every tab is hidden, the save still writes a declared list
(`['sys_approval_request','sys_activity']`). An empty list would read as
"none declared".
Renaming follows the design-mode menu's rule (ruling (4) of #36363):
only in the deployment's default language, and only where the shown name
is the stored one.
Files:
- `ui/packages/app-shell/src/views/recordTabsConfig.ts`: the pure model
(catalog, draft, edits, the entries a save writes, the preview).
- `recordTabsConfigSave.ts`: the write.
- `RecordTabsConfig.tsx`: the hook, bar and editor.
- `recordTabsConfigIo.tsx`: the metadata client, stored list and default
language. It sits behind `React.lazy` so the record page's module graph
does not gain the metadata client's module.
- `RecordDetailView.tsx`: wiring only.
- `@object-ui/plugin-detail` `RecordPageColumns` takes an optional
`tabRowEditor`, drawn in the tab row's place.
- `designMode.recordTabs` keys in all eleven console locales. zh-Hant is
generated from zh-Hans.
## Tests
New, named for the card:
-
`ui/packages/app-shell/src/views/__tests__/recordTabsConfig-36499.test.ts`
(11): the catalog, the opening draft, edits, the entries a save writes,
the preview, and item 6. Item 6 checks that the admin order is the new
default, that a reader's dragged order stays over it, and that
`EMPTY_RELATED_ARRANGEMENT` (「恢复默认顺序」) gives the admin order.
- `.../recordTabsConfigSave-36499.test.ts` (5): the stored object, not
the served one; the pinned draft then publish; a pending draft refused;
a refused publish resets; a read-only or unlisted package refused before
anything is read; the seam.
- `.../RecordTabsConfig-36499.test.tsx` (8): the offered gate; the edit
state; another package's list fixed; hide → Hidden → restore and Cancel
writes nothing; drag + Save writes once; the leave prompt; rename open
and closed.
-
`ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx`
(2): an entry that finished on the click closes the 「…」 menu; one still
running keeps it open and busy until it settles.
No existing test was changed.
Patch round (CI at a9fc3dd):
- Type Check UI `check:spec-symbols`: the local `ObjectLike` and
`Session` collided with spec exports; renamed `RecordTabsObjectDef` and
`RecordTabsSession`.
- Lint UI `object-ui/no-synthetic-event-trigger` and Test UI 1/16
`adr0054-ratchet`: the Escape the entry dispatched is gone; page:header
closes the menu itself (above).
- Test UI 11/16 `consoleTopBar.height-12639`: the chrome offset under
the tab bar is spelled as the bar's 3rem plus the page's own gap, not
`top-14`.
- Test UI 4/16 `recordTabsConfigSave-36499`: the `unit` project runs
with `isolate: false`, so the test's module mock of the assistant bus
missed a module another file had loaded; the refresh announcement is now
one of the save's doors.
<details><summary>Test runs (final head a9fc3dd unless
noted)</summary>
- Run under `os-verify-lock` on 745f057, before the lazy split:
`vitest run packages/i18n/ plugin-detail RecordPageColumns* app-shell
RecordDetailView.* + the three new files` gave 21 failed files.
- 20 `RecordDetailView.*` suites failed with "Cannot access
'authFetchSpy' before initialization". The new import chain reached
`metadataClientFactory`, which mints its fetch at module load.
- zh-Hant was stale.
- After the fix (a06a827), the same command under the lock: `Test
Files 212 passed (212) · Tests 2898 passed | 13 skipped`, then
`@object-ui/app-shell type-check`, VERDICT command-exit 0.
- Final head, under the lock: the three new files +
`RecordDetailView.recordOpen*`: `Test Files 7 passed (7) · Tests 62
passed (62)`, plus `@object-ui/app-shell type-check`, VERDICT
command-exit 0.
- Dependency closure `pnpm --workspace-concurrency=2 --filter
'@object-ui/app-shell^...' build` after merging origin/main: VERDICT
command-exit 0.
</details>
## Acceptance notes
- **The entry's place in 「…」.** 「Configure tabs」 is the first of the
record's own entries. It comes after 「Refresh」, which the record header
puts first; measured menu: Refresh, Configure tabs, Share, Change Owner,
Delete. A literal first place needs a change in `@object-ui/components`
page:header and `@object-ui/react`, outside this card's file surface.
This is raised as an open question in the report.
- **「Adjust field groups」** opens the object in Studio's Data pillar
(`/studio/PKG/data?surface=object:NAME`), on its Records tab. Studio has
no URL address for the Form tab yet; #36505 adds it.
- **Approvals / activity cannot be hidden** on a self-built object
without a spec change (the spec refuses object-form built-in entries,
and an own list cannot leave them out). They are shown fixed.
Attachments and the object's own related lists hide faithfully by
omission.
- **Undeclared to declared.** Saving an object that had no
`relatedLists` writes one, so a relationship added later is not shown by
default. That is the spec's semantics for a declared list.
- **The 「…」 menu now closes after an entry that finished on the click.**
`page:header` (`@object-ui/components` containers.tsx) prevented the
menu's close on every select, so an in-place change left it open over
the editor (measured). Now an entry still running (it returned a pending
promise) keeps the menu open with its row busy, as before; one that
finished closes it, as Refresh does. Pinned by
`ui/packages/components/src/__tests__/page-header-overflow-close-36499.test.tsx`.
- Only the desktop full page offers the entry. Installed (read-only)
packages are not offered it yet (PR 2).
## Verification
Gates: `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 41 families. Each one ran on the
final head and exited 0, and `--ran` reconciles 41 derived, 41 run, 0
NOT-MEASURED (a derived zero).
Browser: I booted `examples/app-showcase` (`objectstack dev --ui
--seed-admin`, own port and DB) with the console rebuilt from this
branch. Setup:
- A Studio-style writable package `com.qa.tabs` with `qtab_account` and
three lookup children (Contacts, Deals, Tickets), each with one record.
- A plain member (admin create-user, then a read permission set
assigned).
Measured:
- **Menu.** The admin's 「…」 reads Refresh, Configure tabs, Share, Change
Owner, Delete. The member's reads Refresh, Share.
- **Entering the edit state.** Choosing the entry closes the menu and
shows the bar and editor, at 1280 and 1440.
- **Hide and restore.** Hiding Tickets moves it to 「Hidden」, and Show
brings it back.
- **Cancel.** It sends no metadata write (request log empty).
- **Leaving with a change held.** Leaving to Projects prompts "Leave
without saving? Your tab changes will be lost.", and dismissing the
prompt stays on the page.
- **Reorder, rename, save.** Dragging Deals left (keyboard) and renaming
Contacts to People, then Save, sends `PUT
/api/v1/meta/object/qtab_account?mode=draft&package=com.qa.tabs` then
`POST …/publish`. After a reload the order is Deals, People, Tickets,
Attachments, Activity, and the member sees the same order.
- **A reader's own order.**
- The member moved People left; then the admin hid Tickets and saved.
- The member kept their own order: People, Deals, Attachments, Activity.
- 「恢复默认顺序」 gave the admin order: Deals, People, Attachments, Activity.
- **Showing a hidden tab again.** The admin then showed Tickets again
and saved; the order read back as Deals, People, Tickets, Attachments,
Activity.
- **Field groups.** 「Adjust field groups」 lands on
`/_console/studio/com.qa.tabs/data?surface=object%3Aqtab_account`.
**2-minute check:** sign in as an admin on a self-built object's record,
open 「…」 and choose 「Configure tabs」. Expect a purple bar on top and the
tab row turned into draggable chips with a 「Hidden」 line under them.
Screenshots (`/mnt/project-files/objectstack-seat2/shots/36499/`):
- `01-admin-record-menu-entry-1280.png`,
`01-admin-record-menu-entry-1440.png`: the entry in 「…」
- `02-admin-edit-state-1280.png`, `02-admin-edit-state-1440.png`: the
edit state
- `03-admin-hidden-area-1280.png`: Tickets in 「Hidden」
- `04-admin-reordered-renamed-1280.png`: Deals moved first, Contacts
renamed People
- `05-admin-after-save-reload-1280.png`: after save + reload
- `06-admin-field-groups-studio-1280.png`: 「Adjust field groups」 in
Studio
- `08-member-menu-no-entry-1280.png`: the member's 「…」 without the entry
- `09-member-own-order-kept-1280.png`: the member's own order kept over
the new default
- `10-member-restore-default-order-1280.png`: 「Restore default order」
- `11-member-admin-order-1280.png`: the admin order after restoring
Files to read first, by risk:
1. `ui/packages/app-shell/src/views/recordTabsConfig.ts`,
`recordTabsEntries`: what a save writes, including keeping entries the
editor does not arrange.
2. `ui/packages/app-shell/src/views/recordTabsConfigSave.ts`,
`saveRecordTabs`: the stored read, pinned draft, publish, reset.
3. `ui/packages/app-shell/src/views/RecordDetailView.tsx`: the preview
object fed to the derivation and page schema, and the reader arrangement
set aside while editing.
---
_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 42b4060 commit c6075a7
23 files changed
Lines changed: 2160 additions & 14 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views
- __tests__
- components/src
- __tests__
- renderers/layout
- i18n/src/locales
- plugin-detail/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
904 | 905 | | |
905 | 906 | | |
906 | 907 | | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
907 | 911 | | |
908 | 912 | | |
909 | 913 | | |
| |||
2585 | 2589 | | |
2586 | 2590 | | |
2587 | 2591 | | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
2588 | 2612 | | |
2589 | | - | |
| 2613 | + | |
2590 | 2614 | | |
2591 | 2615 | | |
2592 | 2616 | | |
2593 | 2617 | | |
2594 | 2618 | | |
2595 | 2619 | | |
2596 | | - | |
| 2620 | + | |
2597 | 2621 | | |
2598 | 2622 | | |
2599 | 2623 | | |
| |||
5307 | 5331 | | |
5308 | 5332 | | |
5309 | 5333 | | |
| 5334 | + | |
| 5335 | + | |
| 5336 | + | |
| 5337 | + | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
| 5342 | + | |
| 5343 | + | |
| 5344 | + | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
| 5349 | + | |
5310 | 5350 | | |
5311 | 5351 | | |
5312 | 5352 | | |
| |||
5550 | 5590 | | |
5551 | 5591 | | |
5552 | 5592 | | |
5553 | | - | |
| 5593 | + | |
5554 | 5594 | | |
5555 | 5595 | | |
5556 | 5596 | | |
| |||
6004 | 6044 | | |
6005 | 6045 | | |
6006 | 6046 | | |
| 6047 | + | |
6007 | 6048 | | |
6008 | 6049 | | |
6009 | 6050 | | |
| |||
6016 | 6057 | | |
6017 | 6058 | | |
6018 | 6059 | | |
6019 | | - | |
| 6060 | + | |
| 6061 | + | |
| 6062 | + | |
| 6063 | + | |
| 6064 | + | |
| 6065 | + | |
| 6066 | + | |
| 6067 | + | |
| 6068 | + | |
6020 | 6069 | | |
6021 | 6070 | | |
6022 | 6071 | | |
| |||
6327 | 6376 | | |
6328 | 6377 | | |
6329 | 6378 | | |
6330 | | - | |
6331 | | - | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
| 6382 | + | |
| 6383 | + | |
6332 | 6384 | | |
6333 | 6385 | | |
6334 | 6386 | | |
| |||
0 commit comments