Skip to content

fix(app-shell): Studio's publish review sheet says a customization lives in this environment's database and moves only by os package export - #30435

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-pc7bmk
Nov 5, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-pc7bmk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

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 feat(cli,create-objectstack): os build says when the dev database holds Studio customizations it leaves behind; the starter docs name os package export #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.
Local runs
  • 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.

Acceptance notes

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/.

Gates

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.


Generated by Claude Code

…ives in this environment's database and moves only by os package export

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Cay8ZjjPDJ1vkTcVDd
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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/脚手架一半已由 feat(cli,create-objectstack): os build says when the dev database holds Studio customizations it leaves behind; the starter docs name os package export #30336 落地,这是界面一半。
  • 风险与回滚:只在 host 传了 customizationOf 且有 packageId 时多一行文字;可写包的面板一字不变。回滚即撤本 PR。
  • 先看:preview/savedToCustomization.tsx 的 customizationEnvironmentText,DraftChangesPanel.tsx 的 draft-changes-environment 一行。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/preview/__tests__/DraftChangesPanel.test.tsx,全绿。
  • 需要你做的:无,席位落地。
  • 席位意见:可合。

席位核对 — ACCEPT · head 8fc8d01

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 5, 2026 11:37
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 5, 2026 11:37
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit b6caa14 Nov 5, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-pc7bmk branch November 5, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A customization made in a developer's Studio is lost at deploy, with no notice and no pointer in the project docs

1 participant