Repository navigation
Commit d763ee7
fix(console): record tabs join the design mode; list draft actions read Reset / Update view (#37085)
repo:objectstack#4 · os-justin · session_01QSeKYnagJvGbCtNg2PhvgW
Fixes #36737
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
管理员在记录页进入「设计布局」后,页签行直接变成可拖动、隐藏、改名的编辑器,页面顶部只有一条紫色横条;「⋯」里不再有「配置页签」。列表改了排序等之后,右侧按钮读「重置
/ 更新视图」;当前视图不能被更新时(如安装包自带的视图),按钮读「另存为我的视图」,手机上读「保存」。
- 属于「设计模式」史诗:按维护者「照 Twenty 归类」的裁决,消除记录页两条保存横条叠在一起的问题。
- 页签草稿和菜单、页头按钮一起由设计模式的「保存」写入、「取消」丢弃;保存失败时设计模式会提示并保留草稿,不会写坏数据,合并后可整体回滚。
- 无
## What changes
- **Record tabs join the design mode.** `useRecordTabsConfig`
(`ui/packages/app-shell/src/views/RecordTabsConfig.tsx`) no longer has
an entry or a bar of its own. While the design mode is on, on a record
page where the old gates hold, the tab row is `RecordTabsEditor` in
place. The gates are: workspace admin who may author metadata, desktop
full page, not a drawer or pane, not an authored page, the
customization-door wall on an installed object, and not while the
record's own edit state is open (the gate the old ⋯ entry kept). The
draft is staged with `useDesignModeChange` under `record-tabs:OBJECT`
(one staged change per object, beside `object-pins:OBJECT` and the app
menu), so it survives a move to another page of the app. Its `commit` is
the existing `saveRecordTabs` (own package `relatedLists`, or the base's
paired `.custom` object extension through
`saveObjectExtensionArrangement`), so both save paths are unchanged and
are now called by the mode's 「保存」. The mode's 「取消」 drops it. An edit
back to where the editor opened unstages it. A failed save keeps the
draft staged and the mode on, and says why through the mode's own
message. The editor's controls stay off until its lazily loaded metadata
client has arrived, and while the mode saves.
- **Removed:** `RecordTabsConfigBar`, `RECORD_TABS_CONFIG_ACTION`
(`sys_configure_tabs`) and its ⋯ item in `RecordDetailView.tsx`, the
bar's top offset for the shared chrome, and the tabs' own unsaved-edits
guard (the mode's guard covers leaving the app). The Studio gates are
now read only while the mode is on, so a record page outside the mode
reads no package list for this.
- **List draft actions renamed, not gated.** `ListDraftActions` reads
「重置 / 更新视图」 (en: Reset / Update view) by changing the values of the
existing keys `console.objectView.draft.discard` and
`console.objectView.draft.save` in all eleven packs (zh-Hant regenerated
by `gen:zh-hant`). No key is added or removed.
- Where the open view cannot take the change (no `onSaveToView`: a view
a read-only package ships, or a reader who may not write it), the button
carries the save its menu holds, 「另存为我的视图」 (`saveAsMyView`), so it never
promises an update it does not offer.
- The narrow face (the phone's chip row) reads 「保存」 (`common.save`) in
that case. At 375 px the longer name squeezed the view switcher beside
it from 76 px to 44 px, down to its count; measured in the browser.
- The menu keeps 「保存到这个视图」 where offered and 「另存为我的视图」.
- `ObjectView` never gated the draft on the design mode, so there is no
refusal to remove. A pin holds that the actions stay live under the
mode's bar.
- Docs: `layout/designMode.tsx`'s module doc names the record tabs among
the staged surfaces and the list's view actions as outside the mode. No
`content/docs/**` or `skills/**` page teaches 「配置页签」 as a separate entry
(searched both for `Configure tabs` and `配置页签`: zero hits).
- The existing ruling at `designMode.tsx` (a dashboard's and a report's
editors stay outside the mode and exclude it, #36692) is untouched. The
#36363 ruling (4) rename gate in the tabs editor is kept.
- `origin/main` is merged in (merge commit, no rebase). The merge
touched no file of this diff's own.
Files to read first, by risk:
1. `ui/packages/app-shell/src/views/RecordTabsConfig.tsx`, the
`useRecordTabsConfig` hook: the staged value carries `packageId`,
`mode`, `catalog`, `initial` and `draft`, so the mode's Save can write
it from any page of the app. The commit closes over the metadata client
captured at the edit.
2. `ui/packages/app-shell/src/views/RecordDetailView.tsx`: the ⋯ item
and the bar are removed, and the editor yields to the record's edit
state. `tabsConfig.active` now means "the mode is on and this object's
tabs may be arranged here".
3. `ui/packages/app-shell/src/views/ListDraftActions.tsx`: the two
labels, `saveLabel` and `compactSaveLabel`.
Two-minute check: in the showcase app as admin, open an account record
and choose 功能展示 ▾ → 设计布局. Expected: one purple bar, a tab row of
draggable chips, and no 「配置页签」 under ⋯. On the task list, sort by 截止日期:
the button reads 「另存为我的视图」 on the shipped view, and 「更新视图」 on your own
view.
## Screenshots
Showcase app, admin, zh-CN, per-agent `--fresh` stack, Console from this
branch's source.
- Account record in the design mode: the tab row is the editor and there
is one bar. The object is installed, so the tabs carry 原始包 tags.

- The record's ⋯ in the design mode: 刷新 / 分享 / 更改负责人 / 删除, with no 配置页签.

- Task list, shipped view, in the design mode after a sort change: 重置 +
另存为我的视图. The menu reads 未保存的改动: 排序 / 另存为我的视图.

- Task list, the reader's own view, in the design mode after a sort
change: 重置 + 更新视图. The menu reads 保存到这个视图 / 另存为我的视图.

- Phone, 375 px, shipped view with a sort draft: the chip row ends with
保存 ▾, and the view switcher keeps 「全…」 with its count. The design mode
is never on a phone.

The images live on the assets-only branch
`claude/issue-36737-screenshots` at commit `3b99443a`. That branch is
never merged and opens no pull request.
## Tests
New pins (#36737), each in the component's existing harness file as a
top-level `describe`, except the record page pins, which have their own
file named for the card:
- `views/__tests__/RecordTabsConfig-36499.test.tsx`: the harness mounts
the real `useDesignModeController` and `DesignModeBar`.
- The tab row is the editor under the one bar, with no tabs bar of its
own.
- The mode's 保存 writes the tabs draft together with another staged
change, once and in the order staged (own package: `save object account`
with `{ mode: 'draft', packageId: 'app.crm', ifNoneMatch: '*' }`, then
`publish`), and leaves the mode.
- 取消 drops the draft and writes nothing. This covers both a tab the
admin hid and a tab hidden by default that the admin showed again;
re-entering opens the object as it was.
- A failed save keeps the editor on the draft and the mode on, and the
mode says why.
- The draft survives leaving the page and coming back.
- The #36499 cases are kept and rewritten for the mode, and leaving the
app asks with the mode's message.
- `views/__tests__/RecordTabsConfigInstalled-36499.test.tsx`: the mode's
保存 writes the installed object's `.custom` extension (`ensure` → `save
object_extension lead` in `app.hotcrm.custom` → `publish`). 取消 sends no
ensure and no write.
- `views/RecordDetailView.designModeTabs-36737.test.tsx`: the real
`RecordDetailView` on a full page.
- In the mode the tab row is the editor with one bar, and ⋯ has no
「Configure tabs」. Out of the mode (the control), the page's own tab row
is drawn and ⋯ has no entry either.
- While the record's edit state is open, the tab row is not the editor.
Leaving the edit state brings the editor back, with the mode on
throughout.
- `views/ListDraftActions.noSave-35955.test.tsx`, through the real
packs:
- zh reads 重置 / 更新视图, and the menu keeps 保存到这个视图 and 另存为我的视图. en reads
Reset / Update view, and the narrow face is one Update view whose menu
holds Reset.
- With no save-to-view, the wide face reads 另存为我的视图 / Save as my view
and the narrow face reads 保存 / Save. With one, both faces read 更新视图 /
Update view.
- `views/ObjectView.footerCalculationDraft-36194.test.tsx`: under an
entered design mode, the list draft's actions are drawn and live. The
mode's 保存 stays off, 「保存到这个视图」 writes `sys_personal_view` on its own,
and the mode stays on.
Ablations, run once and not kept. Each ran on the committed fix through
`scripts/ablation-replace.mjs`, and each restore was proved by blob ==
HEAD with `git diff HEAD` empty:
- The tabs change's `saveRecordTabs(` commit made a no-op: both 保存 pins
went red (`Tests 2 failed | 13 passed`).
- The wide label's save-as branch replaced by `draft.save`: both label
pins went red (`Tests 2 failed | 4 passed`). The first attempt was
refused by the tool as a no-op, because its replacement text was already
in the file. It was re-run with a distinct replacement.
- The narrow label's `common.save` branch replaced by `saveAsMyView`:
both label pins went red (`Tests 2 failed | 4 passed`).
- The record page's `!recordEditState` gate removed: the edit-state pin
went red (`Tests 1 failed | 2 passed`).
All subjects resolve from `src` through relative imports, so no `dist`
leg applies.
<details><summary>Local readings (head af3d3f9)</summary>
- Card test files (5) at the head: `Test Files 5 passed (5)`, `Tests 33
passed (33)`.
- app-shell tests that import the touched modules (RecordTabsConfig*,
recordTabs*, ListDraftActions, designMode*, DesignModeBar,
RecordDetailView, ObjectView harness), after the merge of `origin/main`:
`Test Files 119 passed (119)`, `Tests 1110 passed (1110)`. Run in one
lock hold with the two below, VERDICT command-exit 0.
- `pnpm --filter @object-ui/i18n test`: `Test Files 110 passed (110)`.
- `pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run
type-check`: both scripts echoed and finished.
- `dispatch-gates --commands` (41 families) at the round's head: 40 exit
0. `pnpm --dir ui exec vitest run scripts/` was killed by the shared
box's memory limit (SIGKILL) during the run; re-run alone under the
lock: `Test Files 172 passed | 2 skipped (174)`, `Tests 5130 passed | 2
skipped`, exit 0. `--ran` reconciliation: 41 derived, 41 run, 0 UNRUN.
</details>
## Acceptance notes
- The card's text says the split menu keeps 「保存为我的视图」. The served zh
label is 「另存为我的视图」 (`saveAsMyView`), and it is kept unchanged.
- Three keys now have no call site: `designMode.recordTabs.entry`,
`.leaveUnsaved` and `.saveFailed`. They are left in the pack, because
removing a key from the published `@object-ui/i18n` pack would narrow
it, which is outside this card's `Clause-②: no`.
`designMode.recordTabs.title` stays live as the editor region's
accessible name.
- `leadsMenu: true` in `@object-ui/components`' page header
(`containers.tsx`) now has no producer: the removed ⋯ item was its only
one. This is a zero-pull mechanism, not filed.
- While the mode is on, a record page with editable tabs draws in the
default order, with the reader's own arrangement set aside, as the old
edit state did, so the preview is what Save writes for everyone.
- On the phone, the view switcher still truncates a long view name next
to the draft button (「全…」 beside 保存). Before the narrow-face label it
was squeezed down to the count alone.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW)_
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent f92d271 commit d763ee7
22 files changed
Lines changed: 914 additions & 394 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- layout
- views
- __tests__
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
14 | 23 | | |
15 | 24 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
19 | 28 | | |
20 | 29 | | |
21 | 30 | | |
| |||
95 | 104 | | |
96 | 105 | | |
97 | 106 | | |
98 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
99 | 115 | | |
100 | 116 | | |
101 | 117 | | |
| |||
123 | 139 | | |
124 | 140 | | |
125 | 141 | | |
126 | | - | |
| 142 | + | |
127 | 143 | | |
128 | 144 | | |
129 | 145 | | |
| |||
150 | 166 | | |
151 | 167 | | |
152 | 168 | | |
153 | | - | |
154 | | - | |
| 169 | + | |
| 170 | + | |
155 | 171 | | |
156 | 172 | | |
157 | 173 | | |
| |||
162 | 178 | | |
163 | 179 | | |
164 | 180 | | |
165 | | - | |
| 181 | + | |
166 | 182 | | |
167 | 183 | | |
168 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
| |||
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
144 | | - | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
156 | 158 | | |
157 | 159 | | |
158 | 160 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
| |||
342 | 346 | | |
343 | 347 | | |
344 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
0 commit comments