diff --git a/.changeset/37920-studio-menu-no-datasource-row.md b/.changeset/37920-studio-menu-no-datasource-row.md new file mode 100644 index 00000000000..92156829323 --- /dev/null +++ b/.changeset/37920-studio-menu-no-datasource-row.md @@ -0,0 +1,10 @@ +--- +'@object-ui/app-shell': patch +--- + +feat(studio): the Studio menu draws no datasource row; a connection is managed in Setup → Integrations alone + +Clause-②: no +Metadata-protocol: none + +The 平台 Platform group of App Studio's left menu no longer lists Datasources, in any scope (a package, the organization's flows, the cross-package leg), and neither does the ⌘K palette, which lists the menu's own entries. The type stays registered `system`, the 全部类型 All types directory still lists it, and its tile and every `datasource` URL in the area still open Setup's Datasources page. diff --git a/docs/adr/0084-application-builder-information-architecture.md b/docs/adr/0084-application-builder-information-architecture.md index 8c6d2acbd38..c12ee17aa99 100644 --- a/docs/adr/0084-application-builder-information-architecture.md +++ b/docs/adr/0084-application-builder-information-architecture.md @@ -193,8 +193,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack | **平台 Platform** | `system` | 3 | `email_template` 邮件模板 | 高级 | | **平台 Platform** | `system` | 4 | `translation` | 高级 | | **平台 Platform** | `system` | 5 | `api` | 高级 | -| **平台 Platform** | `system` | 6 | `datasource` | 高级 | -| **平台 Platform** | `system` | 7 | `external_catalog` | 高级 | +| **平台 Platform** | `system` | 6 | `external_catalog` | 高级 | +| **平台 Platform** | `system` | — | `datasource` | — | | **访问 Access** | `security` | 1 | `permission` 权限集 | 常用 | | **访问 Access** | `security` | 2 | `position` 岗位 | 常用 | | **访问 Access** | `security` | 3 | `assignment_rule` 分配规则 | 高级 | @@ -211,6 +211,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack *(Rewritten 2026-11-26, card [#37564](https://github.com/objectstack-ai/objectstack/issues/37564), which carries out [Amendment (2026-11-26)](#amendment-2026-11-26-moves) for two rows and decides nothing: `dataset` and `position`. `dataset` is registered `data` by the same change, so its row leaves 界面 UI, where it was seventh, for 数据 Data, where it is second, directly after `object`; each 数据 Data type behind it is one place later, and its tier is 常用. `position` keeps its place, and its tier is 常用. The registry holds the same 33 entries, and the rows now count 数据 Data 8 · 界面 UI 6 · 自动化 Automation 2 · 平台 Platform 7 · 访问 Access 6 · AI 4. The `datasource` row is not touched and `form` has no row yet: each is rewritten, or written, by the change that moves it.)* +*(Rewritten 2026-11-27, card [#37920](https://github.com/objectstack-ai/objectstack/issues/37920), which carries out [Amendment (2026-11-26)](#amendment-2026-11-26-moves) for one row and decides nothing: `datasource`. The menu draws no row for it by the same change, so its row is written as `field`'s is — no order, no tier, last in its group — and `external_catalog`, the one type that was behind it, is one place earlier, sixth. The type stays registered `system` and keeps its row in this table, so 平台 Platform still counts 7: six rows with an order, and this one.)* + The rows are in the menu's order: by group, then by **Order**, which counts inside a group. **Tier** is 常用 Common or 高级 Advanced. The Chinese word beside a registered name is the one the ruling or its proposal uses for that type; a type neither names in Chinese has none. `field` carries no order and no tier because it draws no row (the second reading below). The table is the registry read at one commit. **The rule above is what binds**: a type added to the registry, or given another domain there, moves in the menu without this table being edited, and where the two disagree the registry is right. *(Amended 2026-11-25: that sentence is about the Group and `domain` columns. The Order and Tier columns are read from no registry — they are decided in this record, and a type the table has no row for is drawn in 高级 Advanced, at the end of its group: [Amendment (2026-11-25)](#amendment-2026-11-25).)* diff --git a/ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx b/ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx index 929e316e8df..0ba943c7e13 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx @@ -68,7 +68,6 @@ import { Building2, CalendarClock, ChevronRight, - Database, File, FileText, Gauge, @@ -190,7 +189,6 @@ const STUDIO_MENU_TYPE_ICONS: Readonly> = { email_template: Mail, translation: Languages, api: Globe, - datasource: Database, external_catalog: Unplug, position: Users, assignment_rule: UserCog, diff --git a/ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx index 333111d48c2..2640af68d9f 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx @@ -260,7 +260,7 @@ describe("on a package, the palette lists the left menu and the package's items 'studio-entry type:dashboard', 'studio-entry type:flow', 'studio-entry orgFlows', - 'studio-entry type:datasource', + // objectstack#37920 — the menu draws no datasource row, so neither does the palette. 'studio-entry diagnostics', 'studio-entry type:permission', 'studio-entry type:position', diff --git a/ui/packages/app-shell/src/views/studio-design/studioMenuModel.test.ts b/ui/packages/app-shell/src/views/studio-design/studioMenuModel.test.ts index 649457193f8..35e09479a59 100644 --- a/ui/packages/app-shell/src/views/studio-design/studioMenuModel.test.ts +++ b/ui/packages/app-shell/src/views/studio-design/studioMenuModel.test.ts @@ -33,7 +33,7 @@ import { studioMenuScope, studioMenuTiers, } from './studioMenuModel'; -import { STUDIO_MENU_PLACEMENT } from './studioMenuPlacement'; +import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT } from './studioMenuPlacement'; import { studioMenuGroupLabel } from './studioMenuGroupLabel'; import { translateMetadataDomain } from '../metadata-admin/i18n'; // The zh rows of the menu's own names live in `@object-ui/i18n`'s lazily loaded `studio` namespace. @@ -61,21 +61,22 @@ describe('the menu groups (objectstack#36899, ADR-0084 amended)', () => { // objectstack#37565 — rewritten on purpose: the fourth entry that is not a type, the cross-package // environment directory, left the menu for Setup (ADR-0084, amended 2026-11-26, question 5). - it('a package: every type in its domain\'s group, and the three entries that are not a type', () => { + // objectstack#37920 — rewritten on purpose: the served `datasource` draws no row, so 平台 Platform + // holds diagnostics alone here (ADR-0084, amended 2026-11-26, decision 12). It was `type:datasource` + // first, opening Setup's Datasources page. + it('a package: every type in its domain\'s group but datasource, and the three entries that are not a type', () => { const menu = buildStudioMenu({ scope: studioMenuScope(PKG), types: TYPES, counts: { object: 4 } }); expect(keysOf(menu)).toEqual({ data: ['type:object'], ui: ['type:view'], automation: ['type:flow', 'orgFlows'], - system: ['type:datasource', 'diagnostics'], + system: ['diagnostics'], security: ['type:permission', 'owd'], ai: ['type:agent'], }); const entry = (key: string) => menu.flatMap((g) => g.entries).find((e) => e.key === key)!; expect(entry('type:object')).toMatchObject({ to: `/studio/${PKG}/metadata/object?package=${PKG}`, count: 4 }); expect(entry('type:view').count).toBeUndefined(); - // ADR-0146 D1 — runtime configuration is Setup's. - expect(entry('type:datasource').to).toBe('/apps/setup/metadata/datasource'); expect(entry('orgFlows').to).toBe('/studio/~org/metadata/flow?source=runtime'); expect(entry('diagnostics').to).toBe(`/studio/${PKG}/metadata/_diagnostics`); // objectstack#36905 — the overview's own route. @@ -130,6 +131,52 @@ describe('the menu groups (objectstack#36899, ADR-0084 amended)', () => { }); }); +// ADR-0084, amended 2026-11-26, decision 12: a connection is managed in Setup → Integrations alone. +describe('the menu draws no datasource row (objectstack#37920)', () => { + const served = [ + { type: 'api', domain: 'system' }, + { type: 'datasource', domain: 'system' }, + { type: 'external_catalog', domain: 'system' }, + ]; + + it('the type stays listable and draws no row: it is in the no-row set and has no placement row', () => { + expect(STUDIO_MENU_NO_ROW_TYPES.has('datasource')).toBe(true); + expect(STUDIO_MENU_PLACEMENT.map((row) => row.type)).not.toContain('datasource'); + }); + + it.each([PKG, '~org', '~all'])('%s: served, counted and settled, datasource draws no row; its neighbours do', (segment) => { + for (const setupDirectory of [true, false]) { + const menu = buildStudioMenu({ + scope: studioMenuScope(segment), + types: served, + counts: { datasource: 3, api: 1 }, + settled: true, + setupDirectory, + }); + const entries = menu.flatMap((g) => g.entries); + expect(entries.map((e) => e.type)).not.toContain('datasource'); + expect(entries.some((e) => e.to.includes('/apps/setup/metadata/datasource'))).toBe(false); + expect(menu.find((g) => g.group === 'system')!.entries.filter((e) => e.kind === 'type').map((e) => e.key)).toEqual([ + 'type:api', + 'type:external_catalog', + ]); + } + }); + + it('a package whose only system type is datasource draws 平台 Platform with diagnostics alone, in the fold', () => { + const menu = buildStudioMenu({ scope: studioMenuScope(PKG), types: [{ type: 'datasource', domain: 'system' }], counts: { datasource: 2 } }); + expect(keysOf(menu).system).toEqual(['diagnostics']); + expect(studioMenuTiers(menu).common.map((g) => g.group)).not.toContain('system'); + }); + + it('on ~org and ~all, a datasource alone leaves no 平台 Platform group', () => { + for (const segment of ['~org', '~all']) { + const menu = buildStudioMenu({ scope: studioMenuScope(segment), types: [{ type: 'datasource', domain: 'system' }], counts: {} }); + expect(menu.map((g) => g.group), segment).not.toContain('system'); + } + }); +}); + /** A package's served types in the server's order: by domain, then alphabetically by type. */ const SERVED = [ { type: 'dataset', domain: 'data' }, @@ -210,7 +257,7 @@ describe('the menu reads the placement table (objectstack#37201, ADR-0084 amende }); it('keeps every address and entry key: only the order and the tier are new', () => { - for (const e of entries.filter((x) => x.kind === 'type' && x.type !== 'datasource')) { + for (const e of entries.filter((x) => x.kind === 'type')) { expect(e.key).toBe(`type:${e.type}`); expect(e.to).toBe(`/studio/${PKG}/metadata/${e.type}?package=${PKG}`); } diff --git a/ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts b/ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts index b2a57519b4f..175317380d9 100644 --- a/ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts +++ b/ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts @@ -20,7 +20,9 @@ * `scopeDirectoryEntries`), plus every 常用 Common type * ({@link STUDIO_MENU_ALWAYS_TYPES}), so a package that holds no app, page, * dashboard, report, flow, permission set or agent still shows where the - * first is made. Each opens the type's list in the "All metadata" area, + * first is made. Not a type the menu draws no row for + * (`STUDIO_MENU_NO_ROW_TYPES`): `datasource`, managed in Setup → Integrations + * alone (ADR-0084, amended 2026-11-26, decision 12; objectstack#37920). Each opens the type's list in the "All metadata" area, * where an object, a flow and a permission set open their designers * full-screen (objectstack#36903-36905; objectstack#36909 retired the last of * the pillar redirects). @@ -79,7 +81,6 @@ */ import { ENVIRONMENT_SCOPE_QUERY } from '../metadata-admin/catalog-scope.js'; -import { SETUP_DATASOURCES_PATH } from '../metadata-admin/metadataAreaHost.js'; import { accessDirectoryPath } from '../setup/accessDirectory.js'; import { isStudioAllPackagesScope } from './metadataArea.js'; import { @@ -93,7 +94,7 @@ import { } from './studioAddress.js'; import { studioPackageOverviewPath } from './studioOverviewAddress.js'; import { isStudioOrgScope, studioOrgScopePath } from './studioScope.js'; -import { STUDIO_MENU_PLACEMENT, type StudioMenuTier } from './studioMenuPlacement.js'; +import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT, type StudioMenuTier } from './studioMenuPlacement.js'; export type { StudioMenuTier } from './studioMenuPlacement.js'; @@ -174,8 +175,6 @@ function typeEntryPath(scope: StudioMenuScope, type: string, setupDirectory: boo if (setupDirectory) return accessDirectoryPath(type); return studioMetadataAreaAddress(STUDIO_ALL_PACKAGES_SEGMENT, encodeURIComponent(type), { query: ENVIRONMENT_SCOPE_QUERY }); } - // ADR-0146 D1 — a datasource is Setup's runtime configuration, as its directory tile says. - if (type === 'datasource') return SETUP_DATASOURCES_PATH; return studioMetadataAreaAddress(scope.packageId, encodeURIComponent(type), { query: `package=${encodeURIComponent(scope.packageId)}`, }); @@ -188,7 +187,8 @@ const PLACEMENT_TIER: ReadonlyMap = new Map(STUDIO_MENU_ /** * The menu's groups and entries. `types` are the served type entries the * directory rule already scoped to this menu (`scopeDirectoryEntries`); a type - * whose domain is none of the six is not drawn. Inside a group the types + * whose domain is none of the six is not drawn, nor is a type the menu draws + * no row for (`STUDIO_MENU_NO_ROW_TYPES`), in any scope. Inside a group the types * follow the placement table, an unplaced type after the placed ones in * served order, then the entries that are not a type. `settled` says the * diagnostics sweep has answered, so a missing count means none. @@ -208,6 +208,7 @@ export function buildStudioMenu(input: { const rank = (type: string) => PLACEMENT_INDEX.get(type) ?? STUDIO_MENU_PLACEMENT.length; const placed = [...types].sort((a, b) => rank(a.type) - rank(b.type)); for (const t of placed) { + if (STUDIO_MENU_NO_ROW_TYPES.has(t.type)) continue; const entries = groups.get(t.domain as StudioMenuGroup); if (!entries) continue; const tier = PLACEMENT_TIER.get(t.type) ?? 'advanced'; diff --git a/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts b/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts index 6b50144bfc5..8b87445265a 100644 --- a/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts +++ b/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts @@ -7,8 +7,10 @@ * * Three holds: * - against `DEFAULT_METADATA_TYPE_REGISTRY`: every type the directory can - * list has exactly one row, and every row names a registered, listable - * type — so a newly registered type fails here until it is placed; + * list has exactly one row unless the menu draws no row for it + * (`STUDIO_MENU_NO_ROW_TYPES`: `datasource`, objectstack#37920), and every + * row names a registered, listable type — so a newly registered type fails + * here until it is placed; * - against the ruling: the rows, in order, with their tiers. The expected * values are literals, so a reordered or re-tiered row fails here, not in * the menu; @@ -23,13 +25,16 @@ import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; import { DEFAULT_METADATA_TYPE_REGISTRY } from '@objectstack/spec/kernel'; import { HIDDEN_DIRECTORY_TYPES } from '../metadata-admin/directoryScope.js'; -import { STUDIO_MENU_PLACEMENT } from './studioMenuPlacement.js'; +import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT } from './studioMenuPlacement.js'; /** The types a package's directory can list: every registered type it does not hide. */ -const LISTABLE_TYPES = DEFAULT_METADATA_TYPE_REGISTRY.map((entry) => entry.type).filter( +const DIRECTORY_TYPES = DEFAULT_METADATA_TYPE_REGISTRY.map((entry) => entry.type).filter( (type) => !HIDDEN_DIRECTORY_TYPES.has(type), ); +/** The types the menu draws a row for: every type the directory lists but the no-row ones. */ +const LISTABLE_TYPES = DIRECTORY_TYPES.filter((type) => !STUDIO_MENU_NO_ROW_TYPES.has(type)); + describe('the menu placement table agrees with the registry (objectstack#37200)', () => { it('every type the directory can list has exactly one row', () => { for (const type of LISTABLE_TYPES) { @@ -48,6 +53,15 @@ describe('the menu placement table agrees with the registry (objectstack#37200)' it('the rows and the listable types are the same set', () => { expect(STUDIO_MENU_PLACEMENT.map((row) => row.type).sort()).toEqual([...LISTABLE_TYPES].sort()); }); + + // ADR-0084, amended 2026-11-26, decision 12: the type stays registered `system` and the + // directory still lists it; like `field`, it is a type that draws no row. + it('datasource is a registered system type the directory lists, and it has no row (objectstack#37920)', () => { + expect([...STUDIO_MENU_NO_ROW_TYPES]).toEqual(['datasource']); + expect(DEFAULT_METADATA_TYPE_REGISTRY.find((entry) => entry.type === 'datasource')?.domain).toBe('system'); + expect(DIRECTORY_TYPES).toContain('datasource'); + expect(STUDIO_MENU_PLACEMENT.map((row) => row.type)).not.toContain('datasource'); + }); }); describe('the menu placement table holds the ruled order and tiers (objectstack#37200)', () => { @@ -66,7 +80,7 @@ describe('the menu placement table holds the ruled order and tiers (objectstack# 'picklist', 'hook', 'mapping', 'object_extension', 'seed', 'view', 'action', 'job', - 'doc', 'book', 'email_template', 'translation', 'api', 'datasource', 'external_catalog', + 'doc', 'book', 'email_template', 'translation', 'api', 'external_catalog', 'assignment_rule', 'sharing_rule', 'queue', 'capability', 'ai_context', 'knowledge_source', ]); @@ -184,6 +198,14 @@ describe('the groups the 2026-11-26 placements touch read as ADR-0084 lists them }); }); + // objectstack#37920 — the datasource row is gone; external_catalog closes up behind api. + it('平台 Platform: no 常用 type | doc · book · email_template · translation · api · external_catalog', () => { + expect(groupTiers('system')).toEqual({ + common: [], + advanced: ['doc', 'book', 'email_template', 'translation', 'api', 'external_catalog'], + }); + }); + it('访问 Access: permission · position | assignment_rule · sharing_rule · queue · capability', () => { expect(groupTiers('security')).toEqual({ common: ['permission', 'position'], diff --git a/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts b/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts index 73662352d66..d89da0ff965 100644 --- a/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts +++ b/ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts @@ -21,7 +21,17 @@ * * A type with no row here is drawn in `advanced`, at the end of its group. It * is never invisible: `buildStudioMenu` (`studioMenuModel.ts`) applies that - * rule when it reads this list (objectstack#37201). + * rule when it reads this list (objectstack#37201). The one exception is a + * type the menu draws no row for ({@link STUDIO_MENU_NO_ROW_TYPES}). + * + * ## Types that draw no row + * + * `datasource` is a listable type the menu draws no row for, in any scope + * (ADR-0084, amended 2026-11-26, decision 12; objectstack#37920): a connection + * is configuration bound to an environment, managed in Setup → Integrations + * alone. The type stays registered `system`; like `field`, which the + * directory already hides, it is a type that draws no row, so this list holds + * no row for it either. * * ## Placements by name * @@ -42,8 +52,8 @@ * * Three pins hold this list, all in `studioMenuPlacement.test.ts`: * - the registry: against `DEFAULT_METADATA_TYPE_REGISTRY`, every type the - * directory can list has exactly one row, and every row names a - * registered, listable type; + * directory can list has exactly one row unless the menu draws no row for + * it, and every row names a registered, listable type; * - the ruled order: the rows, in order, with their tiers, as literals * (ruling on #37192, and the placements by name of 2026-11-26), so a * reordered or re-tiered row fails there; @@ -101,7 +111,6 @@ export const STUDIO_MENU_PLACEMENT: readonly StudioMenuPlacementRow[] = Object.f { type: 'email_template', tier: 'advanced' }, { type: 'translation', tier: 'advanced' }, { type: 'api', tier: 'advanced' }, - { type: 'datasource', tier: 'advanced' }, { type: 'external_catalog', tier: 'advanced' }, // 高级 — security (访问) { type: 'assignment_rule', tier: 'advanced' }, @@ -112,3 +121,10 @@ export const STUDIO_MENU_PLACEMENT: readonly StudioMenuPlacementRow[] = Object.f { type: 'ai_context', tier: 'advanced' }, { type: 'knowledge_source', tier: 'advanced' }, ] as const satisfies readonly StudioMenuPlacementRow[]); + +/** + * Listable types the menu draws no row for, in any scope (ADR-0084, amended + * 2026-11-26, decision 12; objectstack#37920). Each has no row in + * {@link STUDIO_MENU_PLACEMENT}; `buildStudioMenu` drops it. + */ +export const STUDIO_MENU_NO_ROW_TYPES: ReadonlySet = new Set(['datasource']); diff --git a/ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts b/ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts index dd33dce439b..8ee02cfb581 100644 --- a/ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts +++ b/ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts @@ -53,8 +53,8 @@ export interface StudioPaletteGroup { /** * The types a package's palette reads no item of: a datasource is Setup's - * runtime configuration (ADR-0146 D1), so the menu's entry for it already - * leaves Studio and its items have no Studio page. + * runtime configuration (ADR-0146 D1), so the menu draws no row for it + * (objectstack#37920) and its items have no Studio page. */ export const STUDIO_PALETTE_ITEMLESS_TYPES: ReadonlySet = new Set(['datasource']);