Repository navigation
Commit 3d1de0b
feat(studio): App Studio's package overview gets Export as a button, a Publish history tab with the revert, and is where opening a package lands (#38318)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao8yuuVTeYz2cp3jbp8jpvkr)_
Fixes #37958
Fixes #37687
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:在应用搭建里打开一个软件包,现在先到它的「概览」页(以前先到对象列表);概览页头多了「导出」按钮,多了「发布历史」页签,按时间倒序列出每次发布(做了什么、什么时候、几项、谁发布的),「还原到上次发布」也搬到这个页签里;带定制的系统自带包上,导出、发布历史和还原都针对它的定制包,按钮写成「导出
某某 的定制」;「全部类型」页标题下那一行,除了已定制几项还写已停用几项;只读包的小锁和「待发布」页签,用键盘和读屏也能读到只读的原因。
- 为什么做:应用搭建改版专题里「完整概览页」这一项,按你 11 月 27
日点的「全部按建议」落地,同时并入「只读原因只有鼠标悬停才看得到」那张卡。
-
出错会怎样:最坏是打开软件包落到的页面不对,或者导出、还原找错了包(基础包和它的定制包之间);还原有确认框,只丢弃还没发布的改动、不动已发布的内容,这次改动可以直接撤回。
- 要你做什么:这次把你定的四条写进了一份架构决策记录,按规矩要你或另一位维护者批准后才能合并。
## What changes
A package's 概览 Overview in App Studio becomes the full page of decision
9 of topic #37424, as ruled in [comment
7218879913](#37424 (comment)).
- **Header.** Export is a button of the page header
(`studio-overview-export`), drawn for a `manage_metadata` holder. The ⋯
menu keeps four rows: Edit package info, Duplicate as a new package,
Adopt loose items, Manage in Setup…. Export and the revert have left it;
disable, enable and delete were never in it.
- **Publish history tab** (`?tab=history`, the third tab). The package's
publishes, newest first, read from the commit list the build timeline
already reads (`fetchCommits`): what each was (a publish, or the undoing
of one), its note, when, how many items and who. "Revert to last
publish" sits on this tab with the confirmation dialog it had in the ⋯
menu, moved, not copied. A list and that one revert: an entry has no
revert of its own (the claim's option A).
- **What the three act on.** On a read-only package with a `.custom`
pair, Export, the history and the revert act on the pair (`pairId ??
packageId`), the package Pending and Publish already act on. Export then
reads "Export customizations of NAME" / 「导出 NAME 的定制」 and downloads the
pair; the base is not exported from this page. The revert is greyed only
where nothing can be published (a read-only package with no pair) or
nothing is pending, and it says which in words beside the button.
- **Landing.** The bare address `/studio/PKG` and App Studio's return to
the package last opened now open `/studio/PKG/overview`. Both opened the
object list before. `/studio/PKG/data` still opens the object list and
the other retired addresses keep their redirects.
- **「全部类型」 All types.** The line under the title says what is switched
off beside what is customized: "3 customized · 2 switched off on HotCRM"
/ 「HotCRM 已定制 3 项 · 已停用 2 项」. With nothing switched off the line is
unchanged.
- **Read-only reasons for keyboard and screen-reader users (#37687).**
The lock beside a read-only package's name in the package switcher is
named by the reason, and the switcher button is described by it, in the
collapsed column too. Where nothing can be published, the Pending tab is
described by the same sentence and shows it in words when opened; the
greyed revert names its reason the same way.
- **ADR-0084.** One dated paragraph after the sentence that left two
things open in § 概览 Overview records the ruling's four items (what the
three act on, Export's option and its ground, the address and the two
landings, the home of the line per package with its three accepted
costs). No other ADR text moves.
- **i18n.** New `studio` keys in en and zh:
`engine.studio.overview.tab.history`,
`engine.studio.overview.exportCustomizations`,
`engine.studio.overview.history.{note,noteCustomizations,empty,loading,loadFailed,unreachable,published,undone,items,itemsOne}`,
`engine.directory.customizations.totalSwitchedOff`.
Two things the live app showed, fixed in this PR:
- **Who published is a name.** A publish records its actor's user id, so
the first build printed a 32-character id. The tab asks the user
directory once for the distinct actors of the list
(`useHistoryActorNames`, the read an item's history already names its
actors with) and shows the user's name, the id kept on its title. An
actor the directory has no row for (an AI principal among them) is shown
as recorded.
- **The page waits to learn what the package is.** A read-only package's
pair is learned from the surface's read of the package list. Opened
straight on the history tab, the page asked for the base's commit list
before that read landed and offered "Export" on the base in the same
moment. While the surface is still asking, the history is not read,
Export is disabled and the revert is greyed; after it answers, the
base's commit list is never asked for.
## Tests
- `StudioPackageOverview-37454.test.tsx` (49 cases): Export as a header
button and what it downloads; the tab, its address and its states
(loading, refused, unreachable, empty, the list in en and zh); who
published by name; no revert per entry; the revert's dialog, its target
and its two greyed reasons; the pair blocks (Export, history and revert
on the pair, the no-pair control); the wait for the package facts; the
Pending tab's reason by role, name and description.
- `StudioPackageMenu-37139.test.tsx`: four rows; the export and revert
doors are imported by the overview page only, and the revert
confirmation has one copy.
- `StudioTopLeft-37456.test.tsx`: the lock's accessible name is the
reason; the switcher button's description is the reason, in en and zh
and in the collapsed column; a writable package's is not.
- `studioPillarRedirectModel.test.ts`, `StudioEntryRedirect.test.tsx`,
`studioAddress.test.ts`: the bare address, the pair's bare address and
the entry all land on 概览, the query kept; `/data` still opens the object
list.
- `metadataAreaHost.customizations-28568.test.tsx`: both counts on the
line, the zh sentence, a base with nothing customized and something
switched off, and the unchanged line as control.
- `StudioRoute.metadataArea-28561.test.tsx`,
`StudioRoute.recentPackage-11863.test.tsx` (console): they pinned the
old landing on the real routes and are re-pointed.
Ablations (`node scripts/ablation-replace.mjs`, each restore proven by
blob == HEAD and an empty `git diff HEAD`):
| Mutation | Result |
|---|---|
| `revertPackage(actionTarget)` → `revertPackage(packageId)` | 1 failed
/ 45 passed: expected `POST …/com.vendor.crm.custom/revert`, received
`POST …/com.vendor.crm/revert` |
| `revertReason = publishReadOnly` → `= readOnly` | 2 failed / 44
passed: the pair's revert is no longer offered; greyed "for read-only" |
| switcher `aria-describedby` deleted | 3 failed / 15 passed: no button
with name "Switch package: Sales" and the reason as description (en, zh,
collapsed) |
| lock `aria-label` back to "Read-only" | 3 failed / 15 passed: no `img`
named by the reason |
| Pending tab `aria-describedby` deleted | 2 failed / 44 passed: no
button "Pending" / 「待发布」 with the reason as description |
| actor name → the recorded id | 1 failed / 48 passed: "Unable to find
an element with the text: Ada Lovelace" |
| history read no longer waits for the package facts | 3 failed / 46
passed: `GET …/com.vendor.crm/commits` asked before the pair's |
<details><summary>Readings</summary>
- Readings below were taken at `63ebd3a19` (8 commits on `98bd8deed`).
Head `60305c2c6` adds two commits: the app shell line in the changeset
frontmatter, and one ADR-0084 sentence; no source or test file changed.
At `60305c2c6` the 21 gate commands derived for the ADR path ran, each
exit 0, with `--ran` at 21 derived, 21 run, 0 unrun.
- Dependency closure build (turbo: the app shell's dependencies and the
showcase): 106 of 107 tasks. The one red task was the app shell's own
build, compiled while the tree was mid-edit; `pnpm --dir ui --filter
@object-ui/app-shell build` at the final head → lock `VERDICT
command-exit 0`.
- `type-check` of `@object-ui/app-shell`, `@object-ui/i18n` and
`@object-ui/console` at the final head → each lock `VERDICT command-exit
0`.
- `pnpm --dir ui --filter @object-ui/i18n test` → `Test Files 109 passed
(109)`, `Tests 1873 passed | 13 skipped (1886)`.
- `pnpm --dir ui --filter @object-ui/console test` → `Test Files 340
passed (340)`, `Tests 3727 passed (3727)`.
- `pnpm --dir ui --filter @object-ui/app-shell test` → `Test Files 1
failed | 2442 passed | 1 skipped (2444)`, `Tests 2 failed | 23931 passed
| 9 skipped (23942)`, lock `VERDICT command-exit 1`. The red file is
`layout/__tests__/designModeMenuSave-36363.test.ts`: two cases expect
`emitMetadataRefresh` once and count 0. It passes alone (`Tests 47
passed (47)`) and fails the same two cases whenever
`designModeMenuCreate-36364.test.ts` runs before it in one worker (those
two files with `--maxWorkers=1`: `Tests 2 failed | 60 passed (62)`):
each mocks the same module with a spy of its own, and the `unit` project
shares its module cache between files. Neither file is in this diff; of
the 40 files the two import, this diff touches one, in comments only.
- The nine test files this PR changes, together → `Test Files 9 passed
(9)`, `Tests 234 passed (234)`.
- `node scripts/pm/dispatch-gates.mjs --commands` at the final head: 48
commands, each run, each exit 0; `--ran` → "48 derived, 48 run, 0
NOT-MEASURED, 0 UNRUN".
- `node scripts/pm/overlap-check.mjs` → `VERDICT clean exit 0`, against
`origin/main` at `98bd8deed` and the two open pull requests that share
the studio i18n files (38285 and 38204), each "merges cleanly".
- ESLint over the changed UI files: 0 errors. New cross-file line
citations against the base: 0.
- Ablations 1 to 5 ran on `db83d2350` (the test file then held 46
cases), 6 and 7 on `63ebd3a19` (49 cases).
</details>
## Acceptance notes
- **Screenshots** (Chromium, 1440×900, showcase app, light and dark,
zh-CN; four in en-US) in `card-37958/screenshots/`: a writable package's
Overview on Info and on Publish history
(`overview-writable-{info,history}-zh-{light,dark}.png`); the read-only
showcase with its `.custom` pair on Info and on Publish history, the
header reading 「导出 ObjectStack Showcase 的定制」
(`overview-readonly-pair-{info,history}-zh-{light,dark}.png`); a
read-only package with no pair on Pending, with the reason in words
(`overview-readonly-nopair-pending-zh-{light,dark}.png`); the All types
header with both counts (`all-types-header-zh-{light,dark}.png`); one
760px-wide capture of the history tab. In the same run the page was
driven: Export downloaded `com.example.showcase.custom.package.json`,
the revert posted to the pair and then greyed with "Nothing has changed
since the last publish.", and the only package doors asked were the
pair's.
- **Surface beyond the claim, named.** `studioAddress.ts` and
`studioAddressTable.ts` (doc comments and two table rows that described
the old landing), `studioAddress.test.ts`,
`StudioTopLeft-37456.test.tsx`,
`metadataAreaHost.customizations-28568.test.tsx`, and the two console
`StudioRoute.*` tests that pinned the old landing.
`useHistoryActorNames` is imported from `views/item-tools/`, not edited.
- **A pair's own bare address** (`/studio/BASE.custom`) now opens its
base's 概览 in one redirect. Before, it opened the pair's own object list.
The ruling does not speak of it; the base's page is where the pair's
Export, history and revert live.
- **Studio's entry** sends the overview address directly instead of the
bare address through the route, so the return to the last package is one
redirect. A test pins that it equals where the bare address lands.
- **The All types line** is also drawn when nothing is customized and
something is switched off ("0 customized · 2 switched off on X"), as the
Setup panel draws zeros.
- **The switcher** describes its button by the reason, beyond the card's
literal "the lock's accessible name": a button's children are
presentational to assistive technology, so the lock's own name is not
announced when the button is focused.
- **The revert on a pair that has drafts and has never been published**
is offered (the ruling greys it only for the two cases above); the
server answers 409 with its own sentence, shown in the toast.
- **Other doors into a package's Studio name the object list explicitly
(`/data`) and still open it**: the command palette's package entries, an
app's design-in-Studio path, the empty-menu state's "Open in Studio"
(its text is about creating objects), Setup → Packages' create landing
and "Open in Studio", and the customizations panel's link. The last
three belong to the Setup slimming (#37401). The ruling names the bare
address and Studio's entry, so the rest is left as it is; the seat kept
this PR to those two and carries the rest to the maintainer as an open
question in the Tier H hand-off. A package in the recent-items list is
recorded with the bare address, so it opens 概览 too. The pair's own bare
address (`/studio/BASE.custom`, which now opens its base's 概览; see the
bullet above) is unruled too and goes in the same hand-off. ADR-0084's
amendment paragraph now says the ruling names the two doors only and
that one landing for every door is not ruled (rework round 1, head
`60305c2c6`).
- **The top bar's review sheet** still gives no read-only reason where
its Publish is absent. #37687 is read here as the overview's Pending tab
and the switcher's lock. Observation, not filed.
- **Changeset frontmatter.** The changeset names
`'@object-ui/app-shell': patch` beside `'@object-ui/i18n': patch` (seat
ruling after round 1): the changeset config versions private packages,
the app shell has a changelog, and the tree's other Studio changesets
name both.
- **One red file in the app shell's own suite, not from this diff**:
`designModeMenuSave-36363.test.ts` fails two cases when
`designModeMenuCreate-36364.test.ts` runs before it in the same worker
(Readings has the recipe). Reported to the seat, not touched here.
- This PR edits `docs/adr/**`: Tier H, merged on a maintainer's
approval.
## Verification
First read, by risk:
1. `StudioPackageOverviewPage.tsx`: `actionTarget`, `targetKnown` and
`revertReason` at the top of the component, and the revert dialog's
`revertPackage(actionTarget)`. A wrong target here exports or reverts
the wrong package.
2. `studioPillarRedirectModel.ts`: the bare-address branch. It decides
where the bare package address lands, a pair's included.
3. `docs/adr/0084-application-builder-information-architecture.md`: the
paragraph dated 2026-11-28, against the ruling's four items.
Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/StudioPackageOverview-37454.test.tsx
--maxWorkers=2` → 49 passed. In the running console, open `/studio/PKG
(a read-only package that has customizations)`: it lands on Overview,
the header button reads "Export customizations of NAME", and Publish
history lists the customization package's publishes with "Revert to last
publish" beside them.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibwhvDmUtvvE3VyLJRf)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibwhvDmUtvvE3VyLJRf
<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qibwhvDmUtvvE3VyLJRf -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ceb5cdf commit 3d1de0b
24 files changed
Lines changed: 1381 additions & 239 deletions
File tree
- .changeset
- docs/adr
- ui
- apps/console/src/components
- packages
- app-shell/src/views
- metadata-admin
- 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 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
| 443 | + | |
| 444 | + | |
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
| |||
265 | 269 | | |
266 | 270 | | |
267 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
268 | 275 | | |
269 | 276 | | |
270 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
302 | 312 | | |
303 | 313 | | |
304 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
166 | 175 | | |
167 | 176 | | |
168 | 177 | | |
169 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
170 | 182 | | |
171 | 183 | | |
172 | 184 | | |
| |||
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| 192 | + | |
180 | 193 | | |
181 | 194 | | |
182 | 195 | | |
| |||
394 | 407 | | |
395 | 408 | | |
396 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
122 | | - | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
209 | 213 | | |
210 | 214 | | |
211 | 215 | | |
212 | | - | |
| 216 | + | |
| 217 | + | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
| |||
256 | 261 | | |
257 | 262 | | |
258 | 263 | | |
259 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
266 | | - | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
| |||
360 | 366 | | |
361 | 367 | | |
362 | 368 | | |
| 369 | + | |
| 370 | + | |
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
| |||
0 commit comments