Skip to content

Commit c8d4b90

Browse files
feat(console): Setup gets one Packages entry, the package list's administration face; Installed Apps retires (#36933)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwB9qsP28anD5tWRUHq8j1xSU)_ Fixes #36834 Clause-②: no Metadata-protocol: none ## 维护者速读 - 管理员在「系统设置 → 应用」里多了一个「软件包」入口,能看到本系统装的全部软件包,可启用、停用、删除;原来的「已安装应用」入口去掉了。 - 落实你在软件包入口这张卡上的裁定:设置里只做管理,设计仍在 Studio。 - 出错时管理员在设置里看不到或误操作软件包;改动只在界面和导航,撤回这次合并即可恢复原样。 - 无 ## What changes **The face selector: the URL parameter `face=admin`.** Setup's entry is a component nav item with `params: { face: 'admin' }`, and the sidebar sends a component entry's `params` as the query string, so the entry opens `.../component/developer/packages?face=admin`. With no `face`, the page is the development surface exactly as before (Studio's "All packages" link and each package card's Manage). An old address with `source=marketplace` and no `face` (bookmarks, and the marketplace page's "Installed" button) also reads as the administration face. A `face` value other than `admin`, or a repeated `face`, is refused by name (`PACKAGES_FACE_UNKNOWN` / `PACKAGES_FACE_REPEATED`), the same way the page already refuses a bad `source`. No new page, widget, hook or route. **The gate: `requiredPermissions: ['manage_platform_settings']`**, the pattern Setup's Settings hub (`nav_settings_hub`) and Public Forms use. The server still checks every package write with `manage_metadata`. - **Setup → Apps → Packages (`nav_packages`).** `@objectstack/platform-objects` contributes the one entry to `group_apps`, unfiltered, translated in all 11 Setup locales (zh-CN: 软件包). - **The administration face**, built from the old Installed Apps view and extended to every source: - It lists every package of every source, with modules folded under their app. Platform packages (system / cloud) stay hidden. - It has a Source filter (All / Code / Marketplace / Authored) that writes `?source=` and keeps `face`. Only marketplace rows are asked about updates. - Its one header action is New Package. A package created there opens in Studio at `/studio/ID/data`, the address the Studio landing's package card opens (`BuilderLanding`'s `open`). - The detail sheet offers View info, Disable / Enable and Delete, and Delete keeps the keep-data choice. An authored package also gets "Open in Studio". - Not offered: Import, Edit, Publish, Revert, Export, Duplicate, Adopt loose items, and the pending changes' Publish / Discard. - **Installed Apps retires.** `MARKETPLACE_INSTALLED_UI_BUNDLE` no longer carries `nav_marketplace_installed`. It stays exported under its id, with `navigationContributions: []`, so cloud's import keeps compiling and registering it. The entry's labels leave the Setup bundle and its id joins the dead-key tombstone. - The comments that cited ruling 甲 as the reason Setup had no entry (`setup-nav.contributions.ts`, `BuilderLanding.tsx`, `marketplace-ui.ts`) now cite this card's amendment. ### Readers of `nav_marketplace_installed` in this repo | Reader | What happened | |---|---| | `packages/cloud-connection/src/marketplace-ui.ts` | entry removed; the bundle is now **empty** (no pages, no contributions) | | `packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts` | restated as an absence pin | | `packages/platform-objects/src/apps/setup-nav.contributions.ts` | comment rewritten | | 11 Setup translation files + 10 `*.source-hashes.ts` | key replaced by `nav_packages` | | `translations/setup-nav-dead-key-tombstone.test.ts` | id added as dead | | `packages/cloud-connection/CHANGELOG.md`, `packages/platform-objects/CHANGELOG.md` | release-owned history, untouched | | `docs/qa/platform-checklist/areas/platform-core.json` | stale checklist text naming the entry; outside this card's file surface, see Acceptance notes | Code that imports `MARKETPLACE_INSTALLED_UI_BUNDLE` still compiles, unchanged: `packages/cli/scripts/check-app-nav-i18n.mjs`, `packages/qa/dogfood/test/platform-app-object-entry-views.test.ts`, and the package index export. ### Read first (by risk) 1. `ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx`. Look at the `authoring` switch in `PackageDetailSheet`, the `adminFace` branches in the header and toolbar, and `onCreated`. 2. `ui/packages/app-shell/src/views/metadata-admin/packageSource.ts`, `readPackagesFace`, which reads the legacy `source=marketplace` address as the admin face. 3. `packages/cloud-connection/src/marketplace-ui.ts`. The bundle is now empty but keeps its id. ### Two-minute check Boot any example as admin and open Setup. Under 应用 there are 软件包 and 浏览应用市场, and no 已安装应用. Click 软件包: the list shows the 来源 filter and a single 新建软件包 button, with no 导入 button. ## Why The maintainer's ruling on #36834 amends ruling 甲 of #25098. Setup is where an administrator sees what is installed and turns it on, off or away. Designing a package stays in Studio. The marketplace-only Installed Apps entry was a narrower copy of the same list, so it merges into the new entry's Source filter. ## Verification Live on `examples/app-showcase` (`objectstack dev --seed-admin`, own port and file DB), signed in as `admin@objectos.ai`. The console is the `ui/apps/console` Vite dev server on the current `ui/` source, proxied to that backend, and was driven with Playwright in zh-CN. - **Served nav** (`GET /api/v1/meta/app?id=setup`): one `nav_packages`, with `componentRef: developer:packages`, `params: {face: admin}` and `requiredPermissions: [manage_platform_settings]`. No `nav_marketplace_installed` appears in the response. - **Setup → 应用 → 软件包** opens `?face=admin`. It shows the heading 软件包, the admin description, a 新建软件包 button, no 导入 button, and rows of every source (代码 and 自建). - **Filter**: 应用市场 sets `&source=marketplace` and shows the empty-marketplace state, because the showcase has no marketplace installs. 代码 and 自建 each narrow the list. 全部 clears `source` and stays on `face=admin`. - **Old link**: `/apps/setup/component/developer/packages?source=marketplace` opens the admin face, with the 应用市场 chip on and 新建软件包 present. - **New package**: 新建软件包, enter a name, save. The page lands on `/studio/com.default.field-service/data` and shows the toast 已创建软件包「Field Service」. - **Detail (authored package)**: the sheet's buttons are exactly 查看信息 / 禁用 / 删除软件包 / 关闭, plus the link 在 Studio 中打开 to `/studio/com.default.dogfood-alpha/data`. These are absent: 编辑, 发布, 还原, 导出, 复制, 导入, 放弃, 收编散落项. - **Disable, then enable**: after 禁用 and confirm, the sheet shows 软件包已禁用。, the status reads 已禁用, and the button turns to 启用. After 启用, it shows 软件包已启用。 and the button turns back to 禁用. - **Delete keeping data**: `DELETE /api/v1/packages/com.default.dogfood-alpha?keepData=true` returned 200. **Delete everything**: `DELETE /api/v1/packages/com.default.dogfood-beta` returned 200. Each time the sheet closed and the row left the list. - **Studio unchanged**: its 全部软件包 link opens the page with no `face`, with no Source picker and with the 导入 and 新建软件包 buttons. The same package's sheet keeps 查看信息 / 编辑 / 发布 / 还原 / 禁用 / 导出 / 复制 / 收编散落项 / 删除软件包. Screenshots (zh), in the project files under `issue-36834/`: - `setup-packages-list-zh.png`: the Setup list - `setup-packages-detail-zh.png`: the Setup detail sheet of an authored package - `setup-packages-detail-code-zh.png`: a code package's sheet (View info only; code packages are read-only) - `setup-packages-disabled-zh.png`: the feedback after a disable - `setup-packages-marketplace-zh.png`: the list filtered to marketplace - `setup-packages-delete-keepdata-zh.png`: the delete dialog with the keep-data choice - `setup-new-package-lands-in-studio-zh.png`: New Package landed in Studio - `studio-packages-detail-unchanged-zh.png`: Studio's sheet with every action ## Tests These ran on head `bb10cd3592`. <details><summary>Package tests and type-checks</summary> - `@objectstack/platform-objects`: `pnpm test` gave 125 files / 2138 tests passed; `typecheck` passed. - `@objectstack/cloud-connection`: `pnpm test` gave 94 files / 1359 tests passed (lock VERDICT command-exit 0); `typecheck` passed. - UI, `pnpm --dir ui exec vitest run` over `metadata-admin/PackagesPage*` and `studio-design/BuilderLanding*`: Test Files 33 passed (33), Tests 284 passed (284) (lock VERDICT command-exit 0). - `@object-ui/i18n` tests: 109 files passed. `type-check` passed for `@object-ui/app-shell` and `@object-ui/i18n`. - `pnpm check:app-nav-i18n`: OK, with 14 contributors and 11 locales. Setup has 62 merged nav ids, each labelled in every locale. </details> <details><summary>Ablation (one-off, not kept)</summary> After committing the fix, `const authoring = face !== 'admin';` in `PackageDetailSheet` was replaced with `const authoring = true;`. The replacement was made through `scripts/ablation-replace.mjs`, with an anchor-hit check and a trap restore. The test "the detail sheet offers View info, Disable and Delete…" went red (1 failed). After the restore, the blob matched HEAD and `git diff HEAD` was empty. </details> <details><summary>Derived gate families</summary> `node scripts/pm/dispatch-gates.mjs --ran` reported: 78 derived, 78 run, 0 NOT-MEASURED, a derived zero, because every run recorded an exit code and none was 3. CI runs the rest of the farm. The local union ran on `bb10cd3592`. All 77 `--commands` families and `pnpm --dir ui exec vitest run scripts/` (Test Files 172 passed, 2 skipped; Tests 5127 passed) exited 0. Two of them needed a retry: - `check:type-check-debt` first returned queue-timeout 99, because a sibling run held the verify lock. The retry under the same slot exited 0. - `check:dual-build-cjs-loads` was red on the first pass. The cause was a half-built local `@objectstack/organizations` dist, a package outside this diff. After rebuilding it, the gate exited 0 with 124 entry points. Changeset families: `check-adr-0087-registration`, `check-changeset-no-major`, `check-empty-changeset` and `check:changeset-gate-self-tests` all exited 0. </details> - **Fix round 1 (head 35bdb5b).** CI's Test Core (1/10) was red at bb10cd3 in `packages/cli/test/connect-agent-both-halves-wire.pin.test.ts` (35 expected, 37 got). The CLI composition has no marketplace, so on main `group_apps` was empty there and got collapsed; `nav_packages` makes it served again. The two new served Setup ids are `group_apps` and `nav_packages`. The pin now restates the exact count 37 in both tests, with a history line citing #36834, and asserts that `group_apps`'s children equal `['nav_packages']`. Local runs: the four Setup pins 4/4 files and 10/10 tests; platform-objects 125 files and 2138 tests. Delta comment 7128676644. That test file is outside the claim's file surface, and the edit was directed by the fix-round order. - Open draft PR #34223 restates the same count in that pin. It already conflicts with main on its own; whichever lands second re-counts. ## Acceptance notes - **Delete's feedback** is the sheet closing and the row leaving the list. Both faces already behaved this way, and no success notice was added, because a notice would change the development face too. Disable and Enable give an inline notice. - **A code package's sheet** offers View info only. Code packages are read-only, as they were before, so Disable and Delete appear on authored and marketplace packages. - **Stale QA checklist text.** `docs/qa/platform-checklist/areas/platform-core.json` (around lines 2393, 2404 and 2441) still describes the retired Installed Apps entry. It is outside this card's file surface and is left for the checklist owner. - **Cloud.** The cloud repository's import of `MARKETPLACE_INSTALLED_UI_BUNDLE` (cloud PR #3488) keeps compiling. The bundle now contributes nothing, so whether cloud drops the import is cloud's call. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (Not run locally: the repo-wide lint is CI's run.) - [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. --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU)_ <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzhpykmQZe1yMupC2CU --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 91bb024 commit c8d4b90

38 files changed

Lines changed: 861 additions & 298 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
'@objectstack/cloud-connection': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/i18n': patch
6+
---
7+
8+
feat(console): Setup gets one Packages entry, the package list's administration face; the Installed Apps entry retires
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
The maintainer's ruling on objectstack#36834 amends ruling 甲 of #25098: Setup lists what is installed, with the administration actions only, and the marketplace-only "Installed Apps" entry merges into it.
14+
15+
- **Setup → Apps → Packages (`nav_packages`).** `@objectstack/platform-objects` contributes one entry to Setup's `group_apps`, gated on `manage_platform_settings` like Setup's other administration entries. It opens the console's `developer:packages` page with `params: { face: 'admin' }`, so the URL carries `?face=admin`. Its label is translated in every locale the Setup bundle carries.
16+
- **The page's administration face.** With `?face=admin`, the Packages page lists every package of every source, with modules folded under their app. It shows the Name, Version, Status, Source and Update columns, plus a Source filter (All, Code, Marketplace, Authored) that writes `?source=`. Its only header action is New Package, and a package created there opens in Studio, on the address the Studio landing's package card opens. The detail sheet offers View info, Disable / Enable and Delete (keeping the choice to keep the data), plus "Open in Studio" on an authored package. Import, Edit, Publish, Revert, Export, Duplicate, Adopt loose items and the pending changes' Publish and Discard are not offered there. An unknown or repeated `face` value is refused by name. With no `face`, the page is unchanged: Studio's "All packages" link and each package card's Manage keep every action.
17+
- **Installed Apps retires.** `MARKETPLACE_INSTALLED_UI_BUNDLE` (`@objectstack/cloud-connection`) no longer carries `nav_marketplace_installed`. The bundle stays exported under its id, with an empty `navigationContributions`, so a host that imports and registers it keeps working. The entry's labels are removed from the Setup translation bundle, and its id joins the dead-key tombstone. A bookmarked `/apps/setup/component/developer/packages?source=marketplace`, which the marketplace page's "Installed" button also opens, still shows the list filtered to marketplace installs, on the administration face.

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,9 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
262262
expect(groupChildren(setupAllowed.body?.item, 'group_overview'))
263263
.toEqual(['nav_system_overview', 'nav_connect_agent']);
264264
// The Setup tree the platform admin is served BY THIS COMPOSITION: 9
265-
// authored groups less `group_approvals`, `group_integrations` and
266-
// `group_apps`, which nothing in it contributes into and the filter
267-
// collapses, plus the 27 entries `SETUP_NAV_CONTRIBUTIONS` carries,
268-
// plus the MCP one.
265+
// authored groups less `group_approvals` and `group_integrations`,
266+
// which nothing in it contributes into and the filter collapses, plus
267+
// the 29 entries `SETUP_NAV_CONTRIBUTIONS` carries, plus the MCP one.
269268
// (25 until #25098 moved the unfiltered Packages entry to Studio; 24
270269
// until #30204 removed the Feature Flags entry with its namespace; 32
271270
// until #30895 moved the MCP entry out of `group_integrations`, the
@@ -278,13 +277,18 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
278277
// Units of Measure entry, `nav_units_of_measure`, joined Configuration
279278
// (#35488); 32 until the working-calendar pair, `nav_work_calendars`
280279
// and `nav_work_calendar_exceptions`, joined it, ADR-0157; 34 until
281-
// the public forms entry, `nav_public_forms`, joined it, #36444.)
280+
// the public forms entry, `nav_public_forms`, joined it, #36444; 35
281+
// until objectstack#36834 gave Setup its Packages entry,
282+
// `nav_packages`, in `group_apps`, so that group is served again:
283+
// +2, `group_apps` and `nav_packages`.)
282284
// `nav_settings_branding` is not among them, and not because of a
283285
// tenancy wall (this harness boots none): since #24766 it is
284286
// contributed by `@objectstack/service-settings` together with the
285287
// `branding` namespace, offered only where no organization wall stands,
286288
// and this harness composes platform-objects and the MCP bundle alone.
287-
expect(allowedIds).toHaveLength(35);
289+
expect(allowedIds).toHaveLength(37);
290+
expect(allowedIds).toContain('nav_packages');
291+
expect(groupChildren(setupAllowed.body?.item, 'group_apps')).toEqual(['nav_packages']);
288292
expect(allowedIds).toContain('nav_public_forms');
289293
expect(allowedIds).toContain('nav_work_calendars');
290294
expect(allowedIds).toContain('nav_work_calendar_exceptions');
@@ -314,8 +318,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
314318
expect(withAccountHalf.statusCode).toBe(200);
315319
expect(withoutAccountHalf.statusCode).toBe(200);
316320
expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item));
317-
// 35: the composition the count in the test above states.
318-
expect(navIds(withAccountHalf.body?.item)).toHaveLength(35);
321+
// 37: the composition the count in the test above states.
322+
expect(navIds(withAccountHalf.body?.item)).toHaveLength(37);
319323

320324
// The mechanism behind the invariance, asserted rather than assumed:
321325
// the bundle aims exactly one contribution at `setup` and one at

‎packages/cloud-connection/src/marketplace-install-local-plugin.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,8 +2023,9 @@ export class MarketplaceInstallLocalPlugin implements Plugin {
20232023
// misreading an orphaned marketplace install as user code.
20242024
this.captureBootUserCodeIds(ctx);
20252025

2026-
// Plugin-owned Setup nav (cloud ADR-0009): "Installed Apps"
2027-
// ships WITH the local-install capability.
2026+
// Plugin-owned Setup UI (cloud ADR-0009). The bundle carries no
2027+
// nav entry since objectstack#36834 (Setup's own Packages entry
2028+
// lists what is installed); it is still registered under its id.
20282029
try {
20292030
const manifest = ctx.getService<{ register(m: any): void }>('manifest');
20302031
manifest?.register?.(MARKETPLACE_INSTALLED_UI_BUNDLE);

‎packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts‎

Lines changed: 51 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

33
/**
4-
* #23933 — the install-local plugin's "Installed Apps" entry opens Setup →
5-
* Packages filtered to Source = marketplace (ruling B on #23892, record
6-
* 6216295104), and the plugin no longer ships a page of its own.
4+
* objectstack#36834 — the install-local plugin's "Installed Apps" entry
5+
* (`nav_marketplace_installed`) is retired: Setup's own "Packages" entry
6+
* (`nav_packages`, `@objectstack/platform-objects`) lists every installed
7+
* package on the list's administration face, and the page's Source filter
8+
* narrows it to marketplace installs (the maintainer's ruling 「合并,只留软件包」).
79
*
810
* ## What this file pins
911
*
@@ -13,30 +15,21 @@
1315
* `navigationContributions` into the app they name — the merge
1416
* `GET /api/v1/meta/app/setup` serves:
1517
*
16-
* - plugin present: Setup's `group_apps` carries `nav_marketplace_installed`,
17-
* a `component` entry on `developer:packages` (the component Setup's own
18-
* "Packages" entry opens) with `params: { source: 'marketplace' }`, label
19-
* and icon unchanged; and no `marketplace_installed` page is served;
20-
* - plugin absent: the same composition carries no such entry — the entry
21-
* lives and dies with the capability (cloud ADR-0009).
18+
* - plugin present: the plugin still registers `MARKETPLACE_INSTALLED_UI_BUNDLE`
19+
* under its id, and Setup's `group_apps` carries no `nav_marketplace_installed`
20+
* and no entry onto `developer:packages` from this package; no
21+
* `marketplace_installed` page is served either (retired with #23933);
22+
* - plugin absent: the same composition carries neither;
23+
* - the bundle: still exported and importable, its id unchanged, with an
24+
* empty `navigationContributions` and no `pages` — hosted tenants import and
25+
* register it, so the export is the compatibility surface, not the entry.
2226
*
23-
* The page listing is read with a positive control: the Cloud Connection UI
24-
* bundle registered beside it serves its `cloud_connection_settings` page
25-
* through the same read, so "no `marketplace_installed`" is a reading of a
26-
* listing that does carry plugin pages, not of an empty one.
27-
*
28-
* ## The filter spelling is objectui's, copied — not derived here
29-
*
30-
* `source` and `marketplace` are the spelling objectui#12675 published, read at
31-
* the commit objectstack's `.objectui-sha` pins (`5e15928b4631`, which carries
32-
* that card's merge `9d857c998c` as an ancestor): `packageSource.ts` declares
33-
* `PACKAGES_SOURCE_PARAM = 'source'` and `PACKAGE_SOURCES = ['code',
34-
* 'marketplace', 'authored']`, and its Packages page refuses any other value by
35-
* name. The console's sidebar sends a `component` entry's `params` as the
36-
* query string (`NavigationRenderer`'s `resolveHref`), so this entry opens
37-
* `/apps/APP/component/developer/packages?source=marketplace`. A different
38-
* spelling here would open a refusal, not a filtered list — this pin is what
39-
* holds the two repositories' halves to one word.
27+
* Every absence is read with a positive control: Browse Marketplace
28+
* (`MARKETPLACE_BROWSE_UI_BUNDLE`, registered beside it) lands in the same
29+
* `group_apps` through the same read, and the Cloud Connection UI bundle serves
30+
* its `cloud_connection_settings` page through the same page listing, so "no
31+
* entry" is a reading of a group that does carry plugin entries, not of an empty
32+
* one.
4033
*/
4134

4235
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
@@ -55,15 +48,9 @@ import { installerAuthService, withInstallerGrants } from './install-local-princ
5548

5649
type Bag = Record<string, any>;
5750

58-
/** The entry as objectui#12675 published it for a Setup nav item. */
59-
const FILTERED_PACKAGES_ENTRY = {
60-
id: 'nav_marketplace_installed',
61-
type: 'component',
62-
label: 'Installed Apps',
63-
componentRef: 'developer:packages',
64-
params: { source: 'marketplace' },
65-
icon: 'package-check',
66-
};
51+
/** The retired entry's id, and the component every package-list entry opens. */
52+
const RETIRED_ID = 'nav_marketplace_installed';
53+
const PACKAGES_REF = 'developer:packages';
6754

6855
/**
6956
* A Setup shell with the group anchor the entry lands in, and the one the Cloud
@@ -137,6 +124,8 @@ async function compose(withPlugin: boolean) {
137124
manifest.register(structuredClone(CLOUD_CONNECTION_UI_BUNDLE));
138125
manifest.register(structuredClone(MARKETPLACE_BROWSE_UI_BUNDLE));
139126
const protocol = kernel.getService<any>('protocol');
127+
/** The manifest ids the plugin itself registered through the `manifest` service. */
128+
const registered: string[] = [];
140129

141130
if (withPlugin) {
142131
const routes = new Map<string, unknown>();
@@ -147,7 +136,12 @@ async function compose(withPlugin: boolean) {
147136
};
148137
const hooks = new Map<string, () => Promise<void>>();
149138
const services: Record<string, unknown> = {
150-
manifest,
139+
manifest: {
140+
register(m: { id?: string }) {
141+
registered.push(String(m?.id));
142+
manifest.register(m);
143+
},
144+
},
151145
protocol,
152146
metadata: kernel.getService('metadata'),
153147
auth: installerAuthService(),
@@ -170,7 +164,7 @@ async function compose(withPlugin: boolean) {
170164
await plugin.start(ctx as never);
171165
await hooks.get('kernel:ready')?.();
172166
}
173-
return { protocol };
167+
return { protocol, registered };
174168
}
175169

176170
/** Setup's `group_apps` entries, as the metadata protocol serves the merged app. */
@@ -189,22 +183,19 @@ async function servedPageNames(protocol: any): Promise<string[]> {
189183
return items.map((it) => it?.name).filter((n): n is string => typeof n === 'string');
190184
}
191185

192-
describe('#23933 — "Installed Apps" opens Setup → Packages filtered to Source = marketplace', () => {
193-
it('plugin present: the served entry is the filtered Packages component, label and icon unchanged', async () => {
194-
const { protocol } = await compose(true);
195-
const entries = (await setupAppsGroup(protocol)).filter((i) => i?.id === 'nav_marketplace_installed');
196-
expect(entries).toHaveLength(1);
197-
const entry = entries[0]!;
198-
expect({
199-
id: entry.id,
200-
type: entry.type,
201-
label: entry.label,
202-
componentRef: entry.componentRef,
203-
params: entry.params,
204-
icon: entry.icon,
205-
}).toEqual(FILTERED_PACKAGES_ENTRY);
206-
// The page target is gone from the entry, not carried beside the new one.
207-
expect(entry.pageName).toBeUndefined();
186+
describe('#36834 — "Installed Apps" is retired; Setup → Packages lists what is installed', () => {
187+
it('plugin present: the bundle is still registered, and Setup carries no Installed Apps entry', async () => {
188+
const { protocol, registered } = await compose(true);
189+
expect(registered).toContain(MARKETPLACE_INSTALLED_UI_BUNDLE.id);
190+
191+
const items = await setupAppsGroup(protocol);
192+
const ids = items.map((i) => i?.id);
193+
// Control: the read reaches the group's plugin-contributed entries.
194+
expect(ids).toContain('nav_marketplace_browse');
195+
expect(ids).not.toContain(RETIRED_ID);
196+
// No marketplace-filtered (or any) package-list entry from this package:
197+
// Setup's one door to the list is platform-objects' `nav_packages`.
198+
expect(items.filter((i) => i?.componentRef === PACKAGES_REF)).toEqual([]);
208199
});
209200

210201
it('plugin present: no `marketplace_installed` page is served (control: the Cloud Connection page is)', async () => {
@@ -215,18 +206,20 @@ describe('#23933 — "Installed Apps" opens Setup → Packages filtered to Sourc
215206
});
216207

217208
it('plugin absent: the same composition carries no Installed Apps entry', async () => {
218-
const { protocol } = await compose(false);
209+
const { protocol, registered } = await compose(false);
210+
expect(registered).toEqual([]);
219211
const ids = (await setupAppsGroup(protocol)).map((i) => i?.id);
220-
expect(ids).not.toContain('nav_marketplace_installed');
212+
expect(ids).not.toContain(RETIRED_ID);
221213
// Control: the read reaches the group's plugin-contributed entries.
222214
// (Browse Marketplace, not Cloud Connection: that entry sits in
223215
// `group_integrations` since ruling 甲 on #25097.)
224216
expect(ids).toContain('nav_marketplace_browse');
225217
});
226218

227-
it('the bundle ships the entry and no page', () => {
219+
it('the bundle stays exported under its id, with no nav entry and no page', () => {
220+
expect(MARKETPLACE_INSTALLED_UI_BUNDLE.id).toBe('com.objectstack.cloud-connection.marketplace-installed-ui');
228221
expect(Object.keys(MARKETPLACE_INSTALLED_UI_BUNDLE)).not.toContain('pages');
229-
const items = MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions.flatMap((c) => c.items);
230-
expect(items).toEqual([FILTERED_PACKAGES_ENTRY]);
222+
// An array, so a host that walks it keeps working; empty, so it lands nothing.
223+
expect(MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions).toEqual([]);
231224
});
232225
});

0 commit comments

Comments
 (0)