Repository navigation
Commit 4bdbdac
feat(console): the Studio landing lists every change this environment made to its installed apps in one panel (#34825)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBSqEJfSXXrgRvGw4hppNUc2)_
Fixes #34714
repo:objectstack#3 · os-support-ai · session_01WGufzivEnnozveqZfr4fDx
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio
首页在「已安装的应用」下面加了「本环境的定制」面板,把所有已安装应用上的改动列在一处:每行写条目名、类型、所属应用和改动方式(改了原有的 /
新增的 / 已停用),点一下打开这个条目;可按页签(全部 / 新增字段 / 表单与视图 / 流程 / 已停用)筛选、搜索、按应用分组,默认显示前
6 行。
- 为什么改:原来想知道「这个环境改了哪些东西」,要一个应用一个应用点进去看。
- 风险与回滚:只改首页,不改服务端接口和存储;卡片和面板共用每个应用的一次读取,面板总数天然等于卡片上「已定制 +
已停用」之和;其他包带来的内容不算定制、不进清单;某个应用读不到时写明「这个应用的定制读不到」,不当成 0。回滚即还原本 PR。
-
先看:`ui/packages/app-shell/src/views/studio-design/landingCustomizations-io.ts`(每行怎么来、标签怎么读);`LandingCustomizationsPanel.tsx`;`BuilderLanding.tsx`
里改成读完整清单的那段 effect。
- 两分钟验证:中文界面在 Studio 里给某个已安装应用的对象加一个字段并发布,回到
`/_console/studio`,「本环境的定制」里应出现一行「新增的 · 字段 · 应用名」,数字与该应用卡片上的「已定制」一致。
- 需要你做的:无,席位落地。
## What changes
The Studio landing gains a **Customizations in this environment** panel,
under the installed apps (the place #34715 left for it).
- **One row per change** this deployment made to an installed app, from
each app's customization read (`GET
/api/v1/packages/:id/customizations`, ADR-0146 D3): a served `overrides`
entry reads **Changed**, an `extensions` member (field, validation rule,
index) reads **Added**, a `switchedOff` entry reads **Switched off**.
`contributions` (what other packages bring to the app) make no row.
Nothing is folded or deduped (`customizationRowsOf`,
`landingCustomizations-io.ts`).
- **One read per app serves the card and the panel.** The landing now
calls `fetchPackageCustomizations` and draws the card's numbers off the
same answer through a new pure `customizationCountsOf` in
`packageCustomizations-io.ts` (which `fetchPackageCustomizationCounts`
now uses too). The served counts are each list's length
(`GetPackageCustomizationsResponseSchema.counts`), so the panel's total
equals the cards' "customized" + "switched off" by construction, with no
second request.
- **Labels.** The served answer carries names, not labels.
`loadCustomizationLabels` reads the app's own published list once per
type that has rows (`client.list(type, { packageId })`), and the app's
objects for an added field's label; a failed list leaves the rows on
their names. No row, no request.
- **Each row opens its item**: `/studio/<app>/metadata/<type>/<name>`,
which the area forwards to the item's pillar for a pillar type (a flow
opens the Automations pillar on it); an added member opens its object.
- **Tabs** All / New fields / Forms and views / Flows / Switched off
(each with its count), a **search** over label, name, kind, app and
mode, and **Group by app**. The first 6 rows show; the rest are behind
"Show all N".
- **With no change anywhere** the panel is one line. **An app whose read
fails** (a 403 included) is named, "<app>: this app's customizations
could not be read.", and never counted as 0; its card shows the existing
failed line.
- 29 new keys under `engine.studio.landing.envCustomizations.*` in the
studio namespace (en, zh). No eager `locales/en.ts` edit. No server
change.
Scope notes (ADR-0146 D6, as the card says): no diff against the app, no
"based on" version, no clone lineage, no per-organization split.
## Tests
<details><summary>New and updated tests (12 landing files, 73 tests
pass)</summary>
- New `BuilderLanding.envCustomizations-34714.test.tsx` (10), real
landing, real panel, real customization reader over a stubbed wire:
- two apps with one change each and one switched-off flow ⇒ 3 rows with
app and mode (`Changed · View · HotCRM`, `Switched off · Flow · HotCRM`,
`Added · Field · Service Desk`); a served contribution makes no row; the
label read's answer replaces the name;
- each row's href (item on the app's area; an added field on its
object), and a click lands on the item route;
- the panel total equals the cards' sum, and exactly one customization
request per app is sent;
- empty state: one line, no total, no toolbar;
- a 403 app: unreadable line naming it, the other app's row still
listed, total 1, the card `data-state="failed"`;
- tabs, search, group by app; the first 6 rows and "Show all 9";
- zh-CN: 本环境的定制, 改了原有的 / 新增的 / 已停用, 新增字段, 表单与视图;
- `customizationRowsOf` excludes contributions;
`loadCustomizationLabels` reads one list per type with rows (zh label
resolved, a field's label from its object, a failed list keeps names, no
row ⇒ no request).
- `taskOrder-34715`, `recentPackages-11863`: the heading order now
includes the panel. `accessibleNames-12510`, `orgScope-11553`,
`setupExit-12513`: their pending customization double now stands in for
`fetchPackageCustomizations`.
</details>
## Acceptance notes
Premise measured on `origin/main` f6f5b50 before coding (claim
6944526029): `fetchPackageCustomizations` at
`packageCustomizations-io.ts:59`, the counts reader at :86, the landing
reading only counts (`BuilderLanding.tsx:161`); the served lists and
`counts.*` = each list's length; the answer carries no label.
`StudioRailCustomizations` holds the rail's marks and filter, not a
cross-app list, so the panel reuses its pair fold (already on the
landing) and not its components.
Live readings, en and zh, console from this branch's source over real
backends. Scripts, readings and screenshots:
`/mnt/project-files/objectstack-seat3/34714-live/` (project share).
1. **Showcase** (`examples/app-showcase`, fresh): before any change the
panel reads "No installed app has been changed in this environment yet."
/ 「本环境还没有改过任何已安装的应用。」. After an added field on `showcase_task`
(ensure-customization 201, object_extension draft 200, pair publish 200)
and `showcase_urgent_task_alert` switched off (toggle 200): 2 rows,
`Region | Added · Field` and `Alert on Urgent Task (created or
escalated) | Switched off · Flow` (labels read from the app's lists);
total 2 = card "1 customized, 1 switched off"; the flow row opens
`/studio/com.example.showcase/automations?surface=flow:showcase_urgent_task_alert`,
the field row
`/studio/com.example.showcase/data?surface=object:showcase_task`.
2. **Two installed apps** (`examples/app-multi-package`, core + orders):
one added field each ⇒ 2 rows (`Tier · Multi-Package Core`, `Channel ·
Multi-Package Orders`), total 2 = cards 1 + 1. The core read also serves
a nav contribution from orders: no row for it.
3. **403**: a response stand-in answers 403 `PERMISSION_DENIED` for the
orders read only: "Multi-Package Orders: this app's customizations could
not be read." / 「Multi-Package Orders:这个应用的定制读不到。」, total 1, the core
row still listed, the orders card reads its failed line.
4. 375 px: no horizontal scroll; tabs, search and the group button are
44 px tall.
Acceptance 1 combines two apps and a switched-off flow in one
environment; live, those are read in two environments (no example ships
two installed apps with a packaged flow); the exact combination is the
first component case. On the multi-package example, ensure-customization
on the orders module answers the core pair (shared namespace `crm`,
ADR-0130 D4); orders' extension was written there and the orders read
lists it.
## Verification
<details><summary>Gates on head 9f42374 (main 3bbda33 merged
in)</summary>
- `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/BuilderLanding`: 12 files, 73
tests pass on the merged-forward tree.
- studio-design directory (before the merge forward, same panel code):
336 files, 2587 tests pass.
- Derived gates (`dispatch-gates --commands`, 38): all exit 0 (`vitest
run scripts/` in ui at `--maxWorkers=2`).
- `pnpm --filter @object-ui/app-shell run type-check` exit 0 (after
rebuilding the stale local `@object-ui/core` dist that main's #34647
needs); `@object-ui/i18n` type-check exit 0; ESLint on every changed
`ui/` file exit 0.
- `pnpm console:build` exit 0; `pnpm check:eager-closure` exit 0.
**i18n-locale-en: 60.2 KB of the 60.5 KB ceiling** (unchanged; this PR
does not touch `locales/en.ts`, its keys are in the lazy studio
namespace). Aggregate 1895.8 KB / 2431.6 KB.
- `pnpm check:changeset-fixed` exit 0; `check:test-source-alias` exit 0.
- `scripts/pm/overlap-check.mjs --branch=HEAD`: VERDICT clean (#34677
and #34799 share the studio en/zh files and merge cleanly).
</details>
Deviations: the branch is this thread's pinned branch
`claude/project-thread-eqwj27`, restarted from `main` after #34747
merged. File surface beyond the claim's "new panel component":
`landingCustomizations-io.ts` beside it (rows and the label read, split
out so a test can double the label read).
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; ESLint passes on every changed file.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzivEnnozveqZfr4fDx -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b1bca7a commit 4bdbdac
13 files changed
Lines changed: 985 additions & 17 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views/studio-design
- i18n/src/namespaces/studio
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
127 | 128 | | |
128 | 129 | | |
129 | 130 | | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
| |||
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
105 | | - | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | | - | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
187 | 213 | | |
188 | 214 | | |
189 | 215 | | |
| |||
416 | 442 | | |
417 | 443 | | |
418 | 444 | | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
419 | 454 | | |
420 | 455 | | |
421 | 456 | | |
| |||
0 commit comments