Repository navigation
Commit 97c2982
feat(app-shell): a Studio item header keeps the item name readable; chips, tools and labels give way first (#29765)
domain:ui#4 · zhuangjianguo · session_01QsR2jR7ZFkpqmm4U8S1f9y
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbL3tNMC4Khinp6atoAn1ou3)_
Fixes #29693
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:Studio 条目标题行在窄栏(约 1024 px 窗口、右侧面板打开)不再把条目名挤没。标题至少保留前 12
个字符(名称更短则整名);先让芯片和五个条目工具收进 ⋯ 菜单,再让「自定义」、流程开关、设计/运行按钮只留图标;轨道上的定制标记改为单个图标。
- **为什么改**:实测 main 上 Interfaces 报表、对象切片和流程三个条目标题宽度为 0 px,⋯
按钮落在右侧面板下面点不到;流程轨道选中的定制行只剩「已定制(ObjectStack Showcase)」。
- **风险与回滚**:只动 app-shell 前端展示,无元数据与接口变化;没传 `foldMenu` 的标题行行为不变。回滚即
revert 本 PR。
- **先看**:`StudioItemHeader.tsx`(折叠测量 `useTitleRowFold` 与菜单内容
`StudioItemHeaderFoldedItems`)、`StudioItemTools.tsx`(工具交出菜单形态)、`StudioDesignSurface.tsx`(三个标题行的
`foldMenu`)。
- **两分钟验证**:浏览器窗口 1024 px,打开 Studio
界面支柱里一个已定制且有草稿的报表(右侧属性面板打开):标题显示完整名称,⋯ 可点开,菜单顶部依次是芯片、层次/引用关系/历史/审计日志/源码。
- **需要你做的**:无,席位落地。
## What changes
The item header's title row (`StudioItemHeader`) now keeps the item's
name readable, measured on the header's own row, never the viewport:
- **The readable width** is the width of the title's first twelve
visible characters (a text range over the title, the reader-only kind
suffix excluded), capped at the whole name.
- **Stage 1.** When the room the row leaves the title is below that
width, the identity chips (api-name chip and the pillar's `chips`: kind,
override, pair) and the five item tools leave the row. They read at the
top of the ⋯ menu: the chips as one menu entry whose choice keeps the
menu open, then the tools as menu items with the same test ids as the
buttons, opening the same sheets. `StudioItemTools` hands its menu form
to the header through `useStudioItemHeaderFold`.
- **Stage 2.** If the title is still short, labelled actions show their
icon alone: the Customize button, the flow ledger switch and definition
switch, and the Interfaces Design/Run buttons. The label stays in the
DOM as the accessible name (`STUDIO_FOLD_LABEL`, a `group-data` variant
of `sr-only` keyed on the actions slot's `data-fold` attribute).
Customize keeps the first slot of the actions.
- **Last.** Only then is the title cut, with its whole text in its
tooltip as before (objectui#12897). The ⋯ trigger stays inside the row
in every stage.
- **Giving back.** Each stage records the room it freed and is undone
only once the title would keep its readable width without that room, so
a stage never undoes itself the moment it is taken.
- **Where folded things go** is the pillar's call (`foldMenu`):
`'pillar'` for Interfaces and Automations, whose own ⋯ menus mount
`StudioItemHeaderFoldedItems`; an object for the Data header (and for an
Interfaces or flow item while its own menu is not drawn), where the
header draws a ⋯ of its own while something is folded. A header without
`foldMenu` (Access, the permission matrix) is unchanged.
- **Rail mark.** `RailCustomizationMark` draws `CustomizationMark` with
`compact`: the glyph alone (violet pencil-ruler for customized, emerald
plus for added), the text as its accessible name and the first line of
its tooltip. The All metadata lists keep the text mark.
Files beyond the claim's first surface (`StudioCustomizeControls.tsx`,
`FlowLedgerSwitch.tsx`, `StudioItemTools.tsx`, `FlowItemMoreMenu.tsx`)
are covered by the seat's amendment record 6593712299.
### For the cards that build on this header
- **#29691 (the "saved to" sentence):** it goes on its own line directly
under the title row and above the tab row, as a new optional slot of
`StudioItemHeader` rendered between the title-row div and the `nav` tab
row. Keep it out of the title row: the fold measures the title row's
boxes only, so a line under it costs the title nothing.
- **#29692 (Restore on the override chip, as a popover):** when the row
folds, the override chip is inside the single menu entry
`studio-item-header-folded-chips`, which keeps the menu open when
chosen, so a popover trigger on the chip still works from there. Restore
package original also stays a ⋯ menu item in both the Interfaces and
flow menus.
## Tests
- `StudioItemHeader.titleRowFold-12897.test.tsx` (shared
stubbed-geometry harness), two new describes: stage 1 at 330 px, the
menu's contents and a tool firing its action, following the row both
ways, a 470 px CONTROL that stays folded, a 632 px CONTROL with nothing
folded, and a CONTROL header without `foldMenu`; then the order: stage 1
alone at 560 px, stage 2 at 420 px, the title cut last at 300 px with
the ⋯ still there, unfolding in reverse, icon-only Customize and ledger
switch keeping their labels as accessible names and firing the same
handlers, and the chips as one menu entry.
- `StudioDesignSurface.itemTools-28239.test.tsx`: the real
`StudioItemTools` folded into the header's ⋯; each of Layers,
References, History, Audit and Source opens its sheet from the menu and
reads the same door as its button.
- `StudioDesignSurface.oneSurface-28572.test.tsx`: the Interfaces rail's
customized and added marks are glyph-only with their text as accessible
name and tooltip lead.
<details><summary>Readings</summary>
- New and touched files: `titleRowFold-12897` 17/17, `itemTools-28239`
9/9, `oneSurface-28572` 13/13.
- Ablation (fold hook made to return stage 0, through
`scripts/ablation-replace.mjs`, restored to the HEAD blob):
`titleRowFold-12897` 10 failed, 7 passed; the 7 are the five
objectui#12897 cases and the two no-fold CONTROLs.
- Every app-shell test file naming a touched module (`git grep -l` over
StudioItemHeader, StudioItemTools, CustomizationMark,
StudioRailCustomizations, FlowItemMoreMenu, FlowLedgerSwitch,
StudioCustomizeControls, studio-tokens, StudioDesignSurface): 228 files,
1713 tests, all passed, in five locked batches at head 08039a0. The
later commits are the changeset text, a test prop the type-check asked
for, and the merge of `main`.
- After merging `main` (head eaea6c6, 23 incoming commits, one touching
`StudioDesignSurface.tsx`'s Access banner, no overlap): app-shell
`type-check` (src and tests) exit 0; `check-sdui-manifest` exit 0; the
three pin files plus the two incoming Studio tests that touch
`StudioDesignSurface` (`accessPairCopy-29674`,
`customizePublish-28562`): 5 files, 49 tests passed. Merged `main` again
right before opening (head 205c453, six incoming commits; one changes
`StudioDesignSurface.tsx`'s field-name helpers only): app-shell
`type-check` exit 0, `check-sdui-manifest` exit 0, the three pin files
39/39.
- `pnpm --dir ui exec vitest run scripts/`: 170 files passed, 2 skipped.
- Derived gates (`dispatch-gates --commands`): 35 derived, 35 run, all
exit 0; `--ran` reconciles 0 NOT-MEASURED.
- eslint on the touched files: 0 errors.
- Live E2E (`studio-customize-journey.spec.ts`, seat amendment record
6595035315): at the job's 1280 x 720 window with the Interfaces
inspector open, the header folds its identity chips, so the published
pair's override chip is looked for in the row, else in
`studio-item-header-folded-chips` after opening `if-item-more`, and the
menu is closed again. Run locally against the showcase backend
(`ui/e2e/live/ci/start-backend.sh`, Console built with
`VITE_BASE_PATH=/` and served by `vite preview`): the spec at 205c453
fails at L137 exactly as CI job 125715096807 did (`studio-override-chip`
not found); with the fix (b0949a5) 3 of 3 runs pass (19.3 s, 17.3 s,
17.8 s). Derived gates on b0949a5: 35 derived, 35 run, all exit 0;
`--ran` 0 NOT-MEASURED; eslint on the spec 0.
</details>
## Acceptance notes
- At 1024 px with the right panel open the Data object header did not
need to fold: "Account (Success Overlay)" shows 13 characters beside its
tools, above the 12-character floor, so the tools stay in the row.
- The Access set header has no `foldMenu`: it has no chips or tools to
fold, and its name was whole before and after.
## Verification
Live, on the showcase app (`objectstack dev --seed-admin --fresh`) with
the Console on Vite, Chromium at 1024 x 768, zh-CN, right panel open.
The report and the flow were customized, published, and edited again, so
each header carries its kind chip, override chip, draft status, the five
tools and ⋯. Before = this branch with the nine changed source files
swapped back to `origin/main`; after = this branch.
| Header | Row | Title before | Title after | ⋯ before | ⋯ after |
|---|---|---|---|---|---|
| Interfaces report 工时按状态分布 | 436 px | 0 of 125 px | 125 px, whole | x
875 to 907, under the panel, not hittable | x 668 to 700, hittable |
| Interfaces slice 进行中的任务 | 436 px | 0 of 107 px | 107 px, whole | x 790
to 822, not hittable | x 668 to 700, hittable |
| Automations Project Budget Approval | 436 px | 0 of 207 px | 145 px
("Project Budget…", 14 characters) | x 863 to 895, not hittable | x 668
to 700, hittable |
| Data Account (Success Overlay), field panel open | 436 px | 153 of 233
px | 153 px, unchanged | none | none |
| Access 示例贡献者 | 736 px | 89 px, whole | 89 px, whole | hittable |
hittable |
Before, the three folding rows were wider than the row (scroll widths
643, 558 and 631 px for a 436 px row). After, the ⋯ menus list the
folded chips entry, then Layers, References, History, Audit, Source,
then the pillar's own items. The flow rail's selected customized row
reads "Project Budget …" with the glyph mark. Screenshots and the raw
readings are with the seat.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jUYXmZ6DQBWc6piyyF)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f87239a commit 97c2982
14 files changed
Lines changed: 842 additions & 46 deletions
File tree
- .changeset
- ui
- e2e/live
- packages/app-shell/src/views
- item-tools
- studio-design
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
98 | 121 | | |
99 | 122 | | |
100 | 123 | | |
| |||
134 | 157 | | |
135 | 158 | | |
136 | 159 | | |
137 | | - | |
| 160 | + | |
138 | 161 | | |
139 | 162 | | |
140 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
123 | 128 | | |
124 | 129 | | |
125 | 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 | + | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
181 | 211 | | |
182 | 212 | | |
183 | 213 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
205 | 238 | | |
206 | 239 | | |
207 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
38 | 52 | | |
39 | 53 | | |
40 | 54 | | |
41 | 55 | | |
42 | 56 | | |
43 | 57 | | |
| 58 | + | |
44 | 59 | | |
45 | 60 | | |
46 | 61 | | |
| |||
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
| 67 | + | |
| 68 | + | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
| |||
58 | 75 | | |
59 | 76 | | |
60 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
61 | 94 | | |
62 | 95 | | |
63 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 | | |
246 | 250 | | |
247 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
305 | 307 | | |
306 | 308 | | |
307 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 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