Repository navigation
Commit 4e10d4b
feat(studio): 概览 package overview page — Info and Pending tabs, ⋯ menu in its header (#37546)
repo:objectstack#5 · os-bill · session_01Utp6CbL6Nn3scsU8yvLyU4
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgTC1DCWJ4MisoLdbUU1V1sb)_
Fixes #37454
Clause-②: no
Metadata-protocol: none
## 维护者速读
用户能看到什么变化:在 Studio
里打开一个软件包,左侧菜单第一行变成「概览」,有待发布的修改时旁边显示数量,点数量直接进入待发布。概览页头显示包名、「系统自带/可写」「使用中/已停用」两个标记和包的描述,下面有「信息」「待发布」两栏;原来顶栏左侧的「⋯」软件包菜单搬到了这页页头的右侧。
为什么做:这是 App Studio 改版的第一步(精简的软件包概览)。包的基本信息和等着发布的修改都集中到这一页,不用再去顶栏和设置里分头找。
出错会怎样:在 Studio
里管理软件包的人会碰到。最可能的问题是待发布数字和实际不符,或者从概览发布的结果和顶栏发布不一样;顶栏的发布按钮仍然保留,可以照常用。这个改动可以直接撤回,不涉及数据。
要你做什么:无
## What changes
- **New page `StudioPackageOverviewPage`**, reached at
`/studio/PACKAGE/overview` (ADR-0084 § 概览 Overview, amendment
2026-11-26). It is drawn in an item page's frame: `StudioItemHeader`
plus `StudioTab`.
- **Header**: the app mark (or the package icon), the name, and two
chips: 系统自带 with a lock on a read-only package or 可写; and 使用中 or 已停用.
Both chips come from the package list row's own `writable` / `enabled`;
a row that does not say draws no chip. The description is the header's
note, and the ⋯ menu sits in the header's actions.
- **信息 Info**: read-only rows for name, description, source, version and
the package's app (a link that opens it). A read-only package says so
beside its source. The id, namespace and type are folded under 技术信息.
While the row is read, the card holds an announced loading row
(`role=status`); a failed read says so in place of the fields.
- **待发布 Pending** (`?tab=pending`): the existing `DraftChangesPanel`
drawn in place. Its tab carries the pending count only while something
is pending.
- **`DraftChangesPanel`** gains two optional props. Without them it
behaves exactly as before; the body hunk is re-indented, so read it with
`-w`.
- `embedded` draws the same header notes and body in a `section` instead
of a `Sheet`, and does not dismiss toasts on open.
- `reloadKey` re-reads the drafts when it moves.
- **`StudioDesignSurface`**
- Renders the overview branch with the panel wired prop for prop like
the top bar's sheet: `doPublish` (or `undefined` when
`publishReadOnly`), `draftScope`, `renderPublishRefusal`, the pair's
`customizationOf`, and `publishing`.
- `StudioPendingDraftsContext.Provider` now wraps the menu and pillars
row, so the menu can read the count.
- The top bar's Changes / Publish stays; ADR-0084 keeps it until a later
card.
- **⋯ `StudioPackageMenu`** left `StudioBackToApp` (its `menu` prop is
removed) and now lives in the overview header. Its six rows are
unchanged, and it opens aligned to the end. Disable, enable and delete
stay in Setup (question 1 ruled B).
- **`StudioMenu`**: the first row of a package's menu, above the groups
and under no group's label, is 概览 (a package cube icon). While drafts
wait it carries their count as an amber badge, a link of its own beside
the row, which opens `?tab=pending`. A search lists the row when its
name matches. `~org` and `~all` draw no such row. The menu reads the
count from `StudioPendingDraftsContext`.
- **Address and menu model**
- Address: `studioPackageOverviewPath` and `studioOverviewTab` in
`studioOverviewAddress.ts`. The open tab rides the console's reserved
`tab` key (`RECORD_DETAIL_TAB_PARAM`, `urlParams.ts`; ui AGENTS rule
#8), which Studio's item pages already read through
`ITEM_TOOL_TAB_PARAM`; no Studio constant restates it. The builder sits
beside `studioAddress.ts` rather than in it because `urlParams.ts`
imports `studioAddress.ts`, so the reverse import would be a cycle.
`studioAddressTable.ts` gains the `overview` family, and its `tab` row
describes the shared key: an item page's tab, and `pending` on the
overview.
- Menu model: `studioMenuOverviewEntry` (no entry outside a package; a
badge only above zero), `studioMenuOverviewMatches`, and
`studioMenuCurrentKey` answering `overview`.
- **Package REST read**: `ListedPackageManifest` now carries `enabled`
and `source` from the row of `GET /api/v1/packages`. There is no
`package` metadata type.
- **i18n (en, zh)**: `engine.studio.menu.overview`,
`engine.studio.menu.overviewPending` with its singular
`engine.studio.menu.overviewPendingOne` (the catalogue's `…One` form: "1
change waits for a publish"; zh reads the same either way), and
`engine.studio.overview.*`.
- **Changeset**: patch for `@object-ui/app-shell` and `@object-ui/i18n`.
**Read first (by risk):**
1. `StudioDesignSurface.tsx`, the overview branch's `DraftChangesPanel`
props. The Pending tab must publish exactly like the top bar.
2. `DraftChangesPanel.tsx`, the `embedded` return and the `reloadKey`
effect deps.
3. `StudioMenu.tsx`, `renderOverview()` and its call above the groups:
the badge is a sibling link, not nested in the row's link.
## Tests
The broad run, typecheck and gates are on the final head 29bb079.
Earlier rounds' ablations ran on 06830bf (page, Pending tab) and
618c0cf (menu row).
- **New `StudioPackageOverview-37454.test.tsx`** (the real surface; the
panel probe records the props given to the sheet and to the embedded
panel). It covers:
- the header chips in en and zh, read-only 系统自带 with a lock, and 已停用;
- the menu in the header and not in the top bar, and no menu without
`manage_metadata`;
- the Info fields with the technical section folded, and the read-only
source sentence;
- the Pending count and the `?tab=pending` URL, with no count when
nothing is pending;
- embedded props identical to the sheet's, and `onPublish` undefined on
both for a read-only package;
- the branch order: a failed row read says so in place of the fields
with the header kept; a read still on the wire shows the announced
loading row and neither a failure nor fields, then the fields once it
answers; an unknown package at its overview address lands on the
not-found state; `~org/overview` redirects to the scope's area, read
once through the route as the console mounts it and once with the
surface alone.
- **New `StudioMenu.overview-37454.test.tsx`** (real provider, sidebar
primitive and router). It covers:
- 概览 is the first link, above every group and under none; it opens the
overview, reads 概览 in zh, and is current on the overview including the
Pending tab;
- CONTROL: `~org` and `~all` draw no row;
- the badge reads 3 with its aria-label, and one draft reads in the
singular ("1 change waits for a publish"); CONTROL: a ledger of 0 and an
unknown ledger draw no badge;
- one click on the badge lands on `/overview?tab=pending`, and the row
lands on the Info tab;
- a search lists the row on `over` but not on `flow`.
- **`StudioMenu.test.tsx`**: the 常用 listing case now asserts that 概览
leads the menu before the 常用 types. Its #37452 cases (chevrons, active
pill, graphite accent) pass unchanged.
- **Re-pointed, not weakened**:
`StudioDesignSurface.publishCount-11807.test.tsx` now runs every case
twice, from the top bar and from the Pending tab (`describe.each`).
`StudioPackageMenu-37139.test.tsx` now opens the menu from the overview
header and asserts that the top bar has none. Its no-menu check on
`~org` and `~all` now asks at the overview's own address on each scope,
where the menu would be, instead of on pages that never drew it.
- **Extended**: `DraftChangesPanel.posture-12517.test.tsx` covers the
embedded panel: no dialog, publish with no options, no toast dismiss
(control: the sheet dismisses), a `reloadKey` re-read (control: an
unmoved key reads nothing more), and nothing drawn when closed.
`studioMenuModel.test.ts` covers the overview entry, the badge, the
matcher and the current key. `studioAddress.test.ts` covers the builder,
the tab and the table lists.
- **Broad run** over `studio-design/`, `preview/` and `packages/i18n/`
on 29bb079: 449 files, 4720 passed and 13 skipped; lock VERDICT
command-exit 0.
- **Typecheck**: app-shell `tsc --noEmit` and `tsc -p
tsconfig.test.json` both exit 0 (the test project at an 8 GB heap).
- **Ablation** (each leg went red, and each restore is proven: blob
equals HEAD and `git diff HEAD` is empty):
- A1: Pending tab `onPublish` set to undefined. 6 red: 5 Pending-tab
publish cases and the prop-parity case.
- A2: embedded panel dismisses toasts. 1 red.
- A3: `reloadKey` dropped from the effect deps. 1 red.
- A4: `embedded` branch disabled. 1 red.
- A5: read-only chip forced off. 3 red.
- A6: badge drawn at zero in the model. 1 red.
- B1: the menu row moved below the groups. 1 red (the first-row pin).
- B2: the badge drawn whatever the count. 2 red (the zero and unknown
controls).
- B3: the badge linked to the row's own address. 1 red (the badge-click
pin).
- C1: the page's failure branch off. 1 red (the load-failure pin).
- C2: the page's loading branch off. 1 red (the loading pin).
- C3: the surface lets an unknown package through to the overview. 1 red
(the not-found pin).
- C4a: the surface's own `~org` redirect off. 1 red (the surface-alone
case).
- C4b, the control: only the pillar redirect's `~org` branch lets the
overview through. It stays green because the surface's guard behind it
catches the address.
- C4c: both doors off. 2 red (both cases).
- C5: the singular label never chosen. 1 red (the one-draft pin).
<details>
<summary>Ablation log (ablation-replace verdicts)</summary>
```text
LEG A1-pending-onPublish :: exit 1 :: Test Files 2 failed (2) Tests 6 failed | 24 passed (30)
LEG A2-embedded-toast :: exit 1 :: Test Files 1 failed (1) Tests 1 failed | 9 passed (10)
LEG A3-reloadKey :: exit 1 :: Test Files 1 failed (1) Tests 1 failed | 9 passed (10)
LEG A4-embedded-inplace :: exit 1 :: Test Files 1 failed | 1 passed (2) Tests 1 failed | 23 passed (24)
LEG A5-readonly-chip :: exit 1 :: Test Files 1 failed (1) Tests 3 failed | 11 passed (14)
LEG A6-badge-zero :: exit 1 :: Test Files 1 failed (1) Tests 1 failed | 31 passed (32)
RESTORE diff-HEAD-bytes=0 status=0 ; hash-ok on all four mutated files
LEG B1-first-row :: exit 1 :: Test Files 1 failed (1) Tests 1 failed | 9 passed (10)
LEG B2-badge-always :: exit 1 :: Test Files 1 failed (1) Tests 2 failed | 8 passed (10)
LEG B3-badge-target :: exit 1 :: Test Files 1 failed (1) Tests 1 failed | 9 passed (10)
RESTORE diff-HEAD-bytes=0 status=0 ; hash-ok StudioMenu.tsx
LEG C1-load-failed :: exit 1 :: Tests 1 failed | 3 passed | 14 skipped (18)
LEG C2-loading :: exit 1 :: Tests 1 failed | 3 passed | 14 skipped (18)
LEG C3-unknown-package :: exit 1 :: Tests 1 failed | 3 passed | 14 skipped (18)
LEG C5-singular :: exit 1 :: Tests 1 failed | 10 passed (11)
LEG C4a-surface-guard :: exit 1 :: Tests 1 failed | 1 passed | 17 skipped (19)
LEG C4b-pillar-only :: exit 0 :: Tests 2 passed | 17 skipped (19) (control: the guard behind it holds)
LEG C4c-both-doors :: exit 1 :: Tests 2 failed | 17 skipped (19)
RESTORE diff-HEAD-bytes=0 status=0 ; hash-ok on every mutated file
os-verify-lock: VERDICT command-exit 0 (every batch)
```
</details>
## Acceptance notes
- The claim's file surface was amended to add `StudioMenu.tsx` for the
概览 row and its badge only. `studio-tokens.ts`, `studioAccent.ts`,
`studioTitleRow.tsx` and `PageShell.tsx` are untouched.
- The row is drawn in `StudioMenu.tsx` and not through
`buildStudioMenu`, which builds only the domain groups: adding a kind
there would change the per-kind records the menu keys on. The row reuses
the sidebar primitive's `SidebarMenuButton`, so its active state is the
same graphite pill as every entry. In the real browser the current-row
background reads `rgba(53, 57, 64, 0.1)` in light and `rgba(208, 210,
216, 0.18)` in dark, the same on the 流程 entry and on the 概览 row, and the
5 group chevrons are drawn.
- The icon is a package cube (`Package`). A first cut used
`LayoutDashboard`, which the browser showed to be indistinguishable from
应用's `LayoutGrid`.
- **Mockup 4 comparison.**
- Header, chips, description, tabs, the Info card and the folded 技术信息
match.
- Not in this card's governing text: the standalone 导出 button (export
stays a ⋯ row, six rows unchanged) and the 发布历史 tab.
- The source line shows the row's own `source` (代码。只读:不能直接修改。). The
mockup's pair-aware sentence (你的修改会单独保存…) is copy for a later pass.
- The overview's `?tab=` is the console's reserved key from
`urlParams.ts` (ui AGENTS rule #8), not a Studio constant. Its builder
lives in `studioOverviewAddress.ts` and not in `studioAddress.ts`:
`urlParams.ts` imports `studioAddress.ts` and lists its
`STUDIO_RETURN_PARAM` at module scope, so a back-import would be a cycle
whose load order decides whether that list reads an uninitialised
binding.
- `reloadKey` is a prop added to the load effect's deps and not a `key=`
bump, following ui AGENTS rule #8 on forced reloads.
- The top-bar Publish is unchanged and stays until the card ADR-0084
names for its removal.
## Verification
Two-minute check: run the showcase example and open
`/studio/com.example.showcase/overview`. Expect:
- the header with ObjectStack Showcase, 系统自带 with a lock, 使用中 and the
description, with ⋯ at the right;
- 信息 with 基本信息 and a folded 技术信息;
- 待发布 listing any drafts, with 全部发布 at the bottom.
**Real browser**: Chromium at deviceScaleFactor 2, light and dark, on
the showcase with 3 AI-style view drafts in its customization pair.
- Shots taken: the Info tab, the Info tab with 技术信息 open, the ⋯ menu
open with its six rows, the Pending tab with a count of 3, the Pending
tab after publishing, the menu with 概览 first and its badge (full page
and close-up), and a badge click landing on the Pending tab.
- In the menu, the first links are 概览, its badge (3, `3 项修改待发布`), then
对象. Clicking the badge lands on
`/studio/com.example.showcase/overview?tab=pending` with the Pending tab
open and 概览 current.
- Clicking 全部发布 in the Pending tab sent `POST
/api/v1/packages/com.example.showcase.custom/publish-drafts`. `_drafts`
then read empty and the tab count disappeared.
<details>
<summary>Derived gates (dispatch-gates --ran)</summary>
```text
Run reconciliation — 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN.
✓ dispatch-gates --ran: 39 derived famil(ies) accounted for — 39 run, 0 NOT-MEASURED (a DERIVED zero — all 39 recorded an exit code and none of them is 3).
every one of the 39 :: exit 0 (incl. check:nul-bytes, check:published-files, check:type-check-coverage, check:test-source-alias,
check:cross-package-test-inputs, check-adr-0087-registration, check-empty-changeset, check-changeset-no-major)
pnpm --dir ui exec vitest run scripts/ :: Test Files 172 passed | 2 skipped (174) · Tests 5130 passed | 2 skipped · lock VERDICT command-exit 0
check-platform-checklist --changed-from origin/main: OK — 2 anchor(s) judged, 0 lost
```
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 1afb6d4 commit 4e10d4b
23 files changed
Lines changed: 1931 additions & 440 deletions
File tree
- .changeset
- ui/packages
- app-shell/src
- preview
- __tests__
- 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 | + | |
| 19 | + | |
| 20 | + | |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
| |||
156 | 161 | | |
157 | 162 | | |
158 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | 106 | | |
110 | 107 | | |
111 | 108 | | |
| |||
153 | 150 | | |
154 | 151 | | |
155 | 152 | | |
156 | | - | |
157 | 153 | | |
158 | 154 | | |
159 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
| 78 | + | |
74 | 79 | | |
75 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
| |||
159 | 168 | | |
160 | 169 | | |
161 | 170 | | |
162 | | - | |
| 171 | + | |
163 | 172 | | |
164 | 173 | | |
165 | 174 | | |
| |||
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
171 | | - | |
| 180 | + | |
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
175 | 193 | | |
176 | 194 | | |
177 | 195 | | |
| |||
181 | 199 | | |
182 | 200 | | |
183 | 201 | | |
184 | | - | |
| 202 | + | |
185 | 203 | | |
186 | 204 | | |
187 | 205 | | |
| |||
190 | 208 | | |
191 | 209 | | |
192 | 210 | | |
193 | | - | |
| 211 | + | |
194 | 212 | | |
195 | 213 | | |
196 | 214 | | |
| |||
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
207 | | - | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
222 | 240 | | |
223 | 241 | | |
224 | 242 | | |
225 | | - | |
| 243 | + | |
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
229 | 247 | | |
230 | 248 | | |
231 | 249 | | |
232 | 250 | | |
233 | | - | |
| 251 | + | |
234 | 252 | | |
235 | 253 | | |
236 | 254 | | |
| |||
247 | 265 | | |
248 | 266 | | |
249 | 267 | | |
250 | | - | |
| 268 | + | |
251 | 269 | | |
252 | 270 | | |
253 | 271 | | |
| |||
0 commit comments