Repository navigation
Commit d656d62
feat(app-shell): Setup › Installed Apps shows app updates, folds modules under their app, and leaves the developer doors to Studio (#34815)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBA6p6wR5XRGmnECFZqr87FM)_
Fixes #34722
Clause-②: yes (widening — locale keys only)
Metadata-protocol: none
## 维护者速读
- **改了什么**:设置 › 已安装应用现在会标出应用市场里有新版本的应用("有可用更新 →
vX",点击进入该应用的市场页去升级),页首说明有几个应用可升级;一个应用一行,它带的模块包折叠在应用下面按需展开;列改为名称/版本/状态/来源/更新;导入、新建包、平台包开关和"显示全部"只留在
Studio 的包页。
- **为什么改**:管理员在已安装应用里看不到哪些应用该升级,也被内部
ID、Scope、开发者按钮和逐个模块的长列表淹没(#34722,ADR-0146 D1 / ADR-0130 D2)。
- **风险与回滚**:只改前端一个页面在 `?source=marketplace` 时的绘制,Studio 包页(同一组件、不带
source)不变;市场读不到时列表照常显示并加一行说明,绝不显示"已是最新"。回滚=回退本 PR,无数据或接口变化。
-
**先看**:`ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx`
的 `readUpdateTargets`(何时算"读不到")与
`appOfModule`(模块归属哪个应用);`console/marketplace/__tests__/marketplaceNamespaceBoundary.test.ts`
新增的 hook-gated 门;`PackagesPage.installedAppsUpdates-34722.test.tsx`。
- **两分钟验证**:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx`,预期
16 passed。
- **需要你做的**:无,席位落地
## What changes
Setup › Installed Apps is the `developer:packages` component opened with
`?source=marketplace` (Setup's `nav_marketplace_installed`); Studio ›
Packages is the same component with no params. The view is told apart by
the existing `installedAppsView` flag, so Studio's door is untouched.
| | Before | After (Setup › Installed Apps only) |
|---|---|---|
| Update information | none | the marketplace's own
`UpdateAvailableBadge` ("Update available → v6.4.0") plus "Upgrade",
linked to `/system/marketplace/PACKAGE_ID` (the route the Details action
already opens); a header line "N apps have a newer version in the
marketplace." |
| Catalog unreadable / no marketplace | n/a | the list renders as before
plus one line: "Update information can’t be read from the marketplace
right now, so this list can’t say which apps have a newer version."
Never drawn as up to date. |
| Modules | every package its own row | a `type: 'module'` package that
declares exactly one installed app (same source) in
`manifest.dependencies` is folded under that app's line; a toggle
(aria-expanded, aria-controls) shows it. This is the same tie the
server's `isDisableableAppModule` reads. A module declaring two apps, or
none in view, stays its own line. A search that hits a module shows it
under its app. |
| Columns | Name, ID, Version, Scope, Status, Source, Actions | Name,
Version, Status, Source, Update, Actions |
| Developer doors | Import, New Package, Show platform packages,
"Source: Marketplace · Show all" chip | none of them on this view;
Studio › Packages keeps all four |
How the update is decided: for each app line that has an install-ledger
entry, `getMarketplacePackage(packageId)` is read once. The latest
version is `package.latest_version?.version ?? versions[0]?.version`,
and the badge shows only when `updateTarget(installed, latest)` (the
marketplace pages' own rule) answers a version. A 404 means not listed
(no badge, no note). Any other failure, or `isMarketplaceEnabled()`
false, means unavailable (the note). Modules are never asked about.
The namespace gate (decision Q1 = A on the claim amendment): the badge's
words live only in the lazy `marketplace` namespace.
`InstalledAppUpdateCell` calls `useMarketplaceNamespace()`. While the
read or the namespace is loading, the cell holds a skeleton placeholder,
never an empty "up to date" cell. When the namespace is ready, it draws
`UpdateAvailableBadge`. When the namespace fails, it still shows "→
v6.4.0" and the Upgrade link. `marketplaceNamespaceBoundary.test.ts`
gains one declared hook-gated door (`UpdateAvailableBadge.tsx` drawn
only from `PackagesPage.tsx`) and asserts through the TypeScript AST
that the importer imports and calls the hook. The eager language pack
does not grow: this branch has 0 diff lines under
`ui/packages/i18n/src/locales/`.
Strings: nine keys added to the lazy `studio` namespace in en and zh
(`engine.packages.installedApps.col.update`, `.upgrade`,
`.updatesSummaryOne`, `.updatesSummary`, `.updatesUnavailable`,
`.modulesOne`, `.modules`, `.showModules`, `.hideModules`).
Docs: `content/docs/deployment/marketplace-handbook.mdx` said Installed
Apps lists "each package of a suite as its own row", which this change
makes false. Two sentences now say one line per app, with modules folded
under it.
Not done here, as the card says: the upgrade flow itself (the link lands
on the existing marketplace page), plans and permissions, and the
packaged-actions page (#34724).
### Narrowing: the developer doors leave Setup › Installed Apps
Import, New Package, the platform-packages switch and the Source chip's
"Show all" are no longer drawn when the page is opened with
`?source=marketplace` (Q2 = A for the chip). Studio › Packages keeps all
of them. These tests pin it:
- `PackagesPage.installedAppsUpdates-34722.test.tsx` › "the two doors
(objectstack#34722)":
- "Setup → Installed Apps draws the administrator columns and none of
the developer doors"
- "Studio → Packages keeps Import, New Package, the platform switch and
the developer columns, and asks no catalog"
- "Studio → Packages filtered to another Source keeps its Show all chip"
- `PackagesPage.source-12675.test.tsx`:
- "`?source=marketplace` shows only the marketplace rows, with no Show
all that clears it" (replaces the old pin, which asserted Show all on
this door)
- "another `?source=` shows only its rows, and Show all clears it"
Measured live: the developer door is the same component opened without
`source` (Import 1, New Package 1, platform switch 1, columns including
ID and Scope). The Studio app shell itself is NOT MEASURED live, because
the fixture runtime does not serve the Studio app ("This app can't be
opened").
## Tests
All on `ef65831e5c` unless noted; the pushed head `53503c6a26` is the
same tree (only a commit message was reworded).
- `PackagesPage.installedAppsUpdates-34722.test.tsx` (new, 16 tests):
badge plus href plus click; up to date gives no badge and no summary;
404 gives no badge and no note; counts two apps; 502 gives the note with
rows still listed; marketplace disabled gives no catalog read plus the
note; apps only are asked; zh badge "有可用更新 → v6.4.0"; namespace loading
gives a placeholder; namespace failed gives "→ v6.4.0" plus the link;
HotCRM one line, with four modules on demand; two-apps, orphan and
code-app modules stay unfolded; search "cpq" shows the module under its
app; plus the three door tests above.
- `PackagesPage.source-12675.test.tsx`: one pin replaced, one added (24
tests).
- `marketplaceNamespaceBoundary.test.ts`: new `it.each` "%s is drawn
only by importers that ask for the namespace themselves
(objectstack#34722)" (6 tests).
- Final run: `os-verify-lock.sh -c "pnpm --dir ui exec vitest run
--maxWorkers=2 PackagesPage.installedAppsUpdates-34722
PackagesPage.source-12675 marketplaceNamespaceBoundary"`, `VERDICT
command-exit 0`, Test Files 3 passed (3), Tests 46 passed (46).
- Wider related run (earlier head `a175016b49`): PackagesPage.*,
ResourceListPage.*, Create/EditPackageDialog,
`console/marketplace/__tests__`, spec-symbol-parity, the product-neutral
ratchet, the studio and marketplace namespace suites, and en/zh and
all-locales parity. 98 files, 1047/1048 passed; the one failure was the
source-12675 pin the Q2 decision changes, since fixed.
- Type-check: `pnpm --filter @object-ui/app-shell type-check` (tsc and
tsconfig.test.json), TC_EXIT=0 on `8fc8e215a5` (`ef65831e5c` adds docs
only).
<details><summary>Ablations (each red, each restored to blob == HEAD
with `git diff HEAD` empty)</summary>
Run with `node scripts/ablation-replace.mjs` (anchor hit x1 to x0,
auto-restore, blob verified against HEAD `5356cfce1ec3` of
PackagesPage.tsx). These are vitest-from-source suites, so no `dist/`
leg applies.
| Mutation | Result |
|---|---|
| `updateTarget(...)` replaced by `null` (badge) | 5 failed / 16 |
| catalog failure no longer sets unavailable | 1 failed / 16 |
| marketplace-disabled no longer sets unavailable | 1 failed / 16 |
| `appOfModule` returns null (no folding) | 2 failed / 16 |
| header actions drawn on both doors | 1 failed / 16 |
| namespace-loading no longer holds the placeholder | 1 failed / 16 |
| Show-all chip drawn on both doors | 1 failed / 16 |
| `useMarketplaceNamespace()` call removed (boundary suite) | 2 failed /
6 |
</details>
## Acceptance notes
- **Acceptance 4 is measured on a fixture, not on HotCRM.** The live
fold was read on `examples/app-multi-package`, whose served
`com.example.multi.orders` row is
`{"type":"module","dependencies":{"com.example.multi.core":"^1.0.0"}}`:
one module under one app. HotCRM's four-module shape is pinned only in
the unit suite. HotCRM itself is NOT MEASURED live.
- **Live readings used a stubbed catalog** (allowed by the brief). The
page requests were intercepted to mark the two example rows `source:
marketplace` at 6.2.0, with an install-ledger entry `pkg_multi_core` and
the catalog answering 6.4.0 / 6.2.0 / 502. Everything else came from the
real backend.
- **Modules have no Update cell and no row action.** An app's update
covers the modules it brought (ADR-0130 D2). A module row still opens
the detail sheet, where Disable lives, as before.
- **Out of scope, observed (class a, user-visible truncation):** on the
developer door (`/apps/setup/component/developer/packages`, no `source`)
at a 1400 px viewport, the Actions column is clipped by the table's
overflow. This is unchanged by this PR (that table branch is untouched).
Reach: live screenshot of that URL at 1400x900. Reported to the seat to
file. Dedupe words: packages table actions column clipped, overflow,
Studio packages.
## Verification
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `ef65831e5c` (same tree as head
`53503c6a26`): 71 families derived, all run locally, each exit code
below. `--ran` reconciliation: see details.
- `check-eager-closure-budget` (after `pnpm --filter
'@object-ui/console^...' build` and `pnpm --filter @object-ui/console
build`, lock `VERDICT command-exit 0`): **i18n-locale-en 60.2 KB / 60.5
KB ceiling (headroom 0.4 KB)**; the aggregate eager closure is 1893.2 KB
/ 2431.6 KB. The headroom is the existing headroom: this branch changes
no file under `ui/packages/i18n/src/locales/`.
- `node scripts/pm/overlap-check.mjs
--branch=claude/issue-34722-installed-apps-updates`: `VERDICT clean exit
0` before each push.
- Not run locally, CI-owned: `test:repo`, repo-wide lint, the full
lint-workflow farm. Full dogfood is not owed (no `!` in the title, no
narrowing arm on Clause-②).
<details><summary>Derived gate families, 71 of 71, exit codes</summary>
Run on `ef65831e5c`. `53503c6a26` (the pushed head) is the same tree,
`0607e32a0d`; only the docs commit message was reworded.
- `node scripts/check-adr-0087-registration.mjs --base origin/main` ·
exit 0
- `node scripts/check-adr-0087-registration.mjs --self-test` · exit 0
- `node scripts/check-adr-links.mjs` · exit 0
- `node scripts/check-adr-links.mjs --self-test` · exit 0
- `node scripts/check-changeset-no-major.mjs --base origin/main` · exit
0
- `node scripts/check-closing-keyword-parity.mjs` · exit 0
- `node scripts/check-closing-keyword-parity.mjs --self-test` · exit 0
- `node scripts/check-comment-mask-corpus.mjs` · exit 0
- `node scripts/check-doc-route-spelling.mjs --advisory` · exit 0
- `node scripts/check-doc-route-spelling.mjs --self-test` · exit 0
- `node scripts/check-docs-section-name.mjs` · exit 0
- `node scripts/check-docs-section-name.mjs --self-test` · exit 0
- `node scripts/check-empty-changeset.mjs --base origin/main` · exit 0
- `node scripts/check-empty-changeset.mjs --self-test` · exit 0
- `node scripts/check-sdui-manifest.mjs` · exit 0
- `node scripts/check-sdui-manifest.mjs --self-test` · exit 0
- `node scripts/check-section-landing-index.mjs` · exit 0
- `node scripts/check-section-landing-index.mjs --self-test` · exit 0
- `node scripts/ci/plan-test-core-shards.mjs --self-test` · exit 0
- `node scripts/ci/snapshot-next.mjs --self-test` · exit 0
- `node scripts/pm/check-governed-queue-guard.mjs --self-test` · exit 0
- `node scripts/pm/release-rehearsal-clone.mjs --self-test` · exit 0
- `node scripts/release-pending-publish.mjs --self-test` · exit 0
- `pnpm --dir ui exec vitest run scripts/` · exit 0
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions` ·
exit 0
- `pnpm --filter @objectstack/lint run check:doc-security-posture` ·
exit 0
- `pnpm --filter @objectstack/spec run check:docs` · exit 0
- `pnpm --filter @objectstack/spec run check:duration-unit-keys` · exit
0
- `pnpm --filter @objectstack/spec run check:empty-state` · exit 0
- `pnpm --filter @objectstack/spec run check:error-code-provenance` ·
exit 0
- `pnpm --filter @objectstack/spec run check:liveness` · exit 0
- `pnpm --filter @objectstack/spec run check:skill-examples` · exit 0
- `pnpm --filter @objectstack/spec run check:strictness-ledger` · exit 0
- `pnpm --filter @objectstack/spec run check:variant-docs` · exit 0
- `pnpm --filter @objectstack/spec run check:yaml-examples` · exit 0
- `pnpm check:adr-anchors` · exit 0
- `pnpm check:changeset-gate-self-tests` · exit 0
- `pnpm check:ci-filter-parity` · exit 0
- `pnpm check:closed-ceremony-text` · exit 0
- `pnpm check:corpus-claim-drift` · exit 0
- `pnpm check:cross-package-test-inputs` · exit 0
- `pnpm check:dispatcher-error-vocabulary` · exit 0
- `pnpm check:doc-anchors` · exit 0
- `pnpm check:doc-authoring` · exit 0
- `pnpm check:doc-frontmatter` · exit 0
- `pnpm check:docs-audit-scope` · exit 0
- `pnpm check:docs-redirects` · exit 0
- `pnpm check:docs-single-h1` · exit 0
- `pnpm check:docs-spec-enumerations` · exit 0
- `pnpm check:docs-transcript-drift` · exit 0
- `pnpm check:driver-memory-census` · exit 0
- `pnpm check:engine-double-contract` · exit 0
- `pnpm check:gitlink-declared` · exit 0
- `pnpm check:nul-bytes` · exit 0
- `pnpm check:published-files` · exit 0
- `pnpm check:published-readme-links` · exit 0
- `pnpm check:query-options-erasure` · exit 0
- `pnpm check:react-page-adapter-contract` · exit 0
- `pnpm check:refd-timer-probe` · exit 0
- `pnpm check:registry-log-declared` · exit 0
- `pnpm check:rest-log-spy-declared` · exit 0
- `pnpm check:role-word` · exit 0
- `pnpm check:skill-identifier-liveness` · exit 0
- `pnpm check:test-source-alias` · exit 0
- `pnpm check:tier-file-adoption` · exit 0
- `pnpm check:type-check-coverage` · exit 0
- `pnpm check:type-check-debt` · exit 0
- `pnpm check:undeclared-dep-imports` · exit 0
- `pnpm check:vendor-version-stamps` · exit 0
- `pnpm check:watch-hint-literal` · exit 0
- `pnpm check:where-matcher` · exit 0
`pnpm --dir ui exec vitest run scripts/` (under the lock): Test Files
171 passed, 2 skipped (173); Tests 5077 passed, 2 skipped (5079).
`dispatch-gates --ran`: "Run reconciliation — 71 derived, 71 run, 0
NOT-MEASURED, 0 UNRUN", exit 0.
`node scripts/check-nul-bytes.mjs`: OK, exit 0.
</details>
<details><summary>Live readings (Chromium, fixture runtime plus Console
dev server)</summary>
Fixture: `examples/app-multi-package`, booted with `objectstack dev
--seed-admin --fresh`; Console vite dev server proxied to it. These
readings were taken from the working tree that was committed as
`8fc8e215a5` 46 s later, with the Console serving source. `ef65831e5c`
adds docs only.
- A1, update available: cell text "Update available → v6.4.0" +
"Upgrade"; href
`/apps/com.objectstack.setup/system/marketplace/pkg_multi_core`; the
click lands on that path; summary "1 app has a newer version in the
marketplace."; one catalog read,
`/api/v1/marketplace/packages/pkg_multi_core`; headers Name, Version,
Status, Source, Update, Actions; Import 0, New Package 0, platform
switch 0, Source chip 0.
- A2, up to date (catalog 6.2.0): badge 0, summary 0, unavailable note
0.
- A3, catalog 502: app row listed 1; note "Update information can’t be
read from the marketplace right now, so this list can’t say which apps
have a newer version."; badge 0.
- A4, folding: orders row 0 before, toggle aria-expanded "false"; after
the click, orders row 1 with `data-module-of="com.example.multi.core"`.
- Developer door (same component without `source`): Import 1, New
Package 1, platform switch 1; headers Name, ID, Version, Scope, Status,
Source, Actions; orders row 1; catalog reads 0.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziunkXbDT7wUWqfmWz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 4fb8790 commit d656d62
8 files changed
Lines changed: 913 additions & 12 deletions
File tree
- .changeset
- content/docs/deployment
- ui/packages
- app-shell/src
- console/marketplace/__tests__
- views/metadata-admin
- 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
299 | | - | |
| 301 | + | |
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| |||
155 | 177 | | |
156 | 178 | | |
157 | 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 | + | |
158 | 218 | | |
159 | 219 | | |
160 | 220 | | |
161 | | - | |
| 221 | + | |
162 | 222 | | |
163 | 223 | | |
164 | 224 | | |
| |||
218 | 278 | | |
219 | 279 | | |
220 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
221 | 298 | | |
222 | 299 | | |
223 | 300 | | |
| |||
0 commit comments