Repository navigation
Commit 97f8f6f
feat(app-shell): the Studio item header says where a read-only base’s customization is saved (#29843)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbUbQXNJDPax1UE5upP9BnZj)_
Fixes #29691
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio 条目标题栏在标题行下方、标签页上方多一行小字「保存到 基座名 的定制」,与待发布变更面板(PR
1,#29723)同一句话、同一个文案键。出现在
Interfaces(定制包新增、已覆盖或已点「定制」解锁的条目)、Data(定制包新增的对象,或已有定制扩展的基座对象)、Automations(定制包新增、已覆盖或已解锁的流程)。Access
不变,它的标签已写明基座。
- 为什么改:定制只读软件包时,标题栏只说「定制」,不说改动存到哪里;面板说了,标题栏没说(ADR-0146 D3)。
- 风险与回滚:仅 UI,无新文案键;这一行在标题行之外,#29693 的折叠只量标题行,不受影响(有消融测试)。回滚即还原本
PR,无数据或协议变化。
- 先看:`StudioItemHeader.tsx` 的 `note` 槽位(标题行之后);新文件
`preview/savedToCustomization.tsx`(这句话与
`SavedToCustomizationNote`,`DraftChangesPanel`
改为转出);`StudioDesignSurface.tsx` 三处 `note=` 的显示条件。
- 两分钟验证:在 showcase 打开任一视图,点「定制」,标题下出现「Saved to ObjectStack Showcase’s
customizations」;改一处再点 Publish,面板标题下是同一句话。可写软件包的条目没有这一行。
- 需要你做的:无,席位落地。
## What changes
- **Item header note (ADR-0146 D3).** `StudioItemHeader` takes an
optional `note`. It is one line under the title row and above the tabs,
outside the title row, so the objectstack#29693 fold (which measures
only that row) never counts it.
- **One sentence, in its own module.** `savedToCustomizationText` (from
PR 1, #29723) moves to `preview/savedToCustomization.tsx`, next to a new
`SavedToCustomizationNote` element. `DraftChangesPanel` imports it and
re-exports it, so its public export is unchanged. The header and the
pending-changes sheet say the same words from the same key
(`preview.changes.savedToCustomization`), and no key is added. The move
is needed because many Studio tests replace the whole
`DraftChangesPanel` module with a stub. When the header imported the
note from that module, 7 tests in `oneSurface-28572` and
`kernelReadOnly-29567` crashed with "No SavedToCustomizationNote export
is defined on the mock". The header now does not depend on what such a
stub exports.
- **Where it shows** (`StudioDesignSurface.tsx`), only on a read-only
base with a customization:
- **Interfaces:** an item the pair adds, an item the pair overrides, or
one unlocked by Customize.
- **Data:** an object the pair adds, or a base object the pair's
extension already extends (published, drafted or edited).
- **Automations:** a flow the pair adds, a flow the pair overrides, or
one unlocked by Customize.
- The label is the base's (`customization.baseLabel`). On Data,
`packageId` names the pair for a pair's own object, so it is not used.
- **Not changed:** Access, whose chip already names the base; the
publish toast; `DraftChangesPanel.test.tsx`.
## Contract review
- **What widens:** `@object-ui/app-shell` gains an optional
`StudioItemHeader` prop (`note`) and a source module
`preview/savedToCustomization.tsx` exporting `SavedToCustomizationNote`
and `savedToCustomizationText`. `DraftChangesPanel` still exports
`savedToCustomizationText`.
- **What narrows:** nothing. No key, prop, export or accepted value is
removed or tightened. Metadata authors see no change
(`Metadata-protocol: none`).
## Tests
- `StudioItemHeader.titleRowFold-12897.test.tsx`: a new describe over
the stubbed-geometry harness. The note is the title row's next sibling
and is not inside it, with the tab row after it. A 400 px note, wider
than the room the row leaves, folds nothing at 632 px. The row still
folds at 330 px and unfolds at 480 px with the note there. CONTROL: no
note, no line.
- `StudioDesignSurface.customizePublish-28562.test.tsx` (the real
surface): after Customize, the Interfaces header says "Saved to HotCRM’s
customizations" outside the title row, and still does after the first
edit makes the pair. The header line and the sheet line read the same.
CONTROL: before Customize, no line.
- `DataPillar.baseObjectExtension-28575.test.tsx` (the real pillar): the
first Add field makes the extension and the object header says it; a
base object the published extension extends says it on open. CONTROLS: a
base object with no extension, and a writable package's object, say
nothing.
- `AutomationsPillar.customizeFlow-28570.test.tsx` (the real pillar):
Customize unlocks the flow and the header says it; a published override
says it on open. CONTROLS: the base's flow before Customize, and a
writable package's flow, say nothing.
- On the same-text check: this harness stubs the sheet
(`DraftChangesPanel`). The stub now draws its line with the real
`savedToCustomizationText`, using the label the host hands it. The pin
compares the real header element with the sentence the real sheet draws
from that label. `DraftChangesPanel.test.tsx` from PR 1 pins the real
sheet's own line.
## Verification
<details><summary>Tests and gates (code head a3d4ffd; head e2d07e0
only rewords the changeset, and its changeset gates exit 0)</summary>
- **Red on main, green here.** I ran the four touched test files against
`origin/main` `339f63da`'s `StudioItemHeader.tsx`,
`DraftChangesPanel.tsx` and `StudioDesignSurface.tsx`, keeping the new
helper module the test imports, and restored `HEAD` after. Result: 6
failed, 52 passed. The 6 are the new surface and header pins, and every
CONTROL stays green on main. On the branch: 58 passed.
- **Ablation.** Moving the note inside the title row (the row's last
child) reds 3 of the 4 note cases in the fold describe: the own-line
case, "a note wider than the free room folds nothing" and the
follow-the-row case. CONTROL stays green. Restored after.
- **Sweep:** every ui test file naming `StudioItemHeader`,
`DraftChangesPanel`, `StudioDesignSurface`, `DataPillar`,
`AutomationsPillar`, `InterfacesPillar` or `savedToCustomization` (284
files, in six locked batches, five of them with `src/preview/` whole
alongside), all green on `a3d4ffd1`: 358 + 701 + 528 + 509 + 655 + 800
tests. An earlier sweep on `6e6a5f34` was what caught the 7 crashes the
module move fixes.
- **Type check:** `turbo run type-check --filter=@object-ui/app-shell`:
65 of 65 tasks green.
- **eslint** on the touched source and test files: 0 errors. The one new
warning is react-refresh's only-export-components on
`savedToCustomizationText` in the new module, the same warning that
export carried in `DraftChangesPanel`.
- **Derived gates** (`node scripts/pm/dispatch-gates.mjs --commands
--repo objectstack-ai/objectstack`): 35 commands, each exit 0 on
`a3d4ffd1`, including `check-sdui-manifest`, `check-changeset-no-major`,
`check-adr-0087-registration`, `check-closing-keyword-parity` (run
against this body) and `pnpm --dir ui exec vitest run scripts/`.
- **Not run locally:** the full Test UI shards, which CI's Test UI runs,
and a live browser pass.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTWKHRdA5msPPhwmw4)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent bbb98c4 commit 97f8f6f
9 files changed
Lines changed: 288 additions & 14 deletions
File tree
- .changeset
- ui/packages/app-shell/src
- preview
- views/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 | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
1384 | 1385 | | |
1385 | 1386 | | |
1386 | 1387 | | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
1390 | | - | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
1391 | 1391 | | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
| 1392 | + | |
1398 | 1393 | | |
1399 | 1394 | | |
1400 | 1395 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
467 | 471 | | |
468 | 472 | | |
469 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
| |||
90 | 103 | | |
91 | 104 | | |
92 | 105 | | |
| 106 | + | |
93 | 107 | | |
94 | 108 | | |
95 | 109 | | |
| |||
337 | 351 | | |
338 | 352 | | |
339 | 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
444 | 445 | | |
445 | 446 | | |
446 | 447 | | |
| |||
6300 | 6301 | | |
6301 | 6302 | | |
6302 | 6303 | | |
| 6304 | + | |
| 6305 | + | |
| 6306 | + | |
| 6307 | + | |
| 6308 | + | |
6303 | 6309 | | |
6304 | 6310 | | |
6305 | 6311 | | |
6306 | 6312 | | |
6307 | 6313 | | |
6308 | 6314 | | |
| 6315 | + | |
6309 | 6316 | | |
6310 | 6317 | | |
6311 | 6318 | | |
| |||
8953 | 8960 | | |
8954 | 8961 | | |
8955 | 8962 | | |
| 8963 | + | |
| 8964 | + | |
| 8965 | + | |
| 8966 | + | |
| 8967 | + | |
| 8968 | + | |
| 8969 | + | |
| 8970 | + | |
| 8971 | + | |
| 8972 | + | |
| 8973 | + | |
| 8974 | + | |
| 8975 | + | |
8956 | 8976 | | |
8957 | 8977 | | |
8958 | 8978 | | |
| |||
11260 | 11280 | | |
11261 | 11281 | | |
11262 | 11282 | | |
| 11283 | + | |
| 11284 | + | |
| 11285 | + | |
| 11286 | + | |
| 11287 | + | |
| 11288 | + | |
| 11289 | + | |
11263 | 11290 | | |
11264 | 11291 | | |
11265 | 11292 | | |
| |||
0 commit comments