Repository navigation
Commit 4ef1ea9
feat(console): the sidebar object entry offers Object settings, and the folded list menu leads with it (#36612)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9GPJ8pmbK219Pay95x25Uno)_
Fixes #36487
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 系统管理员打开任一对象的列表页(自建应用和安装来的应用都算),点右上角「⋮」,第一项是新加的「对象设置」,点了打开 Studio
里这个对象(能看到字段);左侧菜单对象项「…」里原来的「设计」改成「对象设置」,仪表盘、页面菜单项不再有「设计」。
- 属于「运行界面的设计模式」专题:给列表页一个进入对象设置的入口,替代页头将要去掉的「编辑应用」「在 Studio 中查看」两个按钮。
- 只有系统管理员会看到变化,普通成员不受影响;出错最坏是入口不出现或打开到 Studio 的数据页,可整体撤回。
- 无。
## What changes
1. **The list's ⋮ More leads with Object settings.**
`ObjectViewMoreMenu` (`objectViewPageHeader.tsx`) takes the gated path
from `ObjectViewPageBarActions` and draws `ObjectSettingsMenuItem`
first, above the object's description, Import and the favorites entry,
with a separator after it. It opens `appStudioObjectPath`: the object in
Studio's Data surface, where its fields are. No separate Manage fields
entry. The two existing entries are unchanged.
- The narrow header's folded ⋯ (`objectViewHeaderChrome.tsx`) leads with
the same entry (`object_view_object_settings`).
2. **Admins only, built and installed apps alike.** One gate for every
menu that draws the entry: `useObjectSettingsGate(path)` is the app
bar's `useStudioEntryGate` in either posture. A writable package (an app
built here) gives `edit` and a read-only one (an installed app) gives
`view`. A kernel package's app and a member get nothing. No new admin
check.
3. **The sidebar ⋯ menu.** An `object` entry (and an `object:` favorite)
offers **Object settings** where it offered Design, with the same
destination as item 1. A `dashboard`, `page` or `report` entry, and such
a favorite, offers no Studio entry. `sidebarItemDesignPath` /
`favoriteDesignPath` keep their names (their caller `UnifiedSidebar.tsx`
is outside this card's surface) and now answer for objects only. The
sidebar entry now shows on read-only (installed) packages too, through
the one shared gate (accepted in the claim amendment).
4. **Unsaved edits.** Every entry navigates through
`confirmUnsavedLeave`, the existing seam (item 4, kept literal per the
claim amendment).
`console.nav.design` is replaced by `console.nav.objectSettings` in all
11 locale packs (no existing key to reuse; the Chinese text is the
card's own 对象设置). Changeset: `.changeset/36487-object-settings-entry.md`
(`@object-ui/app-shell`, `@object-ui/i18n`, patch).
### Read first
1. `ui/packages/app-shell/src/layout/SidebarItemMenu.tsx`:
`useObjectSettingsGate` (the posture choice: read-only packages get the
entry) and `sidebarItemDesignPath` (dashboard and page dropped).
2. `ui/packages/app-shell/src/views/objectViewPageHeader.tsx`:
`ObjectViewPageBarActions` reads the route and the gate;
`ObjectViewMoreMenu` draws the entry first.
3. `ui/packages/app-shell/src/views/objectViewHeaderChrome.tsx`: the
hook now reads the route and the gate itself.
### Two-minute check
As a workspace admin, open HotCRM's Accounts list and click ⋮ at the
right end of the view bar. The first entry reads Object settings, and it
opens `/studio/PACKAGE/data?surface=object:account`. As a member, the
same ⋮ shows the description and Add to favorites only.
## Acceptance (card) against this PR
| Card line | Status |
|---|---|
| Built app list ⋮: first item Object settings, opens the object in
Studio | Done, pinned (writable package) |
| HotCRM list ⋮: same | Done, pinned (read-only package) |
| Member: no Object settings in ⋮ | Done, pinned (member, admin without
authoring, kernel app) |
| Sidebar object entry ⋯: Object settings, no Design, same destination |
Done, pinned |
| Sidebar dashboard entry ⋯: no Design | Done, pinned (navigation entry
and favorite) |
| Sorted, unsaved list, then Object settings: unsaved prompt | Dropped
by the area as a false premise (claim amendment); the entry goes through
the existing seam, pinned with a registered edit |
| Before/after screenshots | NOT MEASURED, reason below |
## Tests
Forced edits to existing tests (each because Design became Object
settings, or because its rule changed):
- `SidebarItemMenu-12427.test.tsx`: labels; `sidebarItemDesignPath` now
null for page, dashboard and report entries.
- `SidebarItemMenu.designAsksUnsaved-13231.test.tsx`: label only.
- `SidebarItemMenu.designFollowsPackagePosture-12615.test.tsx`: a
read-only (installed) package's entry and favorite now list Object
settings; a kernel favorite and a member get none (new cases).
- `SidebarItemMenu.designOpensStudio-12520.test.tsx`: dashboard and page
entries and favorites now answer null.
- `UnifiedSidebar.favoritesMenu-12427.test.tsx`: labels, plus a
dashboard favorite's menu offers no Studio entry.
New:
- `views/objectViewPageHeader.objectSettings-36487.test.tsx`: the list ⋮
shows Object settings first, above the description, for an admin on a
writable package and on a read-only one. A member, an admin without
authoring and a kernel app get none. With an unsaved edit registered,
the click asks and Cancel stays; OK opens the object in Studio. A
control case with nothing registered opens Studio without asking.
-
`views/__tests__/objectViewHeaderChrome.objectSettings-36487.test.tsx`:
the folded menu, same four questions.
<details><summary>Readings (head b3af5fd)</summary>
- Lock depth before each locked run: depth 1, hold at 2, go.
- At caeacab: touched suites, both new pins, the seven ObjectView
header suites and all of `packages/i18n/`: 121 files, 2121 passed, 13
skipped; lock VERDICT command-exit 0.
- b3af5fd changes one test file only (the folded-menu pin read the
router address through a module variable, which `Lint UI` refused); both
new pins re-run there: 2 files, 11 passed, VERDICT command-exit 0. `pnpm
run lint` in `ui/packages/app-shell`: exit 0, 0 errors.
- Type check: `turbo run type-check --filter=@object-ui/app-shell`,
69/69 tasks successful (`tsc --noEmit` and `tsconfig.test.json`).
- Ablation (list ⋮ item): `scripts/ablation-replace.mjs` turned
`{objectSettingsPath && (` into a constant-false guard (anchor 1 to 0,
blob b3d6a42 to 3d8f5609); the new pin went 4 failed / 3 passed (the
member, no-authoring and kernel cases stay green, as they should);
restored, blob equal to HEAD b3d6a42, `git diff HEAD` empty.
- Ablation (gate, earlier head 4958e70): `useObjectSettingsGate`
mutated to the edit-only posture; 3 cases red; restored, blob equal to
HEAD.
- ui gates: `check:i18n-keys`, `check:spec-symbols`,
`check:icon-record-names`, `check:new-line-citations` all exit 0.
- Derived gates (`dispatch-gates --commands`, 41 commands): all 41 exit
0 on head b3af5fd; `--ran` reconciliation: 41 derived, 41 run, 0
NOT-MEASURED, 0 UNRUN.
</details>
## Acceptance notes
- The sorted-unsaved-list line: the list's unsaved sort lives in the
list draft store. That store never registers with the unsaved-edits seam
and is built to survive in-app departures. One-off reading: after
`patchListDraft(scope, sort desc)`, `confirmUnsavedLeave` asked 0 times
and ran the departure once. The area kept item 4 literal and dropped
that line (claim amendment).
- Phone: the phone's top-row ⋮ is built in `ObjectView.tsx`, outside
this card; not offered there (noted by the area for a later card).
- `UnifiedSidebar.tsx` still says "Design" in a comment and passes
`designPath`; outside this card's surface, left as is.
- Screenshots NOT MEASURED: no Console was booted in this container for
this card. The dispatch allowed the lightest dogfood path only when the
lock and a console fit in reasonable time, and every acceptance line
above is pinned by a unit test instead.
Session: https://claude.ai/code/session_01ADHkmRGDrq6JSytBsNFabU
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRGDrq6JSytBsNFabU -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 70f6790 commit 4ef1ea9
22 files changed
Lines changed: 651 additions & 196 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- layout
- __tests__
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
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 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
80 | 63 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
84 | 67 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 68 | + | |
| 69 | + | |
93 | 70 | | |
94 | 71 | | |
95 | 72 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
101 | 78 | | |
102 | 79 | | |
103 | 80 | | |
104 | 81 | | |
105 | 82 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 83 | + | |
115 | 84 | | |
116 | 85 | | |
117 | 86 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
125 | 94 | | |
126 | 95 | | |
127 | 96 | | |
128 | 97 | | |
129 | 98 | | |
130 | | - | |
| 99 | + | |
131 | 100 | | |
132 | 101 | | |
133 | 102 | | |
134 | 103 | | |
135 | | - | |
| 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 | + | |
136 | 159 | | |
137 | 160 | | |
138 | 161 | | |
| |||
262 | 285 | | |
263 | 286 | | |
264 | 287 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
270 | 294 | | |
271 | 295 | | |
272 | 296 | | |
| |||
291 | 315 | | |
292 | 316 | | |
293 | 317 | | |
294 | | - | |
295 | 318 | | |
296 | | - | |
| 319 | + | |
297 | 320 | | |
298 | 321 | | |
299 | 322 | | |
| |||
360 | 383 | | |
361 | 384 | | |
362 | 385 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 386 | + | |
372 | 387 | | |
373 | 388 | | |
374 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
126 | | - | |
127 | | - | |
| 127 | + | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| |||
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
225 | | - | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
258 | 261 | | |
259 | 262 | | |
260 | | - | |
| 263 | + | |
261 | 264 | | |
262 | 265 | | |
263 | 266 | | |
| |||
0 commit comments