Repository navigation
Commit b6caa14
fix(app-shell): Studio's publish review sheet says a customization lives in this environment's database and moves only by
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgJoNqzsoiqe3Hb6Lgi2XQ2n)_
domain:ui#3 · os-bill · session_01Utp6CbPN5UYMnBaNJPJWfG
## 维护者速读
- 改了什么:Studio 发布前的「待发布的变更」面板,在「保存到 X 的定制」下面加一行:这些变更保存在当前环境的数据库里,是
`BASE.custom` 的条目(写的是服务端给的真实包 id),不在项目源码中;只有通过 `os package export`
才能带到其他环境(十种语言,命令原样不翻译)。
- 为什么改:开发者在 `os dev` 的 Studio 里调好视图,`os build` 部署后改动不见了,Studio
从没说过它只在这个库里(ADR-0146 D2)。CLI 和脚手架那一半已由 PR #30336 落地,这是 Studio 这一半。
- 风险与回滚:只在面板审阅只读包的定制(host 传了 customizationOf)时多一行文字,其他面板和可写包一字不变;回滚即撤本
PR。
- 先看:ui/packages/app-shell/src/preview/savedToCustomization.tsx 的
customizationEnvironmentText;ui/packages/app-shell/src/preview/DraftChangesPanel.tsx
的 draft-changes-environment 那一行;ui/packages/i18n/src/locales/zh.ts 的
customizationEnvironment。
- 两分钟验证:examples/app-showcase 跑 `objectstack dev --seed-admin --fresh`,在
Studio 定制一个 Showcase 视图后点「变更」,面板标题下应看到「保存到 ObjectStack Showcase
的定制」和新的一行,点名 com.example.showcase.custom 与 os package export。
- 需要你做的:无,席位落地。
Fixes #30119
Clause-②: yes (widening)
Metadata-protocol: none
## What changes
The card's first Expected bullet: "Studio says plainly, where a
customization is saved, that it lives in this environment's database and
how it moves." Triage 6652867871 states the done line: a Studio notice
that a customization lives in this environment as an item of
`BASE.custom` and travels only by `os package export`. The server half
(CLI `os build` notice, scaffold README and AGENTS.md) landed in PR
#30336.
- **Where.** The one sentence that already names where a customization
is saved, "Saved to BASE's customizations"
(`preview/savedToCustomization.tsx`, ADR-0146 D3), is drawn in two
places: the pending-changes sheet (`DraftChangesPanel`) and the Studio
item header's note line. The new line sits under it in the **sheet**,
once per surface, not on a save toast. The sheet is where a person
reviews the pair's drafts before they go live, and every pillar opens
the same sheet.
- **The real package id.** The host passes `customizationOf` only while
it reviews a pair's drafts, and then its `packageId` is the pair: the
ensure door's answer or the listed pair the server serves
(`StudioDesignSurface`'s `draftScope`). The sheet names that id. It
computes no `.custom` spelling.
- **The command.** `os package export` is the constant
`PACKAGE_EXPORT_COMMAND`, passed into every pack as `{{command}}`, so no
translation can change it.
- **`@object-ui/i18n`:** `preview.changes.customizationEnvironment` in
all ten packs (`{{pair}}`, `{{command}}`).
- **Not switched by environment.** The console can tell:
`/api/v1/discovery` serves `environment` (`production` / `sandbox` /
`development`, from `NODE_ENV`; measured `"development"` under
`objectstack dev`). The line is shown everywhere anyway, because it is
true everywhere: a customization made in production also lives only in
that environment's database and reaches staging or a new environment
only by export. Gating it on `development` would hide a true statement
where it still applies.
## Tests
Head `8fc8d012` (after one merge of `origin/main`, which brought PR
#30361's change to the same file in cleanly).
- `DraftChangesPanel.test.tsx`, in the existing "names the base whose
customizations it saves" describe, through the real i18next hook and
shipped packs: the line names `this environment's database`,
`com.hotcrm.custom` and `os package export` in en, keeps the pair id and
the command untranslated in zh, and the control (a writable package's
own drafts) draws neither sentence. A new `it.each` over all ten packs:
`customizationEnvironmentText` names the pair once and
`PACKAGE_EXPORT_COMMAND` once, with no `{{` left.
- Ablation, one leg: the render condition mutated to `false && …`
through `scripts/ablation-replace.mjs` (anchor 1 → 0, blob changed):
exactly the two new render tests fail, 26 pass; restored, blob identical
to `HEAD`.
<details><summary>Local runs</summary>
- `vitest run` (from `ui/`, under the verify lock):
`DraftChangesPanel.test.tsx`,
`StudioDesignSurface.customizePublish-28562.test.tsx` (the importer that
pins the shared sentence) and the whole `packages/i18n/` (key parity
included): Test Files 97 passed (97), Tests 1479 passed, 13 skipped.
VERDICT command-exit 0.
- `turbo run type-check --filter=@object-ui/app-shell
--filter=@object-ui/i18n --concurrency=2`: 69 tasks successful, VERDICT
command-exit 0 (on the merged head).
- `pnpm check:type-check-debt`: exit 0.
</details>
## Acceptance notes
- The Studio item header's note line also says "Saved to BASE's
customizations" (four call sites, all in `StudioDesignSurface.tsx`,
which PR #30381 holds). It passes only the base's label, so naming the
pair there needs that file. Left out; the seat files it as a follow-up
after #30381.
- Surface widened by the seat (thread ruling 10:22Z):
`preview/DraftChangesPanel.tsx`, `preview/savedToCustomization.tsx` and
their test, outside the Claim's `studio-design/**`.
## Verification
Live walk: `examples/app-showcase`, `objectstack dev --seed-admin
--fresh -p 4730`, console on Vite against it, signed in as the seeded
admin. `POST /api/v1/packages/com.example.showcase/ensure-customization`
answered 201 with `packageId: com.example.showcase.custom`; a draft of
view `showcase_task.in_progress` was saved into the pair with
`overrides: { package: com.example.showcase, basedOn: 0.1.0 }`; then
`/studio/com.example.showcase/interfaces?changes=review`.
| Locale | Before (sources at `d3f23d20`) | After (this branch) |
|:--|:--|:--|
| zh-CN | 保存到 ObjectStack Showcase 的定制 (nothing else) | 保存到 ObjectStack
Showcase 的定制 · 这些变更保存在当前环境的数据库里,是 com.example.showcase.custom
的条目,不在项目源码中;只有通过 os package export 才能带到其他环境。 |
| en | Saved to ObjectStack Showcase’s customizations (nothing else) |
Saved to ObjectStack Showcase’s customizations · These changes are kept
in this environment’s database as items of com.example.showcase.custom,
not in your project’s source. They reach another environment only
through os package export. |
The before leg is the same boot and the same draft, with the two
`preview/` files checked out at `d3f23d20` (Vite reloaded them; restored
afterwards, `git diff HEAD` empty). Screenshots (`before-zh-CN.png`,
`before-en.png`, `after-zh-CN.png`, `after-en.png`) are in the project
files under `ui-seat3/30119/`.
<details><summary>Gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` on `8fc8d012`: 35 families, each run with
its exit code captured before any pipe, all exit 0 (`node
scripts/check-sdui-manifest.mjs` among them; `pnpm
check:type-check-debt` under the verify lock). `--ran`: 35 derived, 35
run, 0 NOT-MEASURED, 0 UNRUN. `pnpm --dir ui check:new-line-citations`:
0 new citations.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6Cay8ZjjPDJ1vkTcVDd)_
---------
Co-authored-by: Claude <noreply@anthropic.com>os package export (#30435)1 parent 2b35374 commit b6caa14
14 files changed
Lines changed: 94 additions & 2 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/preview
- __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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
1409 | | - | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
1410 | 1412 | | |
1411 | 1413 | | |
1412 | 1414 | | |
| |||
1702 | 1704 | | |
1703 | 1705 | | |
1704 | 1706 | | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
1705 | 1715 | | |
1706 | 1716 | | |
1707 | 1717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
296 | 332 | | |
297 | 333 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
26 | 49 | | |
27 | 50 | | |
28 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4951 | 4951 | | |
4952 | 4952 | | |
4953 | 4953 | | |
| 4954 | + | |
4954 | 4955 | | |
4955 | 4956 | | |
4956 | 4957 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4546 | 4546 | | |
4547 | 4547 | | |
4548 | 4548 | | |
| 4549 | + | |
4549 | 4550 | | |
4550 | 4551 | | |
4551 | 4552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4009 | 4009 | | |
4010 | 4010 | | |
4011 | 4011 | | |
| 4012 | + | |
| 4013 | + | |
| 4014 | + | |
4012 | 4015 | | |
4013 | 4016 | | |
4014 | 4017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4648 | 4648 | | |
4649 | 4649 | | |
4650 | 4650 | | |
| 4651 | + | |
4651 | 4652 | | |
4652 | 4653 | | |
4653 | 4654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4644 | 4644 | | |
4645 | 4645 | | |
4646 | 4646 | | |
| 4647 | + | |
4647 | 4648 | | |
4648 | 4649 | | |
4649 | 4650 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4548 | 4548 | | |
4549 | 4549 | | |
4550 | 4550 | | |
| 4551 | + | |
4551 | 4552 | | |
4552 | 4553 | | |
4553 | 4554 | | |
| |||
0 commit comments