From 6925041ce61376496d2e22637387a0ae80e46271 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 07:49:34 +0000 Subject: [PATCH 1/6] feat(console): Setup gets one Packages entry on the package list's administration face; Installed Apps retires Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- .../src/marketplace-install-local-plugin.ts | 5 +- ...marketplace-installed-ui-entry.pin.test.ts | 109 ++++---- .../cloud-connection/src/marketplace-ui.ts | 75 +++-- .../src/apps/setup-nav.contributions.ts | 66 +++-- .../src/apps/setup-packages-door.test.ts | 96 +++++-- .../src/apps/translations/ar.source-hashes.ts | 2 +- .../src/apps/translations/ar.ts | 2 +- .../src/apps/translations/de.source-hashes.ts | 2 +- .../src/apps/translations/de.ts | 2 +- .../src/apps/translations/en.ts | 2 +- .../apps/translations/es-ES.source-hashes.ts | 2 +- .../src/apps/translations/es-ES.ts | 2 +- .../src/apps/translations/fr.source-hashes.ts | 2 +- .../src/apps/translations/fr.ts | 2 +- .../apps/translations/ja-JP.source-hashes.ts | 2 +- .../src/apps/translations/ja-JP.ts | 2 +- .../src/apps/translations/ko.source-hashes.ts | 2 +- .../src/apps/translations/ko.ts | 2 +- .../apps/translations/pt-BR.source-hashes.ts | 2 +- .../src/apps/translations/pt-BR.ts | 2 +- .../src/apps/translations/ru.source-hashes.ts | 2 +- .../src/apps/translations/ru.ts | 2 +- .../setup-nav-dead-key-tombstone.test.ts | 10 + .../apps/translations/zh-CN.source-hashes.ts | 2 +- .../src/apps/translations/zh-CN.ts | 2 +- .../translations/zh-Hant.source-hashes.ts | 2 +- .../src/apps/translations/zh-Hant.ts | 2 +- .../src/views/metadata-admin/PackagesPage.tsx | 258 +++++++++++++----- .../src/views/metadata-admin/packageSource.ts | 57 +++- .../views/studio-design/BuilderLanding.tsx | 23 +- ui/packages/i18n/src/namespaces/studio/en.ts | 7 +- ui/packages/i18n/src/namespaces/studio/zh.ts | 7 +- 32 files changed, 497 insertions(+), 258 deletions(-) diff --git a/packages/cloud-connection/src/marketplace-install-local-plugin.ts b/packages/cloud-connection/src/marketplace-install-local-plugin.ts index 14b9f286e4a..a80fe1d90d6 100644 --- a/packages/cloud-connection/src/marketplace-install-local-plugin.ts +++ b/packages/cloud-connection/src/marketplace-install-local-plugin.ts @@ -2023,8 +2023,9 @@ export class MarketplaceInstallLocalPlugin implements Plugin { // misreading an orphaned marketplace install as user code. this.captureBootUserCodeIds(ctx); - // Plugin-owned Setup nav (cloud ADR-0009): "Installed Apps" - // ships WITH the local-install capability. + // Plugin-owned Setup UI (cloud ADR-0009). The bundle carries no + // nav entry since objectstack#36834 (Setup's own Packages entry + // lists what is installed); it is still registered under its id. try { const manifest = ctx.getService<{ register(m: any): void }>('manifest'); manifest?.register?.(MARKETPLACE_INSTALLED_UI_BUNDLE); diff --git a/packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts b/packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts index 3d2234e82fb..656605cc780 100644 --- a/packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts +++ b/packages/cloud-connection/src/marketplace-installed-ui-entry.pin.test.ts @@ -1,9 +1,11 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. /** - * #23933 — the install-local plugin's "Installed Apps" entry opens Setup → - * Packages filtered to Source = marketplace (ruling B on #23892, record - * 6216295104), and the plugin no longer ships a page of its own. + * objectstack#36834 — the install-local plugin's "Installed Apps" entry + * (`nav_marketplace_installed`) is retired: Setup's own "Packages" entry + * (`nav_packages`, `@objectstack/platform-objects`) lists every installed + * package on the list's administration face, and the page's Source filter + * narrows it to marketplace installs (the maintainer's ruling 「合并,只留软件包」). * * ## What this file pins * @@ -13,30 +15,21 @@ * `navigationContributions` into the app they name — the merge * `GET /api/v1/meta/app/setup` serves: * - * - plugin present: Setup's `group_apps` carries `nav_marketplace_installed`, - * a `component` entry on `developer:packages` (the component Setup's own - * "Packages" entry opens) with `params: { source: 'marketplace' }`, label - * and icon unchanged; and no `marketplace_installed` page is served; - * - plugin absent: the same composition carries no such entry — the entry - * lives and dies with the capability (cloud ADR-0009). + * - plugin present: the plugin still registers `MARKETPLACE_INSTALLED_UI_BUNDLE` + * under its id, and Setup's `group_apps` carries no `nav_marketplace_installed` + * and no entry onto `developer:packages` from this package; no + * `marketplace_installed` page is served either (retired with #23933); + * - plugin absent: the same composition carries neither; + * - the bundle: still exported and importable, its id unchanged, with an + * empty `navigationContributions` and no `pages` — hosted tenants import and + * register it, so the export is the compatibility surface, not the entry. * - * The page listing is read with a positive control: the Cloud Connection UI - * bundle registered beside it serves its `cloud_connection_settings` page - * through the same read, so "no `marketplace_installed`" is a reading of a - * listing that does carry plugin pages, not of an empty one. - * - * ## The filter spelling is objectui's, copied — not derived here - * - * `source` and `marketplace` are the spelling objectui#12675 published, read at - * the commit objectstack's `.objectui-sha` pins (`5e15928b4631`, which carries - * that card's merge `9d857c998c` as an ancestor): `packageSource.ts` declares - * `PACKAGES_SOURCE_PARAM = 'source'` and `PACKAGE_SOURCES = ['code', - * 'marketplace', 'authored']`, and its Packages page refuses any other value by - * name. The console's sidebar sends a `component` entry's `params` as the - * query string (`NavigationRenderer`'s `resolveHref`), so this entry opens - * `/apps/APP/component/developer/packages?source=marketplace`. A different - * spelling here would open a refusal, not a filtered list — this pin is what - * holds the two repositories' halves to one word. + * Every absence is read with a positive control: Browse Marketplace + * (`MARKETPLACE_BROWSE_UI_BUNDLE`, registered beside it) lands in the same + * `group_apps` through the same read, and the Cloud Connection UI bundle serves + * its `cloud_connection_settings` page through the same page listing, so "no + * entry" is a reading of a group that does carry plugin entries, not of an empty + * one. */ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; @@ -55,15 +48,9 @@ import { installerAuthService, withInstallerGrants } from './install-local-princ type Bag = Record; -/** The entry as objectui#12675 published it for a Setup nav item. */ -const FILTERED_PACKAGES_ENTRY = { - id: 'nav_marketplace_installed', - type: 'component', - label: 'Installed Apps', - componentRef: 'developer:packages', - params: { source: 'marketplace' }, - icon: 'package-check', -}; +/** The retired entry's id, and the component every package-list entry opens. */ +const RETIRED_ID = 'nav_marketplace_installed'; +const PACKAGES_REF = 'developer:packages'; /** * 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) { manifest.register(structuredClone(CLOUD_CONNECTION_UI_BUNDLE)); manifest.register(structuredClone(MARKETPLACE_BROWSE_UI_BUNDLE)); const protocol = kernel.getService('protocol'); + /** The manifest ids the plugin itself registered through the `manifest` service. */ + const registered: string[] = []; if (withPlugin) { const routes = new Map(); @@ -147,7 +136,12 @@ async function compose(withPlugin: boolean) { }; const hooks = new Map Promise>(); const services: Record = { - manifest, + manifest: { + register(m: { id?: string }) { + registered.push(String(m?.id)); + manifest.register(m); + }, + }, protocol, metadata: kernel.getService('metadata'), auth: installerAuthService(), @@ -170,7 +164,7 @@ async function compose(withPlugin: boolean) { await plugin.start(ctx as never); await hooks.get('kernel:ready')?.(); } - return { protocol }; + return { protocol, registered }; } /** Setup's `group_apps` entries, as the metadata protocol serves the merged app. */ @@ -189,22 +183,19 @@ async function servedPageNames(protocol: any): Promise { return items.map((it) => it?.name).filter((n): n is string => typeof n === 'string'); } -describe('#23933 — "Installed Apps" opens Setup → Packages filtered to Source = marketplace', () => { - it('plugin present: the served entry is the filtered Packages component, label and icon unchanged', async () => { - const { protocol } = await compose(true); - const entries = (await setupAppsGroup(protocol)).filter((i) => i?.id === 'nav_marketplace_installed'); - expect(entries).toHaveLength(1); - const entry = entries[0]!; - expect({ - id: entry.id, - type: entry.type, - label: entry.label, - componentRef: entry.componentRef, - params: entry.params, - icon: entry.icon, - }).toEqual(FILTERED_PACKAGES_ENTRY); - // The page target is gone from the entry, not carried beside the new one. - expect(entry.pageName).toBeUndefined(); +describe('#36834 — "Installed Apps" is retired; Setup → Packages lists what is installed', () => { + it('plugin present: the bundle is still registered, and Setup carries no Installed Apps entry', async () => { + const { protocol, registered } = await compose(true); + expect(registered).toContain(MARKETPLACE_INSTALLED_UI_BUNDLE.id); + + const items = await setupAppsGroup(protocol); + const ids = items.map((i) => i?.id); + // Control: the read reaches the group's plugin-contributed entries. + expect(ids).toContain('nav_marketplace_browse'); + expect(ids).not.toContain(RETIRED_ID); + // No marketplace-filtered (or any) package-list entry from this package: + // Setup's one door to the list is platform-objects' `nav_packages`. + expect(items.filter((i) => i?.componentRef === PACKAGES_REF)).toEqual([]); }); 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 }); it('plugin absent: the same composition carries no Installed Apps entry', async () => { - const { protocol } = await compose(false); + const { protocol, registered } = await compose(false); + expect(registered).toEqual([]); const ids = (await setupAppsGroup(protocol)).map((i) => i?.id); - expect(ids).not.toContain('nav_marketplace_installed'); + expect(ids).not.toContain(RETIRED_ID); // Control: the read reaches the group's plugin-contributed entries. // (Browse Marketplace, not Cloud Connection: that entry sits in // `group_integrations` since ruling 甲 on #25097.) expect(ids).toContain('nav_marketplace_browse'); }); - it('the bundle ships the entry and no page', () => { + it('the bundle stays exported under its id, with no nav entry and no page', () => { + expect(MARKETPLACE_INSTALLED_UI_BUNDLE.id).toBe('com.objectstack.cloud-connection.marketplace-installed-ui'); expect(Object.keys(MARKETPLACE_INSTALLED_UI_BUNDLE)).not.toContain('pages'); - const items = MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions.flatMap((c) => c.items); - expect(items).toEqual([FILTERED_PACKAGES_ENTRY]); + // An array, so a host that walks it keeps working; empty, so it lands nothing. + expect(MARKETPLACE_INSTALLED_UI_BUNDLE.navigationContributions).toEqual([]); }); }); diff --git a/packages/cloud-connection/src/marketplace-ui.ts b/packages/cloud-connection/src/marketplace-ui.ts index f1e918e05ae..ec2816910a9 100644 --- a/packages/cloud-connection/src/marketplace-ui.ts +++ b/packages/cloud-connection/src/marketplace-ui.ts @@ -10,13 +10,12 @@ * * - no MarketplaceProxyPlugin mounted (`OS_CLOUD_URL=off`) → no * "Browse Marketplace" entry → no dead page. - * - no MarketplaceInstallLocalPlugin → no "Installed Apps" entry. * - * "Browse Marketplace" still points at the console's marketplace route. - * "Installed Apps" opens Setup → Packages filtered to Source = marketplace - * (#23933, ruling B on #23892): Packages is the one list of what is installed, - * and its marketplace rows carry the actions the plugin's own Installed Apps - * page used to (Details, Uninstall). That page is no longer shipped. + * "Browse Marketplace" still points at the console's marketplace route. What + * is installed is listed by Setup → Packages (`nav_packages`, owned by + * `@objectstack/platform-objects`), whose marketplace rows carry the actions + * the plugin's own Installed Apps page used to (Details, Uninstall); the + * marketplace-filtered "Installed Apps" entry retired (objectstack#36834). */ /** "Browse Marketplace" — owned by the browse capability (the proxy). */ @@ -41,47 +40,41 @@ export const MARKETPLACE_BROWSE_UI_BUNDLE = { }; /** - * "Installed Apps" — owned by the local-install capability, registered by - * `MarketplaceInstallLocalPlugin` at `kernel:ready`. + * The local-install capability's Setup UI bundle — registered by + * `MarketplaceInstallLocalPlugin` at `kernel:ready`, and by hosted tenants + * that import it from this package. It now carries NO navigation entry. * - * The entry targets the console's `developer:packages` component (the one - * Setup's own "Packages" entry opens) with `params: { source: 'marketplace' }`. - * The console sends a component entry's `params` as the query string, so the - * entry opens `/apps/APP/component/developer/packages?source=marketplace` — - * the filter objectui#12675 published (`PACKAGES_SOURCE_PARAM = 'source'`, - * values `code` / `marketplace` / `authored`, an unknown value refused by - * name). A `component` entry rather than a `url` one: the target is a - * first-party console component, and the app segment comes from the app the - * entry is rendered in instead of a spelled-out `/apps/setup`. + * Its one entry, "Installed Apps" (`nav_marketplace_installed`), opened the + * console's `developer:packages` list filtered to marketplace installs + * (`params: { source: 'marketplace' }`). It retired with objectstack#36834: + * Setup's own "Packages" entry (`nav_packages`, `@objectstack/platform-objects`' + * Setup nav contributions) opens that same list on its administration face, + * every source, and the page's Source filter narrows it to marketplace + * installs. A bookmarked `?source=marketplace` link still opens the list + * filtered. * - * The bundle carries no page. The `marketplace_installed` page it used to - * ship (cloud ADR-0009 P2a) only redirected to that same filtered view once - * Packages carried the marketplace row actions, so it was retired with the - * entry's retarget. + * The bundle stays exported and registrable under its id, with an empty + * `navigationContributions`, so every host that registers it keeps compiling + * and booting while it drops the registration on its own schedule. The + * `marketplace_installed` page it used to ship (cloud ADR-0009 P2a) retired + * earlier, with #23933. */ -export const MARKETPLACE_INSTALLED_UI_BUNDLE = { +export const MARKETPLACE_INSTALLED_UI_BUNDLE: { + id: string; + namespace: string; + version: string; + type: string; + scope: string; + name: string; + description: string; + navigationContributions: Array; +} = { id: 'com.objectstack.cloud-connection.marketplace-installed-ui', namespace: 'sys', - version: '0.3.0', + version: '0.4.0', type: 'plugin', scope: 'system', name: 'Marketplace Installed UI', - description: 'Setup navigation for locally-installed marketplace packages: "Installed Apps" opens Packages filtered to marketplace installs.', - navigationContributions: [ - { - app: 'setup', - group: 'group_apps', - priority: 110, - items: [ - { - id: 'nav_marketplace_installed', - type: 'component', - label: 'Installed Apps', - componentRef: 'developer:packages', - params: { source: 'marketplace' }, - icon: 'package-check', - }, - ], - }, - ], + description: 'Setup UI for locally-installed marketplace packages. It carries no navigation entry: installed packages are listed by Setup → Packages.', + navigationContributions: [], }; diff --git a/packages/platform-objects/src/apps/setup-nav.contributions.ts b/packages/platform-objects/src/apps/setup-nav.contributions.ts index 0a80c083cd2..93932683e26 100644 --- a/packages/platform-objects/src/apps/setup-nav.contributions.ts +++ b/packages/platform-objects/src/apps/setup-nav.contributions.ts @@ -26,9 +26,10 @@ import type { NavigationContribution } from '@objectstack/spec/ui'; const BASE_PRIORITY = 100; -// Marketplace entries (browse / installed) moved to -// @objectstack/cloud-connection's marketplace plugins (cloud ADR-0009: -// the nav lives and dies with the capability — no plugin, no entry). +// The marketplace's Browse entry lives in @objectstack/cloud-connection's +// marketplace plugins (cloud ADR-0009: the nav lives and dies with the +// capability — no plugin, no entry). What is installed is listed by this +// package's own Packages entry below (objectstack#36834). export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [ { app: 'setup', @@ -38,26 +39,45 @@ export const SETUP_NAV_CONTRIBUTIONS: NavigationContribution[] = [ { id: 'nav_system_overview', type: 'dashboard', label: 'System Overview', dashboardName: 'system_overview', icon: 'activity' }, ], }, - // No `group_apps` entry ships from this package. - // - // No unfiltered Packages entry (#25098, ruling 甲 amending #23892 B): the - // full `developer:packages` list is a development surface, so its door is in - // Studio only. The Studio that every boot serves is the console's own, at - // `/_console/studio` (the `@objectstack/studio` app is not default-loaded, - // so `studio.app.ts`'s Overview → Packages entry is served only where a host - // loads that app). There, the landing's "All packages" link opens the - // unfiltered page, and each package card's Manage (like the top-bar - // switcher's "Package info & settings") opens the package's detail sheet, - // with Disable / Enable (#35196, pinned on the console side by - // `BuilderLanding.packagesDoor-35196.test.tsx`). Setup reaches installed - // packages through the marketplace-filtered "Installed Apps" door - // (`nav_marketplace_installed`, `developer:packages` with - // `params: { source: 'marketplace' }`), which - // `@objectstack/cloud-connection` contributes to this group wherever the - // marketplace capability is present. `setup-packages-door.test.ts` pins - // what this package ships for each app. - // - // And no Packaged Actions entry (objectstack#34724, the ADR-0146 D4 + { + app: 'setup', + group: 'group_apps', + priority: BASE_PRIORITY, + items: [ + // objectstack#36834 — Setup's one door to what is installed, amending + // ruling 甲 of #25098 (which kept the full package list in Studio only, + // as a development surface). The entry opens the same + // `developer:packages` page with `params: { face: 'admin' }`, which the + // sidebar sends as the query string: the page's ADMINISTRATION face — + // every package of every source (with a Source filter on the page), + // enable / disable, delete with the keep-data choice, and New Package, + // which lands in Studio on the new package. The authoring actions + // (import, publish, revert, discard drafts, adopt loose items, manifest + // edit) stay on the face Studio opens: the landing's "All packages" link + // and each package card's Manage, unchanged. + // + // It replaces the marketplace-filtered "Installed Apps" entry + // (`nav_marketplace_installed`, retired from + // `@objectstack/cloud-connection`'s `MARKETPLACE_INSTALLED_UI_BUNDLE`): + // marketplace installs are this list under Source = marketplace, and an + // old `?source=marketplace` link still opens that face filtered. + // + // Gated like Setup's other administration entries (All Settings, Public + // Forms): `manage_platform_settings`. The server's gates on the package + // routes stay the authority (`manage_metadata` on every write). + // `setup-packages-door.test.ts` pins what this package ships for each app. + { + id: 'nav_packages', + type: 'component', + label: 'Packages', + componentRef: 'developer:packages', + params: { face: 'admin' }, + icon: 'package', + requiredPermissions: ['manage_platform_settings'], + }, + ], + }, + // No Packaged Actions entry (objectstack#34724, the ADR-0146 D4 // amendment of 2026-11-17): a packaged action's on/off switch for this // deployment is on the action, in its app in Studio (the object's Actions // view, a standalone action's item page), the way D4 put the flow switch on diff --git a/packages/platform-objects/src/apps/setup-packages-door.test.ts b/packages/platform-objects/src/apps/setup-packages-door.test.ts index d123a3be636..5e8d7669155 100644 --- a/packages/platform-objects/src/apps/setup-packages-door.test.ts +++ b/packages/platform-objects/src/apps/setup-packages-door.test.ts @@ -1,29 +1,39 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. // -// The full package list lives in Studio; Setup carries no unfiltered door to it -// (#25098, ruling 甲 amending #23892 ruling B). +// Setup carries the package list's ADMINISTRATION face; Studio keeps the full +// list (objectstack#36834, amending ruling 甲 of #25098, which had kept every +// door to the list in Studio). // // The console's `developer:packages` component is the one list of what is -// installed. Opened with no `source` filter it is a development surface, so its -// unfiltered door lives in Studio only. Setup reaches installed packages -// through the marketplace-filtered "Installed Apps" door — -// `developer:packages` with `params: { source: 'marketplace' }` — which -// `@objectstack/cloud-connection` contributes to Setup's `group_apps` wherever -// the marketplace capability is present, and pins on its side -// (`marketplace-installed-ui-entry.pin.test.ts`). +// installed, and it has two faces: +// +// - opened with `face=admin` (a component entry's `params` are sent as the +// query string), it is the administration face: every package of every +// source with a Source filter, enable / disable, delete, and New Package, +// which lands in Studio — and none of the authoring actions; +// - opened with no `face`, it is the development surface with every action. +// +// So Setup ships exactly one entry to the list, `nav_packages` in `group_apps`, +// and it names the administration face. It is UNFILTERED (no `source`): the +// marketplace-filtered "Installed Apps" entry that +// `@objectstack/cloud-connection` used to contribute retired with this card, +// and seeing only marketplace installs is the page's own Source filter +// (`marketplace-installed-ui-entry.pin.test.ts` pins that retirement on its +// side). // // The Studio every boot serves is the console's own, at `/_console/studio`: // the `@objectstack/studio` app this package declares (`studio.app.ts`) is not -// default-loaded (`apps/studio/src/index.ts`). So the served door is the -// console's, not a nav item: the Studio landing's "All packages" link and each -// package card's Manage, which opens the detail sheet with Disable / Enable +// default-loaded (`apps/studio/src/index.ts`). Its served door to the full list +// is the console's, not a nav item: the Studio landing's "All packages" link and +// each package card's Manage, which opens the detail sheet with every action // (#35196). The console pins that door // (`ui/packages/app-shell/src/views/studio-design/BuilderLanding.packagesDoor-35196.test.tsx`). // // This file is the platform-objects half: what THIS package ships for each app. -// Both directions are pinned, because either regression is silent at runtime — -// an unfiltered Setup entry simply renders, and the declared Studio app's entry -// is what a host that does load that app serves. +// Every direction is pinned, because each regression is silent at runtime — a +// Setup entry that loses `face` simply renders the development surface, a +// second Setup entry simply renders, and the declared Studio app's entry is +// what a host that does load that app serves. import { describe, it, expect } from 'vitest'; import { SETUP_APP } from './setup.app.js'; @@ -35,6 +45,7 @@ type NavItem = { type?: string; componentRef?: string; params?: Record; + requiredPermissions?: string[]; children?: NavItem[]; }; @@ -51,44 +62,71 @@ const walk = (items: unknown[] | undefined, out: NavItem[] = []): NavItem[] => { return out; }; -/** A `developer:packages` entry with no `source` filter: the full list. */ -const isUnfilteredPackagesDoor = (item: NavItem): boolean => - item.componentRef === PACKAGES_REF && item.params?.source === undefined; +/** Any entry that opens the package list, whatever its face or filter. */ +const isPackagesDoor = (item: NavItem): boolean => item.componentRef === PACKAGES_REF; + +/** The list's development surface: no `face`, no `source` filter. */ +const isDevelopmentDoor = (item: NavItem): boolean => + isPackagesDoor(item) && item.params?.face === undefined && item.params?.source === undefined; const setupItems = (): NavItem[] => [ ...walk(SETUP_APP.navigation as unknown[]), ...SETUP_NAV_CONTRIBUTIONS.flatMap((c) => walk(c.items as unknown[])), ]; -describe('the unfiltered package list is a Studio surface, not a Setup one (#25098)', () => { - it('the predicate tells the full list from the marketplace-filtered door', () => { - // Controls on the predicate itself, so the absence below cannot pass - // because the predicate matches nothing. - expect(isUnfilteredPackagesDoor({ type: 'component', componentRef: PACKAGES_REF })).toBe(true); +describe('Setup opens the package list on its administration face; Studio keeps the full list (#36834)', () => { + it('the predicates tell the development surface from the administration face', () => { + // Controls on the predicates themselves, so the readings below cannot pass + // because a predicate matches nothing. + expect(isDevelopmentDoor({ type: 'component', componentRef: PACKAGES_REF })).toBe(true); + expect(isDevelopmentDoor({ type: 'component', componentRef: PACKAGES_REF, params: { face: 'admin' } })).toBe(false); expect( - isUnfilteredPackagesDoor({ type: 'component', componentRef: PACKAGES_REF, params: { source: 'marketplace' } }), + isDevelopmentDoor({ type: 'component', componentRef: PACKAGES_REF, params: { source: 'marketplace' } }), ).toBe(false); + expect(isPackagesDoor({ type: 'component', componentRef: 'metadata:directory' })).toBe(false); }); - it('Setup ships no unfiltered `developer:packages` entry', () => { + it('Setup ships exactly one package-list entry: `nav_packages` in `group_apps`, administration face, unfiltered', () => { const items = setupItems(); // Control: the walk reads the real Setup shell and its contributions. expect(items.some((i) => i.id === 'group_apps')).toBe(true); expect(items.some((i) => i.id === 'nav_users')).toBe(true); - expect(items.filter(isUnfilteredPackagesDoor)).toEqual([]); - expect(items.filter((i) => i.id === 'nav_packages')).toEqual([]); + const doors = items.filter(isPackagesDoor); + expect(doors).toHaveLength(1); + expect(doors[0]).toMatchObject({ + id: 'nav_packages', + type: 'component', + componentRef: PACKAGES_REF, + params: { face: 'admin' }, + }); + // Unfiltered: every source, the page's Source filter narrows it. + expect(doors[0]!.params).toEqual({ face: 'admin' }); + // Never the development surface. + expect(items.filter(isDevelopmentDoor)).toEqual([]); + + const appsGroup = SETUP_NAV_CONTRIBUTIONS.filter((c) => c.group === 'group_apps'); + expect(appsGroup.flatMap((c) => (c.items as NavItem[]).map((i) => i.id))).toEqual(['nav_packages']); + }); + + it('the entry is gated like Setup\'s other administration entries', () => { + const entry = setupItems().find((i) => i.id === 'nav_packages'); + const settingsHub = setupItems().find((i) => i.id === 'nav_settings_hub'); + // Control: the pattern it follows is the one the hub carries today. + expect(settingsHub?.requiredPermissions).toEqual(['manage_platform_settings']); + expect(entry?.requiredPermissions).toEqual(settingsHub?.requiredPermissions); }); // The declared `@objectstack/studio` app, for a host that loads it. Not the // door a default boot serves: that one is the console Studio landing's // (see the file header). - it('the declared Studio app still ships the unfiltered entry, under Overview', () => { + it('the declared Studio app still ships the development-surface entry, under Overview', () => { const overview = walk(STUDIO_APP.navigation as unknown[]).find((i) => i.id === 'group_overview'); expect(overview, 'Studio lost its group_overview').toBeDefined(); - const doors = walk(overview!.children).filter(isUnfilteredPackagesDoor); + const doors = walk(overview!.children).filter(isPackagesDoor); expect(doors).toHaveLength(1); expect(doors[0]).toMatchObject({ id: 'nav_packages', type: 'component', componentRef: PACKAGES_REF }); + expect(isDevelopmentDoor(doors[0]!)).toBe(true); }); }); diff --git a/packages/platform-objects/src/apps/translations/ar.source-hashes.ts b/packages/platform-objects/src/apps/translations/ar.source-hashes.ts index 454966cef1d..85ea633c5cf 100644 --- a/packages/platform-objects/src/apps/translations/ar.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/ar.source-hashes.ts @@ -74,7 +74,7 @@ export const arSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/ar.ts b/packages/platform-objects/src/apps/translations/ar.ts index 408b5762b7f..d5d88e09032 100644 --- a/packages/platform-objects/src/apps/translations/ar.ts +++ b/packages/platform-objects/src/apps/translations/ar.ts @@ -40,7 +40,7 @@ export const ar: TranslationData = { group_overview: { label: 'نظرة عامة' }, group_apps: { label: 'التطبيقات' }, nav_marketplace_browse: { label: 'تصفح السوق' }, - nav_marketplace_installed: { label: 'التطبيقات المثبّتة' }, + nav_packages: { label: 'الحزم' }, nav_cloud_connection: { label: 'الاتصال السحابي' }, group_people_org: { label: 'الأشخاص والمؤسسة' }, group_access_control: { label: 'التحكم في الوصول' }, diff --git a/packages/platform-objects/src/apps/translations/de.source-hashes.ts b/packages/platform-objects/src/apps/translations/de.source-hashes.ts index b9658f39303..7c2392663e4 100644 --- a/packages/platform-objects/src/apps/translations/de.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/de.source-hashes.ts @@ -74,7 +74,7 @@ export const deSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/de.ts b/packages/platform-objects/src/apps/translations/de.ts index d902ee0ea08..d4e35e055c7 100644 --- a/packages/platform-objects/src/apps/translations/de.ts +++ b/packages/platform-objects/src/apps/translations/de.ts @@ -40,7 +40,7 @@ export const de: TranslationData = { group_overview: { label: 'Übersicht' }, group_apps: { label: 'Apps' }, nav_marketplace_browse: { label: 'Marketplace durchsuchen' }, - nav_marketplace_installed: { label: 'Installierte Apps' }, + nav_packages: { label: 'Pakete' }, nav_cloud_connection: { label: 'Cloud-Verbindung' }, group_people_org: { label: 'Personen und Organisation' }, group_access_control: { label: 'Zugriffssteuerung' }, diff --git a/packages/platform-objects/src/apps/translations/en.ts b/packages/platform-objects/src/apps/translations/en.ts index f838799bb91..d6ff5d2d460 100644 --- a/packages/platform-objects/src/apps/translations/en.ts +++ b/packages/platform-objects/src/apps/translations/en.ts @@ -75,7 +75,7 @@ export const en: TranslationData = { // Apps / Marketplace nav_marketplace_browse: { label: 'Browse Marketplace' }, - nav_marketplace_installed: { label: 'Installed Apps' }, + nav_packages: { label: 'Packages' }, nav_cloud_connection: { label: 'Cloud Connection' }, // People & Organization diff --git a/packages/platform-objects/src/apps/translations/es-ES.source-hashes.ts b/packages/platform-objects/src/apps/translations/es-ES.source-hashes.ts index d2bd3649a8a..dd04272280c 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.source-hashes.ts @@ -73,7 +73,7 @@ export const esESSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/es-ES.ts b/packages/platform-objects/src/apps/translations/es-ES.ts index 631862b7ebd..5751c3cc91b 100644 --- a/packages/platform-objects/src/apps/translations/es-ES.ts +++ b/packages/platform-objects/src/apps/translations/es-ES.ts @@ -40,7 +40,7 @@ export const esES: TranslationData = { group_overview: { label: 'Resumen' }, group_apps: { label: 'Aplicaciones' }, nav_marketplace_browse: { label: 'Explorar Marketplace' }, - nav_marketplace_installed: { label: 'Aplicaciones instaladas' }, + nav_packages: { label: 'Paquetes' }, nav_cloud_connection: { label: 'Conexión a la nube' }, group_people_org: { label: 'Personas y Organización' }, group_access_control: { label: 'Control de Acceso' }, diff --git a/packages/platform-objects/src/apps/translations/fr.source-hashes.ts b/packages/platform-objects/src/apps/translations/fr.source-hashes.ts index 4542ee66937..02114573799 100644 --- a/packages/platform-objects/src/apps/translations/fr.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/fr.source-hashes.ts @@ -74,7 +74,7 @@ export const frSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/fr.ts b/packages/platform-objects/src/apps/translations/fr.ts index 31a72a9e4fe..9af9f5fe8f8 100644 --- a/packages/platform-objects/src/apps/translations/fr.ts +++ b/packages/platform-objects/src/apps/translations/fr.ts @@ -40,7 +40,7 @@ export const fr: TranslationData = { group_overview: { label: 'Aperçu' }, group_apps: { label: 'Applications' }, nav_marketplace_browse: { label: 'Parcourir la Marketplace' }, - nav_marketplace_installed: { label: 'Applications installées' }, + nav_packages: { label: 'Packages' }, nav_cloud_connection: { label: 'Connexion au cloud' }, group_people_org: { label: 'Personnes et organisation' }, group_access_control: { label: 'Contrôle d’accès' }, diff --git a/packages/platform-objects/src/apps/translations/ja-JP.source-hashes.ts b/packages/platform-objects/src/apps/translations/ja-JP.source-hashes.ts index b1b14df8e66..738fdc79ab2 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.source-hashes.ts @@ -73,7 +73,7 @@ export const jaJPSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/ja-JP.ts b/packages/platform-objects/src/apps/translations/ja-JP.ts index ca95254d362..5f5d0125a96 100644 --- a/packages/platform-objects/src/apps/translations/ja-JP.ts +++ b/packages/platform-objects/src/apps/translations/ja-JP.ts @@ -40,7 +40,7 @@ export const jaJP: TranslationData = { group_overview: { label: '概要' }, group_apps: { label: 'アプリ' }, nav_marketplace_browse: { label: 'マーケットプレイスを閲覧' }, - nav_marketplace_installed: { label: 'インストール済みアプリ' }, + nav_packages: { label: 'パッケージ' }, nav_cloud_connection: { label: 'クラウド接続' }, group_people_org: { label: 'ユーザーと組織' }, group_access_control: { label: 'アクセス制御' }, diff --git a/packages/platform-objects/src/apps/translations/ko.source-hashes.ts b/packages/platform-objects/src/apps/translations/ko.source-hashes.ts index 4082cd352bf..ee0b3f01564 100644 --- a/packages/platform-objects/src/apps/translations/ko.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/ko.source-hashes.ts @@ -74,7 +74,7 @@ export const koSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/ko.ts b/packages/platform-objects/src/apps/translations/ko.ts index d559c18d6b3..77ae856db11 100644 --- a/packages/platform-objects/src/apps/translations/ko.ts +++ b/packages/platform-objects/src/apps/translations/ko.ts @@ -40,7 +40,7 @@ export const ko: TranslationData = { group_overview: { label: '개요' }, group_apps: { label: '앱' }, nav_marketplace_browse: { label: '마켓플레이스 둘러보기' }, - nav_marketplace_installed: { label: '설치된 앱' }, + nav_packages: { label: '패키지' }, nav_cloud_connection: { label: '클라우드 연결' }, group_people_org: { label: '사용자 및 조직' }, group_access_control: { label: '액세스 제어' }, diff --git a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.ts b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.ts index f473168c46c..20542dc8227 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.source-hashes.ts @@ -74,7 +74,7 @@ export const ptBRSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/pt-BR.ts b/packages/platform-objects/src/apps/translations/pt-BR.ts index 14c272900e1..474927fdb49 100644 --- a/packages/platform-objects/src/apps/translations/pt-BR.ts +++ b/packages/platform-objects/src/apps/translations/pt-BR.ts @@ -40,7 +40,7 @@ export const ptBR: TranslationData = { group_overview: { label: 'Visão geral' }, group_apps: { label: 'Aplicativos' }, nav_marketplace_browse: { label: 'Explorar o Marketplace' }, - nav_marketplace_installed: { label: 'Aplicativos instalados' }, + nav_packages: { label: 'Pacotes' }, nav_cloud_connection: { label: 'Conexão com a nuvem' }, group_people_org: { label: 'Pessoas e organização' }, group_access_control: { label: 'Controle de acesso' }, diff --git a/packages/platform-objects/src/apps/translations/ru.source-hashes.ts b/packages/platform-objects/src/apps/translations/ru.source-hashes.ts index 61a2f439e25..1671428a58a 100644 --- a/packages/platform-objects/src/apps/translations/ru.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/ru.source-hashes.ts @@ -74,7 +74,7 @@ export const ruSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/ru.ts b/packages/platform-objects/src/apps/translations/ru.ts index 081243f4562..69f08863a32 100644 --- a/packages/platform-objects/src/apps/translations/ru.ts +++ b/packages/platform-objects/src/apps/translations/ru.ts @@ -40,7 +40,7 @@ export const ru: TranslationData = { group_overview: { label: 'Обзор' }, group_apps: { label: 'Приложения' }, nav_marketplace_browse: { label: 'Обзор Marketplace' }, - nav_marketplace_installed: { label: 'Установленные приложения' }, + nav_packages: { label: 'Пакеты' }, nav_cloud_connection: { label: 'Подключение к облаку' }, group_people_org: { label: 'Люди и организация' }, group_access_control: { label: 'Управление доступом' }, diff --git a/packages/platform-objects/src/apps/translations/setup-nav-dead-key-tombstone.test.ts b/packages/platform-objects/src/apps/translations/setup-nav-dead-key-tombstone.test.ts index fac34672294..74d3cb7d308 100644 --- a/packages/platform-objects/src/apps/translations/setup-nav-dead-key-tombstone.test.ts +++ b/packages/platform-objects/src/apps/translations/setup-nav-dead-key-tombstone.test.ts @@ -94,6 +94,15 @@ // `audit-nav-contribution.test.ts`, since that // package depends on this one and cannot be imported // from here. +// nav_marketplace_installed Setup › Installed Apps, contributed by +// `@objectstack/cloud-connection` +// (`MARKETPLACE_INSTALLED_UI_BUNDLE`): it opened the +// package list filtered to marketplace installs, and +// retired when Setup's own Packages entry +// (`nav_packages`) took its place, every source with a +// Source filter on the page (objectstack#36834). The +// declaring side is pinned in that package's +// `marketplace-installed-ui-entry.pin.test.ts`. // // --------------------------------------------------------------------------- // What to do when this test goes red @@ -133,6 +142,7 @@ const DEAD_SETUP_NAV_IDS = [ 'nav_declared_sharing_rules', 'nav_device_codes', 'nav_jwks', + 'nav_marketplace_installed', 'nav_metadata', 'nav_packaged_actions', 'nav_packaged_automation', diff --git a/packages/platform-objects/src/apps/translations/zh-CN.source-hashes.ts b/packages/platform-objects/src/apps/translations/zh-CN.source-hashes.ts index 6edb761ef47..7a45b4e202d 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.source-hashes.ts @@ -73,7 +73,7 @@ export const zhCNSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/zh-CN.ts b/packages/platform-objects/src/apps/translations/zh-CN.ts index f1bf96552fe..c3e86d96f15 100644 --- a/packages/platform-objects/src/apps/translations/zh-CN.ts +++ b/packages/platform-objects/src/apps/translations/zh-CN.ts @@ -40,7 +40,7 @@ export const zhCN: TranslationData = { group_overview: { label: '总览' }, group_apps: { label: '应用' }, nav_marketplace_browse: { label: '浏览应用市场' }, - nav_marketplace_installed: { label: '已安装应用' }, + nav_packages: { label: '软件包' }, nav_cloud_connection: { label: '云连接' }, group_people_org: { label: '人员与组织' }, group_access_control: { label: '访问控制' }, diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.ts b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.ts index f56886ef799..95ff436fc2d 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.source-hashes.ts @@ -74,7 +74,7 @@ export const zhHantSourceHashes: Readonly> = { 'apps.setup.navigation.group_overview.label': 'eebdbe1cc7b59cdf', 'apps.setup.navigation.group_apps.label': '699b367291abcbe6', 'apps.setup.navigation.nav_marketplace_browse.label': '2afbe021f5419fdd', - 'apps.setup.navigation.nav_marketplace_installed.label': '93bd5d458e05db60', + 'apps.setup.navigation.nav_packages.label': '8cd8f29658025f73', 'apps.setup.navigation.nav_cloud_connection.label': '3a7caad0cb98e71d', 'apps.setup.navigation.group_people_org.label': 'd313f656b6f0ab65', 'apps.setup.navigation.group_access_control.label': 'a1a4dd47bcbfaf67', diff --git a/packages/platform-objects/src/apps/translations/zh-Hant.ts b/packages/platform-objects/src/apps/translations/zh-Hant.ts index e8a5c44c13b..4c7c143c2eb 100644 --- a/packages/platform-objects/src/apps/translations/zh-Hant.ts +++ b/packages/platform-objects/src/apps/translations/zh-Hant.ts @@ -40,7 +40,7 @@ export const zhHant: TranslationData = { group_overview: { label: '總覽' }, group_apps: { label: '應用程式' }, nav_marketplace_browse: { label: '瀏覽應用程式市場' }, - nav_marketplace_installed: { label: '已安裝應用程式' }, + nav_packages: { label: '套件' }, nav_cloud_connection: { label: '雲端連線' }, group_people_org: { label: '人員與組織' }, group_access_control: { label: '存取控制' }, diff --git a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx index 049bd99f62b..2a1fd52c846 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.tsx @@ -14,10 +14,21 @@ * * Backed entirely by the existing `/api/v1/packages` REST surface * (see framework `http-dispatcher.handlePackages`). + * + * objectstack#36834 — the page has two faces, chosen by the URL's `face` param + * (`readPackagesFace` in `packageSource.ts`): + * - the DEVELOPMENT surface (no `face`): the one Studio opens, every action + * above, unchanged; + * - the ADMINISTRATION face (`?face=admin`, Setup → Packages): every package + * of every source, one line per app with its modules folded under it, a + * Source filter, and in the detail sheet only enable / disable and delete + * (with its keep-data choice); New Package lands in Studio on the new + * package. Import, publish, revert, discard drafts, adopt loose items and + * manifest edit stay on the development surface. */ import * as React from 'react'; -import { Link, useLocation, useSearchParams } from 'react-router-dom'; +import { Link, useLocation, useNavigate, useSearchParams } from 'react-router-dom'; import { Package as PackageIcon, Plus, @@ -76,6 +87,8 @@ import { DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, + ToggleGroup, + ToggleGroupItem, cn, } from '@object-ui/components'; import { useMetadataLocale, t, tFormat } from './i18n.js'; @@ -110,11 +123,16 @@ import type { InstalledPackageAtEitherStage } from '@objectstack/spec/api-assemb import type { PackagePublishResult } from '@objectstack/spec/system'; import type { ReassignOrphanedMetadataResponse } from '@objectstack/spec/api'; import { + PACKAGE_SOURCES, + PACKAGES_ADMIN_FACE, + PACKAGES_FACE_PARAM, PACKAGES_SOURCE_PARAM, PackageSourceRefusal, + readPackagesFace, readServedSource, readSourceFilter, type PackageSource, + type PackagesFace, } from './packageSource.js'; /* -------------------------------------------------------------------------- */ @@ -345,6 +363,10 @@ function sourceRefusalText(e: PackageSourceRefusal, locale: string): string { return tFormat('engine.packages.source.filterUnknown', locale, { value: e.subject }); case 'PACKAGE_SOURCE_FILTER_REPEATED': return tFormat('engine.packages.source.filterRepeated', locale, { value: e.subject }); + case 'PACKAGES_FACE_UNKNOWN': + return tFormat('engine.packages.face.unknown', locale, { value: e.subject }); + case 'PACKAGES_FACE_REPEATED': + return tFormat('engine.packages.face.repeated', locale, { value: e.subject }); } } @@ -584,6 +606,14 @@ function InstalledAppUpdateCell({ rowId, read }: { rowId: string; read: UpdateRe ); } +/** + * A package's Studio address, the one the Studio landing's package card opens + * (`BuilderLanding`'s `open`): the builder on the package's Data pillar. The + * administration face's create lands here, and its "Open in Studio" link + * points here (objectstack#36834). + */ +const studioPackagePath = (packageId: string) => `/studio/${encodeURIComponent(packageId)}/data`; + /* -------------------------------------------------------------------------- */ /* Create-package dialog */ /* -------------------------------------------------------------------------- */ @@ -671,6 +701,7 @@ type DeleteMode = '' | 'structure' | 'all'; export function PackageDetailSheet({ pkg, appBase, + face = 'development', open, onOpenChange, onChanged, @@ -680,6 +711,15 @@ export function PackageDetailSheet({ * has no console app context) to hide those links; every lifecycle action * still works without it. */ appBase?: string; + /** + * objectstack#36834 — which face of the Packages page opened the sheet. The + * `admin` face (Setup → Packages) offers the administration actions only: + * View info, Disable / Enable and Delete, plus "Open in Studio" on an + * authored package. Edit, Publish, Revert, Export, Duplicate, Adopt loose + * items and the pending changes' Publish / Discard stay on the development + * face, which every other caller (Studio's landing and switcher) opens. + */ + face?: PackagesFace; open: boolean; onOpenChange: (v: boolean) => void; onChanged: () => void; @@ -824,6 +864,10 @@ export function PackageDetailSheet({ // `true` for a writable base and for a module of an installed app, which // stays read-only for every other write action above and below. const disableable = pkg.disableable === true; + // objectstack#36834 — the authoring actions are offered on the development + // face only; the administration face keeps the reads, Disable / Enable and + // Delete. + const authoring = face !== 'admin'; // The name the delete dialog asks the author to type: the one the sheet's // title shows. const displayName = pkg.manifest.name || id; @@ -1189,7 +1233,25 @@ export function PackageDetailSheet({ )} - {appBase && ( + {/* objectstack#36834 — the administration face sends an authored + package's author to Studio, where its design and its authoring + actions are; it browses no metadata itself. */} + {!authoring && pkg.source === 'authored' && ( + <> + + onOpenChange(false)} + data-testid="pkg-detail-open-in-studio" + > + + {t('engine.packages.detail.openInStudio', locale)} + + + )} + + {authoring && appBase && ( <> )} - {drafts && drafts.length > 0 && ( + {authoring && drafts && drafts.length > 0 && ( <>
@@ -1295,19 +1357,19 @@ export function PackageDetailSheet({ {t('engine.packages.detail.viewInfo', locale)} - {writable && ( + {authoring && writable && ( )} - {writable && ( + {authoring && writable && ( )} - {writable && ( + {authoring && writable && ( )} - - {writable && ( + {authoring && ( + + )} + {authoring && writable && ( )}
- {writable && dupOpen && ( + {authoring && writable && dupOpen && (
{ @@ -1687,11 +1752,17 @@ export function PackagesPage() { // The Source filter is URL state (`?source=`), one closed spelling; an // unknown or repeated value is refused below, not ignored. const [searchParams, setSearchParams] = useSearchParams(); - const sourceFilter: { value: PackageSource | null; refusal: string | null } = (() => { + // objectstack#36834 — the face is URL state too (`?face=admin`), read + // beside the Source filter; an unknown or repeated value is refused the same + // way, and the refused page draws the development surface's header. + const sourceFilter: { value: PackageSource | null; face: PackagesFace; refusal: string | null } = (() => { try { - return { value: readSourceFilter(searchParams.getAll(PACKAGES_SOURCE_PARAM)), refusal: null }; + const value = readSourceFilter(searchParams.getAll(PACKAGES_SOURCE_PARAM)); + return { value, face: readPackagesFace(searchParams.getAll(PACKAGES_FACE_PARAM), value), refusal: null }; } catch (e) { - if (e instanceof PackageSourceRefusal) return { value: null, refusal: sourceRefusalText(e, locale) }; + if (e instanceof PackageSourceRefusal) { + return { value: null, face: 'development', refusal: sourceRefusalText(e, locale) }; + } throw e; } })(); @@ -1770,19 +1841,32 @@ export function PackagesPage() { if (fresh && fresh !== selected) setSelected(fresh); }, [packages, selected]); + // objectstack#36834 — Setup → Packages opens the ADMINISTRATION face + // (`?face=admin`, or the retired Installed Apps address `?source=marketplace`): + // the administrator's view this page first drew for marketplace installs + // (objectstack#34722, ADR-0146 D1), now over every source. One line per app + // with its modules folded under it, the columns an administrator reads (Name, + // Version, Status, Source, Update), a Source filter, New Package — which + // lands in Studio on the new package — and none of the developer's doors: + // Import, the platform packages switch and the authoring actions stay on the + // development surface Studio opens (this page with no `face`). + const adminFace = sourceFilter.face === 'admin'; + const filtered = React.useMemo(() => { const q = query.trim().toLowerCase(); return rows.filter((r) => { if (sourceFilter.value && r.source !== sourceFilter.value) return false; const kernel = r.pkg?.manifest.scope === 'system' || r.pkg?.manifest.scope === 'cloud'; - if (kernel && !showKernel) return false; + // The administration face lists no platform package: it has no switch to + // show them, and nothing on them is the administrator's to change. + if (kernel && (adminFace || !showKernel)) return false; if (!q) return true; return ( r.id.toLowerCase().includes(q) || (r.pkg?.manifest.name || '').toLowerCase().includes(q) ); }); - }, [rows, query, showKernel, sourceFilter.value]); + }, [rows, query, showKernel, sourceFilter.value, adminFace]); // objectui#13166 — the Actions column follows the cells it sits over: it is // drawn only when a row IN VIEW carries an action. Gating it on the page-level @@ -1793,31 +1877,22 @@ export function PackagesPage() { // same moment its cells do. const showActionsColumn = showMarketplaceActions && filtered.some((r) => rowActionEntry(r) !== null); - // objectui#13356 — Setup's "Installed Apps" entry opens this page with - // `?source=marketplace` (its nav item's `params`, sent as the query string). - // That view is titled for the entry that opened it, and when no row is a - // marketplace install its empty state says so, instead of blaming a filter - // the administrator never set. "No packages match your filters." stays for - // the case where marketplace installs exist and the search hides them. - // - // objectstack#34722 — that view is the administrator's door (ADR-0146 D1: - // Setup carries app installation; Studio is the developer's surface): it - // draws one line per installed app with its modules folded under it, the - // columns an administrator reads (Name, Version, Status, Source, Update), - // and none of the developer's doors — Import, New Package and the platform - // packages switch stay on Studio's Overview → Packages, this same page - // opened without `source` (ruling 甲 on objectstack#25098). - const installedAppsView = sourceFilter.value === 'marketplace'; - const noMarketplaceInstalls = installedAppsView && !rows.some((r) => r.source === 'marketplace'); - - // The Installed Apps lines: grouped over the rows the Source filter keeps, - // then searched — a group is shown when its app or one of its modules - // matches, and a module the search found is shown without a click. + // objectui#13356 — a view filtered to marketplace installs that holds none + // says so in its empty state, instead of blaming a filter the administrator + // never set. "No packages match your filters." stays for the case where + // marketplace installs exist and the search hides them. + const noMarketplaceInstalls = + sourceFilter.value === 'marketplace' && !rows.some((r) => r.source === 'marketplace'); + + // The administration face's lines: grouped over the rows the Source filter + // keeps (a module folds only under an app of its own Source), then searched — + // a group is shown when its app or one of its modules matches, and a module + // the search found is shown without a click. const appGroups = React.useMemo(() => { - if (!installedAppsView) return []; + if (!adminFace) return []; const q = query.trim().toLowerCase(); const scoped = rows.filter((r) => { - if (r.source !== 'marketplace') return false; + if (sourceFilter.value && r.source !== sourceFilter.value) return false; return !(r.pkg?.manifest.scope === 'system' || r.pkg?.manifest.scope === 'cloud'); }); return groupInstalledApps(scoped) @@ -1827,7 +1902,7 @@ export function PackagesPage() { return rowMatches(g.row, q) || matchedModules ? { ...g, matchedModules } : null; }) .filter((g): g is InstalledAppGroup & { matchedModules: boolean } => g !== null); - }, [installedAppsView, rows, query]); + }, [adminFace, rows, query, sourceFilter.value]); const [expandedApps, setExpandedApps] = React.useState>(() => new Set()); const moduleIdBase = React.useId(); const toggleApp = (id: string) => @@ -1838,11 +1913,11 @@ export function PackagesPage() { return next; }); - // The catalog is asked about each installed app's line — never about a - // module, which updates with its app — and only in the Installed Apps view. + // The catalog is asked about each marketplace app's line — never about a + // module, which updates with its app — and only on the administration face. // Keyed on the candidates' ids, versions and package ids (primitives), so a // reload that serves the same installs asks nothing again. - const updateCandidates: UpdateCandidate[] = installedAppsView + const updateCandidates: UpdateCandidate[] = adminFace ? groupInstalledApps(rows.filter((r) => r.source === 'marketplace')) .map((g) => g.row) .filter((r): r is PackageListRow & { install: LocalInstallEntry } => !!r.install && !r.install.notLoaded) @@ -1852,14 +1927,14 @@ export function PackagesPage() { const [updateRead, setUpdateRead] = React.useState({ state: 'reading' }); const updateSeq = React.useRef(0); React.useEffect(() => { - if (!installedAppsView || loading) return; + if (!adminFace || loading) return; const seq = ++updateSeq.current; setUpdateRead({ state: 'reading' }); void readUpdateTargets(updateCandidates, appBase).then((read) => { if (updateSeq.current === seq) setUpdateRead(read); }); // `updateKey` spells `updateCandidates`; the array itself is rebuilt each render. - }, [installedAppsView, loading, updateKey, appBase]); + }, [adminFace, loading, updateKey, appBase]); const updateCount = updateRead.state === 'read' ? updateRead.targets.size : 0; const updatesUnavailable = updateRead.state === 'read' && updateRead.unavailable; @@ -1869,6 +1944,18 @@ export function PackagesPage() { setSearchParams(next, { replace: true }); }; + // objectstack#36834 — the administration face's Source filter writes the + // same `?source=` the list reads, and writes `face` with it: a list opened + // from the retired Installed Apps address (`?source=marketplace`, no `face`) + // stays on this face when "All" clears the filter. + const setSourceFilter = (value: PackageSource | null) => { + const next = new URLSearchParams(searchParams); + next.set(PACKAGES_FACE_PARAM, PACKAGES_ADMIN_FACE); + if (value) next.set(PACKAGES_SOURCE_PARAM, value); + else next.delete(PACKAGES_SOURCE_PARAM); + setSearchParams(next, { replace: true }); + }; + const openDetail = (pkg: InstalledPackageRow) => { setSelected(pkg); setDetailOpen(true); @@ -1941,22 +2028,18 @@ export function PackagesPage() { description under the title inside Setup, beside it elsewhere — is the header's own. Refresh is its icon button; New stays rightmost. */} } refresh={{ onRefresh: () => void load(), label: t('engine.packages.refresh', locale), busy: loading }} - // objectstack#34722 — Import and New Package are developer doors: - // Studio's Packages keeps them, Setup's Installed Apps draws neither. + // objectstack#36834 — Import is a developer door: Studio's Packages + // keeps it. The administration face draws New Package alone. actions={ - installedAppsView ? undefined : <> + adminFace ? newPackageButton : <> {importInput}
- {/* The Installed Apps view is titled for its filter and is Setup's - only door to this list (ruling 甲 on objectstack#25098): no chip - that clears the filter into the developer's full list. */} - {sourceFilter.value && !installedAppsView && ( + {/* objectstack#36834 — the administration face's Source filter: All + and the closed set of origins, writing `?source=`. */} + {adminFace && ( +
+ + {t('engine.packages.col.source', locale)} + + { + if (v === 'all') setSourceFilter(null); + else if ((PACKAGE_SOURCES as readonly string[]).includes(v)) setSourceFilter(v as PackageSource); + }} + aria-labelledby={`${moduleIdBase}source-picker-label`} + > + + {t('engine.packages.source.all', locale)} + + {PACKAGE_SOURCES.map((value) => ( + + {t(`engine.packages.source.${value}`, locale)} + + ))} + +
+ )} + {sourceFilter.value && !adminFace && (
{t('engine.packages.col.source', locale)}: @@ -2050,7 +2161,7 @@ export function PackagesPage() {
)} - {kernelCount > 0 && !installedAppsView && ( + {kernelCount > 0 && !adminFace && (
- ) : installedAppsView ? ( + ) : adminFace ? ( // objectstack#34722 — the administrator's columns: Name, Version, // Status, Source, Update. The package id and the Scope badge are the // developer's reading, on Studio's Packages. @@ -2200,7 +2311,10 @@ export function PackagesPage() { - {module ? null : } + {/* Only a marketplace app has a catalog to update from. */} + {module || source !== 'marketplace' ? null : ( + + )} {showActionsColumn && ( @@ -2292,13 +2406,23 @@ export function PackagesPage() { { + onCreated={async (id) => { + // objectstack#36834 — created from Setup, the empty package is + // designed next: straight into Studio on it, through the address the + // Studio landing's package card opens. The development surface stays + // where it is and shows the new row. + if (adminFace) { + forgetPackageListReads(); + navigate(studioPackagePath(id)); + return; + } await load(); }} /> void load()} diff --git a/ui/packages/app-shell/src/views/metadata-admin/packageSource.ts b/ui/packages/app-shell/src/views/metadata-admin/packageSource.ts index 94794675521..66a06a99cd2 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/packageSource.ts +++ b/ui/packages/app-shell/src/views/metadata-admin/packageSource.ts @@ -5,7 +5,7 @@ * and its Source filter (objectui#12675, objectui#12790; ruling B on * objectstack#23892). * - * Setup's Packages is the ONE list of what is installed, so each row says + * The Packages page is the ONE list of what is installed, so each row says * which of three origins it has. The set is CLOSED: `code` / `marketplace` / * `authored`, and nothing else is ever drawn. * @@ -65,15 +65,41 @@ export const PACKAGE_SOURCES = ['code', 'marketplace', 'authored'] as const sati */ export const PACKAGES_SOURCE_PARAM = 'source'; +/** + * The Packages page's face, spelled as ONE URL query param (objectstack#36834). + * + * `?face=admin` opens the ADMINISTRATION face: every package of every source, + * a Source filter, enable / disable, delete and New Package (which lands in + * Studio on the new package) — and none of the authoring actions. Setup's + * "Packages" nav item reaches it by declaring + * `{ type: 'component', componentRef: 'developer:packages', params: { face: 'admin' } }`. + * With no `face` the page is the development surface Studio opens (the + * landing's "All packages" link), every action on it. + * + * The one value is {@link PACKAGES_ADMIN_FACE}; anything else is refused by + * name, as an unknown Source is. Page-local, like {@link PACKAGES_SOURCE_PARAM}. + */ +export const PACKAGES_FACE_PARAM = 'face'; + +/** The one value {@link PACKAGES_FACE_PARAM} takes. */ +export const PACKAGES_ADMIN_FACE = 'admin'; + +/** Which face of the Packages page is drawn. */ +export type PackagesFace = 'admin' | 'development'; + export type PackageSourceRefusalCode = /** The row's served `source` is absent, or outside {@link PACKAGE_SOURCES}. */ | 'PACKAGE_SOURCE_UNKNOWN' /** `?source=` names a value outside {@link PACKAGE_SOURCES}. */ | 'PACKAGE_SOURCE_FILTER_UNKNOWN' /** `?source=` appears more than once. */ - | 'PACKAGE_SOURCE_FILTER_REPEATED'; + | 'PACKAGE_SOURCE_FILTER_REPEATED' + /** `?face=` names a value other than {@link PACKAGES_ADMIN_FACE}. */ + | 'PACKAGES_FACE_UNKNOWN' + /** `?face=` appears more than once. */ + | 'PACKAGES_FACE_REPEATED'; -/** A refusal at the Source boundary, naming what it refused. */ +/** A refusal at the page's URL boundary (its Source and its face), naming what it refused. */ export class PackageSourceRefusal extends Error { readonly code: PackageSourceRefusalCode; /** The package id, or the filter value(s), the refusal is about. */ @@ -128,6 +154,31 @@ export function readSourceFilter(values: readonly string[]): PackageSource | nul return value; } +/** + * The face the URL asks for. Throws {@link PackageSourceRefusal} for a value + * other than {@link PACKAGES_ADMIN_FACE} or a repeated param. + * + * With no `face`, a `?source=marketplace` URL is the administration face too: + * that is the address Setup's retired "Installed Apps" entry opened, already + * the administrator's view of this list, and bookmarks and the marketplace + * page's "Installed" button still send it (objectstack#36834). Every other URL + * without `face` is the development surface. + * + * @param faceValues every occurrence of {@link PACKAGES_FACE_PARAM}. + * @param source the Source filter already read from the same URL. + */ +export function readPackagesFace(faceValues: readonly string[], source: PackageSource | null): PackagesFace { + if (faceValues.length > 1) { + throw new PackageSourceRefusal('PACKAGES_FACE_REPEATED', faceValues.join(', ')); + } + if (faceValues.length === 1) { + const [value] = faceValues; + if (value !== PACKAGES_ADMIN_FACE) throw new PackageSourceRefusal('PACKAGES_FACE_UNKNOWN', value); + return 'admin'; + } + return source === 'marketplace' ? 'admin' : 'development'; +} + /** The Packages route, optionally filtered to one Source. */ export function packagesHref(basePath: string, source?: PackageSource): string { const path = `${basePath}/component/developer/packages`; diff --git a/ui/packages/app-shell/src/views/studio-design/BuilderLanding.tsx b/ui/packages/app-shell/src/views/studio-design/BuilderLanding.tsx index 2142f71a451..8246a8bd2d4 100644 --- a/ui/packages/app-shell/src/views/studio-design/BuilderLanding.tsx +++ b/ui/packages/app-shell/src/views/studio-design/BuilderLanding.tsx @@ -24,12 +24,12 @@ * copy says what the author can do; it names no package mechanism. * * objectstack#35196 — this page is the served Studio's door to package - * management (ruling 甲 of objectstack#25098 puts the unfiltered package list - * in Studio only, and the `@objectstack/studio` app whose Overview → Packages - * entry names it is not default-loaded): every card carries Manage, which - * opens the same detail sheet as the top-bar switcher's "Package info & - * settings" (Disable / Enable, export, and the writable actions), and the - * title row links to the unfiltered Packages page. + * management (the `@objectstack/studio` app whose Overview → Packages entry + * names the full list is not default-loaded; Setup → Packages opens the same + * list on its administration face only, objectstack#36834): every card + * carries Manage, which opens the same detail sheet as the top-bar + * switcher's "Package info & settings" (Disable / Enable, export, and the + * writable actions), and the title row links to the unfiltered Packages page. */ import * as React from 'react'; @@ -79,10 +79,13 @@ import { newAppStep } from './newAppDoor.js'; const MARKETPLACE_PATH = '/apps/setup/system/marketplace'; /** - * objectstack#35196 — the unfiltered Packages page (`developer:packages` with no - * `source`), the full list with every package's lifecycle actions. Ruling 甲 - * (objectstack#25098) gives it no Setup menu entry; this landing's link is its - * menu door in the served Studio. The route is hosted under the Setup app's + * objectstack#35196 — the Packages page's development surface + * (`developer:packages` with no `face` and no `source`), the full list with + * every package's lifecycle and authoring actions; this landing's link is its + * menu door in the served Studio. Setup → Packages opens the same page with + * `?face=admin`, its administration face — enable / disable, delete and create + * only (objectstack#36834, amending ruling 甲 of objectstack#25098, which had + * given the list no Setup entry). The route is hosted under the Setup app's * address, the one console app every boot loads. */ export const STUDIO_ALL_PACKAGES_PATH = packagesHref('/apps/setup'); diff --git a/ui/packages/i18n/src/namespaces/studio/en.ts b/ui/packages/i18n/src/namespaces/studio/en.ts index 59ba67da4e5..0b18db7e026 100644 --- a/ui/packages/i18n/src/namespaces/studio/en.ts +++ b/ui/packages/i18n/src/namespaces/studio/en.ts @@ -1926,8 +1926,7 @@ const STUDIO_EN: Record = { 'engine.packages.empty': 'No packages', 'engine.packages.emptyCreate': 'Create your first package to start authoring metadata.', 'engine.packages.emptyFiltered': 'No packages match your filters.', - 'engine.packages.installedApps.title': 'Installed Apps', - 'engine.packages.installedApps.description': 'The apps installed from the marketplace into this system.', + 'engine.packages.admin.description': 'Turn the packages installed in this system on or off, or delete one. A new package opens in Studio, where it is designed.', 'engine.packages.installedApps.empty': 'No apps installed from the marketplace yet', 'engine.packages.installedApps.emptyHint': 'Apps you install from the marketplace are listed here.', 'engine.packages.installedApps.col.update': 'Update', @@ -1956,6 +1955,9 @@ const STUDIO_EN: Record = { 'engine.packages.source.marketplace': 'Marketplace', 'engine.packages.source.authored': 'Authored', 'engine.packages.source.showAll': 'Show all', + 'engine.packages.source.all': 'All', + 'engine.packages.face.unknown': 'Unknown page view "{value}". Use admin, or leave it out.', + 'engine.packages.face.repeated': 'The page view is given more than once ({value}). Give admin once, or leave it out.', 'engine.packages.source.unknown': 'Package "{id}" was refused: the server sent no source for it, or one that is not code, marketplace or authored.', 'engine.packages.source.filterUnknown': 'Unknown source filter "{value}". Use code, marketplace or authored.', 'engine.packages.source.filterRepeated': 'The source filter is given more than once ({value}). Give one of code, marketplace or authored.', @@ -2012,6 +2014,7 @@ const STUDIO_EN: Record = { 'engine.packages.detail.type': 'Type', 'engine.packages.detail.description': 'Description', 'engine.packages.detail.browseMetadata': "Browse this package's metadata", + 'engine.packages.detail.openInStudio': 'Open in Studio', 'engine.packages.detail.pendingChanges': 'Pending changes', 'engine.packages.detail.pendingHint': 'Drafted, not yet published. Publish the whole app, or review each below.', 'engine.packages.detail.publishApp': 'Publish app ({count})', diff --git a/ui/packages/i18n/src/namespaces/studio/zh.ts b/ui/packages/i18n/src/namespaces/studio/zh.ts index a34aaadc282..1a9818a9950 100644 --- a/ui/packages/i18n/src/namespaces/studio/zh.ts +++ b/ui/packages/i18n/src/namespaces/studio/zh.ts @@ -1709,8 +1709,7 @@ const STUDIO_ZH: Record = { 'engine.packages.empty': '暂无软件包', 'engine.packages.emptyCreate': '创建第一个软件包以开始编写元数据。', 'engine.packages.emptyFiltered': '没有匹配筛选条件的软件包。', - 'engine.packages.installedApps.title': '已安装的应用', - 'engine.packages.installedApps.description': '从应用市场安装到本系统的应用。', + 'engine.packages.admin.description': '启用、停用或删除本系统中安装的软件包。新建的软件包会在 Studio 中打开,在那里设计。', 'engine.packages.installedApps.empty': '尚未从应用市场安装任何应用', 'engine.packages.installedApps.emptyHint': '从应用市场安装的应用会列在这里。', 'engine.packages.installedApps.col.update': '更新', @@ -1739,6 +1738,9 @@ const STUDIO_ZH: Record = { 'engine.packages.source.marketplace': '应用市场', 'engine.packages.source.authored': '自建', 'engine.packages.source.showAll': '显示全部', + 'engine.packages.source.all': '全部', + 'engine.packages.face.unknown': '未知的页面视图「{value}」。请使用 admin,或不填。', + 'engine.packages.face.repeated': '页面视图给出了不止一次({value})。请只给出一次 admin,或不填。', 'engine.packages.source.unknown': '软件包「{id}」已被拒绝:服务器未给出它的来源,或给出的来源不是 code、marketplace 或 authored 之一。', 'engine.packages.source.filterUnknown': '未知的来源筛选值「{value}」。请使用 code、marketplace 或 authored。', 'engine.packages.source.filterRepeated': '来源筛选给出了不止一次({value})。请只给出 code、marketplace 或 authored 之一。', @@ -1815,6 +1817,7 @@ const STUDIO_ZH: Record = { 'engine.packages.detail.type': '类型', 'engine.packages.detail.description': '描述', 'engine.packages.detail.browseMetadata': '浏览此软件包的元数据', + 'engine.packages.detail.openInStudio': '在 Studio 中打开', 'engine.packages.detail.pendingChanges': '待发布更改', 'engine.packages.detail.pendingHint': '草稿尚未发布。可以发布整个应用,也可以逐项查看。', 'engine.packages.detail.publishApp': '发布应用({count})', From 38808d5214d6795fabcf05e244c2b63876d5c5fb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 08:05:05 +0000 Subject: [PATCH 2/6] test(platform-objects): the group_apps shell pin reads the Packages entry left there Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- .../src/apps/setup-packaged-actions-nav.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/platform-objects/src/apps/setup-packaged-actions-nav.test.ts b/packages/platform-objects/src/apps/setup-packaged-actions-nav.test.ts index ffab569c822..6c43f2c60a4 100644 --- a/packages/platform-objects/src/apps/setup-packaged-actions-nav.test.ts +++ b/packages/platform-objects/src/apps/setup-packaged-actions-nav.test.ts @@ -55,7 +55,13 @@ describe('Setup ships no packaged-automation page (ADR-0146 D4 as amended, D11)' expect(items.filter((i) => i.componentRef === 'automation:packaged-actions')).toEqual([]); }); + // The retired entries sat in `group_apps`. Since objectstack#36834 that group + // carries Setup's Packages entry, so the pin reads what is left there: no + // contribution emptied into a shell, and nothing but `nav_packages` + // (`setup-packages-door.test.ts` pins that entry itself). it('no contribution is an empty group_apps shell left behind', () => { - expect(SETUP_NAV_CONTRIBUTIONS.filter((c) => c.group === 'group_apps')).toEqual([]); + const apps = SETUP_NAV_CONTRIBUTIONS.filter((c) => c.group === 'group_apps'); + expect(apps.filter((c) => (c.items ?? []).length === 0)).toEqual([]); + expect(apps.flatMap((c) => (c.items as NavItem[]).map((i) => i.id))).toEqual(['nav_packages']); }); }); From cee3b23d8ce2cc78fef1de8b912b73eb94d1b211 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 08:25:16 +0000 Subject: [PATCH 3/6] test(console): pin the Packages page's administration face Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- .../PackagesPage.installedApps-13356.test.tsx | 42 ++- ...esPage.installedAppsUpdates-34722.test.tsx | 302 +++++++++++++++++- .../PackagesPage.source-12675.test.tsx | 10 +- 3 files changed, 323 insertions(+), 31 deletions(-) diff --git a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx index f4368e6fe7f..5e77fe208a0 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx @@ -1,17 +1,21 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. /** - * Setup → Installed Apps opens this page with `?source=marketplace` - * (objectui#13356): the nav item declares + * Setup → Installed Apps opened this page with `?source=marketplace` + * (objectui#13356): the nav item declared * `{ type: 'component', componentRef: 'developer:packages', params: { source: 'marketplace' } }` - * and the sidebar sends a component item's `params` as the query string. + * and the sidebar sends a component item's `params` as the query string. The + * entry retired with objectstack#36834 (Setup → Packages lists every source, + * with a Source filter), and its address still opens the list filtered. * - * - That view is titled "Installed Apps", the entry that opened it. + * - That address opens the administration face, titled "Packages" like every + * view of this list, its Source filter on marketplace (objectstack#36834). * - With no marketplace install, its empty state says no app is installed * from the marketplace yet, not that filters match nothing. * - "No packages match your filters." stays for a filter the viewer set: the * search hiding the marketplace installs that exist, or another Source. - * - Setup → Packages (no `source`) keeps its title and empty states. + * - The development surface (no `face`, no `source`) keeps its title, + * description and empty states. * * The wire is stubbed (`fetch`), the runtime config is the real module booted * over a served body, and `marketplaceApi` is not mocked. @@ -95,7 +99,7 @@ async function serve(packages: unknown[], ledger: unknown[] = []) { } const SETUP_BASE = '/apps/setup'; -/** Setup's Installed Apps entry as objectstack declares it. */ +/** Setup's retired Installed Apps entry as objectstack declared it: its address is still served. */ const INSTALLED_APPS_ITEM = { id: 'nav_installed_apps', type: 'component', @@ -131,18 +135,21 @@ afterEach(() => { resetRuntimeConfigForTesting(); }); -describe('Setup → Installed Apps (objectui#13356)', () => { +describe('the retired Installed Apps address (objectui#13356, objectstack#36834)', () => { it('the Installed Apps entry opens this page with `?source=marketplace`', () => { expect(installedAppsUrl()).toBe(`${PACKAGES_PATH}?source=marketplace`); }); - it('is titled "Installed Apps", not "Packages"', async () => { + it('opens the administration face, titled "Packages", filtered to marketplace installs', async () => { await serve([CODE, MARKET, AUTHORED], [LEDGER_TODO]); renderAt(installedAppsUrl()); - expect(await screen.findByRole('heading', { name: row('engine.packages.installedApps.title') })).toBeInTheDocument(); - expect(screen.queryByRole('heading', { name: row('engine.packages.title') })).toBeNull(); + expect(await screen.findByRole('heading', { name: row('engine.packages.title') })).toBeInTheDocument(); + expect(screen.getByText(row('engine.packages.admin.description'))).toBeInTheDocument(); expect(await screen.findByTestId('pkg-row-com.example.todo')).toBeInTheDocument(); + expect(screen.queryByTestId('pkg-row-com.acme.code')).toBeNull(); + expect(screen.queryByTestId('pkg-row-app.b2r4')).toBeNull(); + expect(screen.getByTestId('pkg-source-picker-marketplace')).toHaveAttribute('data-state', 'on'); }); it.each([ @@ -156,7 +163,7 @@ describe('Setup → Installed Apps (objectui#13356)', () => { expect(empty).toHaveTextContent(row('engine.packages.installedApps.empty')); expect(screen.queryByText(row('engine.packages.emptyFiltered'))).toBeNull(); expect(screen.queryByText(row('engine.packages.emptyCreate'))).toBeNull(); - expect(screen.getByRole('heading', { name: row('engine.packages.installedApps.title') })).toBeInTheDocument(); + expect(screen.getByRole('heading', { name: row('engine.packages.title') })).toBeInTheDocument(); }); it('a search that hides the marketplace installs that exist still says no package matches the filters', async () => { @@ -171,7 +178,7 @@ describe('Setup → Installed Apps (objectui#13356)', () => { it('reads in zh-CN from the catalogue rows', async () => { for (const key of [ - 'engine.packages.installedApps.title', + 'engine.packages.admin.description', 'engine.packages.installedApps.empty', 'engine.packages.installedApps.emptyHint', ]) { @@ -181,20 +188,23 @@ describe('Setup → Installed Apps (objectui#13356)', () => { await serve([CODE]); renderAt(installedAppsUrl(), 'zh'); - expect(await screen.findByRole('heading', { name: row('engine.packages.installedApps.title', 'zh') })).toBeInTheDocument(); + expect(await screen.findByRole('heading', { name: row('engine.packages.title', 'zh') })).toBeInTheDocument(); + expect(screen.getByText(row('engine.packages.admin.description', 'zh'))).toBeInTheDocument(); expect(await screen.findByTestId('packages-installed-apps-empty')).toHaveTextContent( row('engine.packages.installedApps.empty', 'zh'), ); }); }); -describe('Setup → Packages is unchanged (objectui#13356)', () => { - it('with no `source` it is titled "Packages"', async () => { +describe('the development surface is unchanged (objectui#13356)', () => { + it('with no `face` and no `source` it is titled "Packages", with the development description', async () => { await serve([CODE, MARKET], [LEDGER_TODO]); renderAt(PACKAGES_PATH); expect(await screen.findByRole('heading', { name: row('engine.packages.title') })).toBeInTheDocument(); - expect(screen.queryByRole('heading', { name: row('engine.packages.installedApps.title') })).toBeNull(); + expect(screen.getByText(row('engine.packages.description'))).toBeInTheDocument(); + expect(screen.queryByText(row('engine.packages.admin.description'))).toBeNull(); + expect(screen.queryByTestId('pkg-source-picker')).toBeNull(); }); it('with nothing installed it offers to create the first package', async () => { diff --git a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx index 20f9a14ee32..bf7461432cb 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedAppsUpdates-34722.test.tsx @@ -1,11 +1,14 @@ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. /** - * objectstack#34722 — Setup → Installed Apps is the administrator's door to - * this page (`?source=marketplace`), Studio → Packages the developer's (no - * `source`; ADR-0146 D1, ruling 甲 on objectstack#25098). + * objectstack#34722 — the administrator's face of this page, first drawn for + * marketplace installs (`?source=marketplace`, Setup's retired Installed Apps + * entry); Studio → Packages the developer's (no `face`; ADR-0146 D1). + * objectstack#36834 extends that face to every source: Setup → Packages opens + * it with `?face=admin` (see "Setup → Packages: the administration face" at + * the end of this file), and the old marketplace address still opens it. * - * On the Setup door: + * On the administration face: * - an installed app the catalog lists at a higher version draws the * marketplace's own "Update available → vX" badge (`UpdateAvailableBadge`, * decided by `updateTarget`), linked to the app's marketplace page, and the @@ -21,8 +24,8 @@ * - a module package (`type: 'module'` declaring its app in `dependencies`) * is folded under that app's line and shown on demand; * - the columns are Name, Version, Status, Source, Update, and the developer - * doors (Import, New Package, the platform switch, the Source chip's - * Show all) are not drawn. + * doors (Import, the platform switch, the Source chip's Show all) are not + * drawn; New Package is, and lands in Studio (objectstack#36834). * On the Studio door all of the developer doors and columns stay, and the * catalog is never asked. * @@ -55,6 +58,29 @@ vi.mock('@object-ui/i18n/namespaces/marketplace', async (importOriginal) => { }; }); +/** + * objectstack#36834 — the create dialog is the spec-driven package form, which + * this file does not drive: a stand-in answers its `onSaved` with a created id, + * so the case below reads what the PAGE does after a create. + */ +vi.mock('./PackageFormDialog', () => ({ + PackageFormDialog: ({ + open, + mode, + onSaved, + }: { + open: boolean; + mode: string; + onSaved?: (r: { id: string }) => void; + }) => + open && mode === 'create' ? ( + + ) : null, +})); + +import { resolveHref } from '@object-ui/layout'; import { PackagesPage, type InstalledPackageRow } from './PackagesPage'; import { t } from './i18n'; // The page's package form reaches the CEL authoring helpers, which load these @@ -129,6 +155,10 @@ const reply = (status: number, body: unknown) => new Response(JSON.stringify(body), { status, headers: { 'content-type': 'application/json' } }); let catalogReads: string[] = []; +/** Every non-GET request the page sent, as `METHOD path?query`. */ +let writes: string[] = []; +/** How many times the list door was read. */ +let packagesReads = 0; /** Boot the real runtime config, then serve the package, install and catalog doors. */ async function serve({ @@ -136,22 +166,40 @@ async function serve({ installs = LEDGER, catalog = LISTED, marketplace = true, + drafts = [], }: { packages: InstalledPackageRow[]; installs?: unknown[]; catalog?: Catalog; marketplace?: boolean; + /** What the pending-drafts door answers for any package. */ + drafts?: Array<{ type: string; name: string }>; }) { resetRuntimeConfigForTesting(); vi.stubGlobal('fetch', vi.fn(async () => reply(200, { features: { installLocal: true, marketplace } }))); await initRuntimeConfig(); catalogReads = []; + writes = []; + packagesReads = 0; vi.stubGlobal( 'fetch', vi.fn(async (input: unknown, init?: { method?: string }) => { - const path = new URL(String(input), 'http://console.test').pathname; + const url = new URL(String(input), 'http://console.test'); + const path = url.pathname; const method = (init?.method ?? 'GET').toUpperCase(); - if (path === '/api/v1/packages') return reply(200, { success: true, data: { packages } }); + if (method !== 'GET') writes.push(`${method} ${path}${url.search}`); + if (path === '/api/v1/packages') { + packagesReads += 1; + return reply(200, { success: true, data: { packages } }); + } + if (path === '/api/v1/meta/_drafts') return reply(200, { success: true, data: { drafts } }); + if (/^\/api\/v1\/packages\/[^/]+\/(enable|disable)$/.test(path) && method === 'PATCH') { + return reply(200, { success: true, data: {} }); + } + if (/^\/api\/v1\/packages\/[^/]+\/export$/.test(path)) return reply(200, { success: true, data: { id: 'x' } }); + if (/^\/api\/v1\/packages\/[^/]+$/.test(path) && method === 'DELETE') { + return reply(200, { success: true, data: {} }); + } if (path === '/api/v1/cloud-connection/installed') return reply(404, {}); if (path === '/api/v1/marketplace/install-local' && method === 'GET') { return reply(200, { success: true, data: { items: installs } }); @@ -181,12 +229,26 @@ function Where() { return
{pathname}
; } +/** The page's own query string, beside it: the URL state its filters write. */ +function Search() { + const { search } = useLocation(); + return
{search}
; +} + function renderAt(url: string, lang: 'en' | 'zh' = 'en') { return render( - } /> + + + + + } + /> } /> @@ -406,7 +468,7 @@ describe('Setup → Installed Apps: an app is one line, its modules folded under describe('the two doors (objectstack#34722)', () => { const headers = () => screen.getAllByRole('columnheader').map((h) => h.textContent?.trim()); - it('Setup → Installed Apps draws the administrator columns and none of the developer doors', async () => { + it('the administration face draws the administrator columns, New Package, and none of the developer doors', async () => { await serve({ packages: [HOTCRM, ...MODULES, TODO, CODE, PLATFORM] }); renderAt(SETUP_URL); await settled(); @@ -420,7 +482,9 @@ describe('the two doors (objectstack#34722)', () => { row('engine.packages.col.actions'), ]); expect(screen.queryByRole('button', { name: row('engine.packages.import') })).toBeNull(); - expect(screen.queryByRole('button', { name: row('engine.packages.new') })).toBeNull(); + // objectstack#36834 — New Package is the administration face's one header + // action; it lands in Studio (see the create case below). + expect(screen.getByRole('button', { name: row('engine.packages.new') })).toBeInTheDocument(); expect(screen.queryByTestId('pkg-show-platform')).toBeNull(); expect(screen.queryByTestId('pkg-source-filter')).toBeNull(); expect(screen.queryByRole('button', { name: row('engine.packages.source.showAll') })).toBeNull(); @@ -453,3 +517,219 @@ describe('the two doors (objectstack#34722)', () => { expect(screen.getByRole('button', { name: row('engine.packages.source.showAll') })).toBeInTheDocument(); }); }); + +// --------------------------------------------------------------------------- +// objectstack#36834 — Setup → Packages: the administration face, every source +// --------------------------------------------------------------------------- + +const ADMIN_URL = '/apps/setup/component/developer/packages?face=admin'; +/** Setup's Packages entry as `@objectstack/platform-objects` declares it (`setup-packages-door.test.ts`). */ +const SETUP_PACKAGES_ITEM = { + id: 'nav_packages', + type: 'component', + label: 'Packages', + componentRef: 'developer:packages', + params: { face: 'admin' }, +} as const; + +const AUTHORED: InstalledPackageRow = { + manifest: { id: 'app.b2r4', name: 'My Base', version: '0.1.0', type: 'app' }, + enabled: true, + source: 'authored', + writable: true, + disableable: true, +}; + +/** The query string the page holds, as a parsed map. */ +const query = () => new URLSearchParams(screen.getByTestId('search').textContent ?? ''); + +describe('Setup → Packages: the administration face (objectstack#36834)', () => { + it('the Setup entry opens this page with `?face=admin`', () => { + expect(resolveHref(SETUP_PACKAGES_ITEM as never, '/apps/setup').href).toBe(ADMIN_URL); + }); + + it('lists every source, one line per app, and no platform package', async () => { + await serve({ packages: [HOTCRM, ...MODULES, TODO, CODE, AUTHORED, PLATFORM] }); + renderAt(ADMIN_URL); + await settled(); + + expect(screen.getByRole('heading', { name: row('engine.packages.title') })).toBeInTheDocument(); + expect(screen.getByText(row('engine.packages.admin.description'))).toBeInTheDocument(); + for (const id of [HOTCRM_ID, 'com.example.todo', 'com.acme.code', 'app.b2r4']) { + expect(screen.getByTestId(`pkg-row-${id}`)).toBeInTheDocument(); + } + // Modules fold under their app; the platform package is not listed. + for (const id of MODULE_IDS) expect(screen.queryByTestId(`pkg-row-${id}`)).toBeNull(); + expect(screen.queryByTestId('pkg-row-com.objectstack.platform')).toBeNull(); + // Only a marketplace app is asked about, and only it can carry an Update cell. + expect(catalogReads.sort()).toEqual(['pkg_hotcrm', 'pkg_todo']); + expect(screen.getByTestId(`pkg-update-${HOTCRM_ID}`)).toBeInTheDocument(); + expect(screen.queryByTestId('pkg-update-reading-com.acme.code')).toBeNull(); + expect(screen.queryByTestId('pkg-update-reading-app.b2r4')).toBeNull(); + }); + + it('the Source filter writes `?source=` and keeps the face; All clears it', async () => { + await serve({ packages: [HOTCRM, TODO, CODE, AUTHORED] }); + renderAt(ADMIN_URL); + await settled(); + + expect(screen.getByTestId('pkg-source-picker-all')).toHaveAttribute('data-state', 'on'); + fireEvent.click(screen.getByTestId('pkg-source-picker-marketplace')); + await waitFor(() => expect(query().get('source')).toBe('marketplace')); + expect(query().get('face')).toBe('admin'); + expect(screen.getByTestId('pkg-source-picker-marketplace')).toHaveAttribute('data-state', 'on'); + expect(screen.queryByTestId('pkg-row-com.acme.code')).toBeNull(); + expect(screen.queryByTestId('pkg-row-app.b2r4')).toBeNull(); + expect(screen.getByTestId('pkg-row-com.example.todo')).toBeInTheDocument(); + + fireEvent.click(screen.getByTestId('pkg-source-picker-authored')); + await waitFor(() => expect(query().get('source')).toBe('authored')); + expect(await screen.findByTestId('pkg-row-app.b2r4')).toBeInTheDocument(); + expect(screen.queryByTestId('pkg-row-com.example.todo')).toBeNull(); + + fireEvent.click(screen.getByTestId('pkg-source-picker-all')); + await waitFor(() => expect(query().has('source')).toBe(false)); + expect(query().get('face')).toBe('admin'); + expect(await screen.findByTestId('pkg-row-com.acme.code')).toBeInTheDocument(); + }); + + it('the retired Installed Apps address still opens this face, filtered to marketplace', async () => { + await serve({ packages: [HOTCRM, TODO, CODE, AUTHORED] }); + renderAt(SETUP_URL); + await settled(); + + expect(screen.getByTestId('pkg-source-picker-marketplace')).toHaveAttribute('data-state', 'on'); + expect(screen.queryByTestId('pkg-row-com.acme.code')).toBeNull(); + expect(screen.queryByRole('button', { name: row('engine.packages.import') })).toBeNull(); + // Clearing the filter stays on the administration face. + fireEvent.click(screen.getByTestId('pkg-source-picker-all')); + await waitFor(() => expect(query().get('face')).toBe('admin')); + expect(await screen.findByTestId('pkg-row-com.acme.code')).toBeInTheDocument(); + expect(screen.queryByRole('button', { name: row('engine.packages.import') })).toBeNull(); + }); + + it('an unknown face is refused by name, not read as the development surface', async () => { + await serve({ packages: [CODE] }); + renderAt('/apps/setup/component/developer/packages?face=dev'); + + expect(await screen.findByTestId('packages-source-filter-error')).toHaveTextContent('dev'); + expect(screen.queryByTestId('pkg-row-com.acme.code')).toBeNull(); + }); + + const SHEET_AUTHORING = [ + 'engine.packages.detail.edit', + 'engine.packages.detail.publish', + 'engine.packages.detail.revert', + 'engine.packages.detail.export', + 'engine.packages.detail.duplicate', + 'engine.packages.detail.adoptOrphans', + ]; + + it('the detail sheet offers View info, Disable and Delete, and links an authored package to Studio', async () => { + await serve({ packages: [AUTHORED], drafts: [{ type: 'object', name: 'b2r4_task' }] }); + renderAt(ADMIN_URL); + fireEvent.click(await screen.findByTestId('pkg-row-app.b2r4')); + const sheet = await screen.findByRole('dialog'); + + expect(within(sheet).getByRole('button', { name: row('engine.packages.detail.viewInfo') })).toBeInTheDocument(); + expect(within(sheet).getByRole('button', { name: row('engine.packages.detail.disable') })).toBeInTheDocument(); + expect(within(sheet).getByRole('button', { name: row('engine.packages.detail.deletePackage') })).toBeInTheDocument(); + for (const key of SHEET_AUTHORING) { + expect(within(sheet).queryByRole('button', { name: row(key) }), key).toBeNull(); + } + // Pending changes (with their Publish / Discard) and the metadata browser + // are authoring: not on this face, though the package has a draft. + expect(within(sheet).queryByText(row('engine.packages.detail.pendingChanges'))).toBeNull(); + expect(within(sheet).queryByText(row('engine.packages.detail.browseMetadata'))).toBeNull(); + expect(within(sheet).getByTestId('pkg-detail-open-in-studio')).toHaveAttribute('href', '/studio/app.b2r4/data'); + }); + + it('CONTROL: the same package on the development surface keeps every authoring action', async () => { + await serve({ packages: [AUTHORED], drafts: [{ type: 'object', name: 'b2r4_task' }] }); + renderAt(STUDIO_URL); + fireEvent.click(await screen.findByTestId('pkg-row-app.b2r4')); + const sheet = await screen.findByRole('dialog'); + + for (const key of SHEET_AUTHORING) { + expect(within(sheet).getByRole('button', { name: row(key) }), key).toBeInTheDocument(); + } + expect(await within(sheet).findByText(row('engine.packages.detail.pendingChanges'))).toBeInTheDocument(); + expect(within(sheet).queryByTestId('pkg-detail-open-in-studio')).toBeNull(); + }); + + it('a code package offers no Studio link', async () => { + await serve({ packages: [{ ...CODE, disableable: true }] }); + renderAt(ADMIN_URL); + fireEvent.click(await screen.findByTestId('pkg-row-com.acme.code')); + const sheet = await screen.findByRole('dialog'); + expect(within(sheet).getByRole('button', { name: row('engine.packages.detail.disable') })).toBeInTheDocument(); + expect(within(sheet).queryByTestId('pkg-detail-open-in-studio')).toBeNull(); + }); + + it('Disable confirms, sends the disable door, and says so', async () => { + await serve({ packages: [AUTHORED] }); + renderAt(ADMIN_URL); + fireEvent.click(await screen.findByTestId('pkg-row-app.b2r4')); + const sheet = await screen.findByRole('dialog'); + fireEvent.click(within(sheet).getByRole('button', { name: row('engine.packages.detail.disable') })); + fireEvent.click(await screen.findByTestId('pkg-detail-disable-confirm')); + + expect(await screen.findByText(row('engine.packages.detail.disabled'))).toBeInTheDocument(); + expect(writes).toContain('PATCH /api/v1/packages/app.b2r4/disable'); + }); + + it.each([ + ['structure', '?keepData=true'], + ['all', ''], + ])('Delete keeps its keep-data choice (%s)', async (mode, qs) => { + await serve({ packages: [AUTHORED] }); + renderAt(ADMIN_URL); + fireEvent.click(await screen.findByTestId('pkg-row-app.b2r4')); + const sheet = await screen.findByRole('dialog'); + fireEvent.click(within(sheet).getByRole('button', { name: row('engine.packages.detail.deletePackage') })); + + fireEvent.click(await screen.findByTestId(`pkg-detail-delete-mode-${mode}`)); + fireEvent.change(screen.getByTestId('pkg-detail-delete-name-input'), { target: { value: 'My Base' } }); + fireEvent.click(screen.getByTestId('pkg-detail-delete-confirm')); + + await waitFor(() => expect(writes).toContain(`DELETE /api/v1/packages/app.b2r4${qs}`)); + await waitFor(() => expect(screen.queryByTestId('pkg-detail-delete-dialog')).toBeNull()); + }); + + it('New Package lands in Studio on the created package', async () => { + await serve({ packages: [CODE] }); + renderAt(ADMIN_URL); + await screen.findByTestId('pkg-row-com.acme.code'); + fireEvent.click(screen.getByRole('button', { name: row('engine.packages.new') })); + fireEvent.click(await screen.findByTestId('stub-create-save')); + + expect(await screen.findByTestId('where')).toHaveTextContent('/studio/app.fresh/data'); + }); + + it('CONTROL: New Package on the development surface stays on the list', async () => { + await serve({ packages: [CODE] }); + renderAt(STUDIO_URL); + await screen.findByTestId('pkg-row-com.acme.code'); + fireEvent.click(screen.getByRole('button', { name: row('engine.packages.new') })); + expect(packagesReads).toBe(1); + fireEvent.click(await screen.findByTestId('stub-create-save')); + + // The list is read again, and the page stays where it is. + await waitFor(() => expect(packagesReads).toBe(2)); + expect(screen.queryByTestId('where')).toBeNull(); + expect(screen.getByTestId('pkg-row-com.acme.code')).toBeInTheDocument(); + }); + + it('reads in zh-CN from the catalogue rows', async () => { + for (const key of [ + 'engine.packages.admin.description', + 'engine.packages.source.all', + 'engine.packages.detail.openInStudio', + 'engine.packages.face.unknown', + 'engine.packages.face.repeated', + ]) { + expect(row(key, 'zh'), `${key}: a missing zh row echoes the key back`).not.toBe(key); + expect(row(key, 'zh'), `${key}: the zh row must not be the English one`).not.toBe(row(key)); + } + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.source-12675.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.source-12675.test.tsx index 3e2358cc4c9..ad174bdcbca 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.source-12675.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.source-12675.test.tsx @@ -174,11 +174,13 @@ describe('Packages — marketplace capability present (objectui#12675)', () => { renderPackages('?source=marketplace'); expect(await drawnSources()).toEqual({ 'com.example.todo': 'marketplace' }); - // objectstack#34722 — that view is Setup's Installed Apps door, and its - // one click into the unfiltered developer list is gone (ruling 甲 on - // objectstack#25098); `PackagesPage.installedAppsUpdates-34722.test.tsx` - // pins the door. + // objectstack#34722 / objectstack#36834 — that address (Setup's retired + // Installed Apps entry) opens the administration face, whose Source + // filter replaces the chip and whose "All" stays on that face; it never + // clears into the developer list. `PackagesPage.installedAppsUpdates-34722.test.tsx` + // pins the face. expect(screen.queryByTestId('pkg-source-filter')).toBeNull(); + expect(screen.getByTestId('pkg-source-picker')).toBeInTheDocument(); }); it('another `?source=` shows only its rows, and Show all clears it', async () => { From d165c72012d4447e96799fb5f54074afdf7da67f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 08:27:09 +0000 Subject: [PATCH 4/6] chore: changeset for the Setup Packages entry Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- .changeset/36834-setup-packages-entry.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .changeset/36834-setup-packages-entry.md diff --git a/.changeset/36834-setup-packages-entry.md b/.changeset/36834-setup-packages-entry.md new file mode 100644 index 00000000000..58ca1a31e57 --- /dev/null +++ b/.changeset/36834-setup-packages-entry.md @@ -0,0 +1,17 @@ +--- +'@objectstack/platform-objects': patch +'@objectstack/cloud-connection': patch +'@object-ui/app-shell': patch +'@object-ui/i18n': patch +--- + +feat(console): Setup gets one Packages entry, the package list's administration face; the Installed Apps entry retires + +Clause-②: no +Metadata-protocol: none + +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. + +- **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. +- **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. +- **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. From bb10cd3592c933976afcce1838e24b5d1f984122 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 08:53:12 +0000 Subject: [PATCH 5/6] test(console): the Installed Apps address pin pays the CEL helpers' first load at collection Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- .../metadata-admin/PackagesPage.installedApps-13356.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx index 5e77fe208a0..ad307764e6d 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PackagesPage.installedApps-13356.test.tsx @@ -35,6 +35,11 @@ vi.mock('@object-ui/auth', async (importOriginal) => ({ import { resolveHref } from '@object-ui/layout'; import { PackagesPage, type InstalledPackageRow } from './PackagesPage'; import { t } from './i18n'; +// The page's package form reaches the CEL authoring helpers, which load these +// two lazily; loaded here so their first load is paid at import, not inside a +// test's clocked window. +import '@objectstack/formula'; +import '@objectstack/lint'; import { initRuntimeConfig, resetRuntimeConfigForTesting } from '../../runtime-config'; // The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio` // namespace, whose `zh` catalogue is fetched on demand (objectstack#25922). From 35bdb5bacfcdd68e0ddd025cb4a1db683a1e4524 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 10:19:54 +0000 Subject: [PATCH 6/6] test(cli): restate the served Setup tree count for the Packages entry Setup's admin tree in the both-halves wire pin grows from 35 to 37 ids: `group_apps` is served again and carries `nav_packages`. The history comment gains the line, the entry and its group are asserted by name, and the contribution count in the arithmetic is corrected to 29. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01WGufzhpykmQZe1yMupC2CU --- ...connect-agent-both-halves-wire.pin.test.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/cli/test/connect-agent-both-halves-wire.pin.test.ts b/packages/cli/test/connect-agent-both-halves-wire.pin.test.ts index 639691f771c..b56d1a5b46c 100644 --- a/packages/cli/test/connect-agent-both-halves-wire.pin.test.ts +++ b/packages/cli/test/connect-agent-both-halves-wire.pin.test.ts @@ -262,10 +262,9 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', ( expect(groupChildren(setupAllowed.body?.item, 'group_overview')) .toEqual(['nav_system_overview', 'nav_connect_agent']); // The Setup tree the platform admin is served BY THIS COMPOSITION: 9 - // authored groups less `group_approvals`, `group_integrations` and - // `group_apps`, which nothing in it contributes into and the filter - // collapses, plus the 27 entries `SETUP_NAV_CONTRIBUTIONS` carries, - // plus the MCP one. + // authored groups less `group_approvals` and `group_integrations`, + // which nothing in it contributes into and the filter collapses, plus + // the 29 entries `SETUP_NAV_CONTRIBUTIONS` carries, plus the MCP one. // (25 until #25098 moved the unfiltered Packages entry to Studio; 24 // until #30204 removed the Feature Flags entry with its namespace; 32 // 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', ( // Units of Measure entry, `nav_units_of_measure`, joined Configuration // (#35488); 32 until the working-calendar pair, `nav_work_calendars` // and `nav_work_calendar_exceptions`, joined it, ADR-0157; 34 until - // the public forms entry, `nav_public_forms`, joined it, #36444.) + // the public forms entry, `nav_public_forms`, joined it, #36444; 35 + // until objectstack#36834 gave Setup its Packages entry, + // `nav_packages`, in `group_apps`, so that group is served again: + // +2, `group_apps` and `nav_packages`.) // `nav_settings_branding` is not among them, and not because of a // tenancy wall (this harness boots none): since #24766 it is // contributed by `@objectstack/service-settings` together with the // `branding` namespace, offered only where no organization wall stands, // and this harness composes platform-objects and the MCP bundle alone. - expect(allowedIds).toHaveLength(35); + expect(allowedIds).toHaveLength(37); + expect(allowedIds).toContain('nav_packages'); + expect(groupChildren(setupAllowed.body?.item, 'group_apps')).toEqual(['nav_packages']); expect(allowedIds).toContain('nav_public_forms'); expect(allowedIds).toContain('nav_work_calendars'); expect(allowedIds).toContain('nav_work_calendar_exceptions'); @@ -314,8 +318,8 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', ( expect(withAccountHalf.statusCode).toBe(200); expect(withoutAccountHalf.statusCode).toBe(200); expect(navIds(withAccountHalf.body?.item)).toEqual(navIds(withoutAccountHalf.body?.item)); - // 35: the composition the count in the test above states. - expect(navIds(withAccountHalf.body?.item)).toHaveLength(35); + // 37: the composition the count in the test above states. + expect(navIds(withAccountHalf.body?.item)).toHaveLength(37); // The mechanism behind the invariance, asserted rather than assumed: // the bundle aims exactly one contribution at `setup` and one at