Skip to content

Commit 7fbfd8f

Browse files
feat(studio): the Studio menu draws no datasource row, and ADR-0084 writes it as a no-row entry (#37945)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoCsxJcMyC43e5vqVhNB7PYu)_ Fixes #37920 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:App Studio 左侧菜单「平台」组里不再有「数据源」这一行,⌘K 搜索面板里也没有了;数据源只在「设置 › 集成」里管。「全部类型」目录仍列数据源,点开去设置。 - 为什么做:App Studio 改版专题里你的决定 12:连接是绑在环境上的配置,归设置管,Studio 只开发软件包。 - 出错会怎样:只少画菜单里的一行,不动数据、不动设置页,直接撤回即可恢复。 - 要你做什么:这个 PR 改了受管文档(架构决策记录 ADR-0084 的类型表一行),审核通过后请你或 os-zhuang 批准合并。 ## What changes - **The menu draws no `datasource` row, in any scope.** `studioMenuPlacement.ts` drops the row and adds `STUDIO_MENU_NO_ROW_TYPES = {'datasource'}`; `buildStudioMenu` skips a type in that set before it places anything, on a package, on `~org` and on `~all`. Removing the placement row alone would not do it: the menu's own rule draws a type with no row in 高级 at the end of its group ("never invisible", objectstack#37201), so the no-row set is the exception that rule now names. - **Retired, because they served only that row:** the `datasource` branch of `typeEntryPath` (it routed the row to Setup's Datasources page) with its `SETUP_DATASOURCES_PATH` import, and the row's `Database` icon in `StudioMenu.tsx`. - **The ⌘K palette follows.** It lists the menu's own entries (`buildStudioMenu`), so its `type:datasource` entry goes too; `StudioPaletteGroups.surfaceScope-36900.test.tsx` is re-pointed. - **What stays, and why:** `SETUP_DATASOURCES_PATH` (the directory tile and the area's `datasource/*` redirect read it); `STUDIO_PALETTE_ITEMLESS_TYPES` (the palette's item reads still run over the directory-scoped types, which include `datasource`, so it still keeps the palette from reading datasource items; only its docblock changes); the type's `system` registration; `HIDDEN_DIRECTORY_TYPES` (untouched). - **ADR-0084, the type → group table:** the `datasource` row becomes a no-row entry like `field`'s (`| — |` for Order and Tier, last in its group), `external_catalog` moves from 7 to 6, and one dated note under the table names this card. 平台 Platform still counts 7 table rows (six with an order, and `datasource`), so no count changes. Drafted by an isolated contract-review-tier subagent at effort xhigh. The stale whole-table counts and the `knowledge_source` row are #37740's, not this PR's. ### Card question (a): does 全部类型 still list `datasource`? Yes. Read on the booted showcase (this branch): `/studio/com.example.showcase/metadata` draws a Datasource tile linking to `/apps/setup/metadata/datasource` (`DirectoryPage.tsx`, `href={host && e.type === 'datasource' ? SETUP_DATASOURCES_PATH : undefined}`), because `scopeDirectoryEntries` hides only `field`, `package` and `form`. This matches ADR-0084: the amendment's sentence is "**The menu draws no `datasource` row**", about the menu alone; the directory keeps one entry for the type in 平台 Platform (one type, one group), and the tile leads to Setup, so a connection is still managed in Setup alone and nowhere in Studio. No mismatch to report; the directory is unchanged, as the claim requires. ## Tests - `studioMenuModel.test.ts`: a new block "the menu draws no datasource row" — on a package, `~org` and `~all`, with `setupDirectory` true and false, a served, counted, settled `datasource` draws no entry and no entry leads to Setup's Datasources page, while `api` and `external_catalog` beside it do; a package whose only `system` type is `datasource` draws 平台 Platform with diagnostics alone, in the fold; on `~org`/`~all` it leaves no 平台 Platform group. The package-scope keys test is rewritten on purpose (`system: ['diagnostics']`), marked in a comment. - `studioMenuPlacement.test.ts`: the registry pin reads "every listable type has one row, unless the menu draws no row for it"; a new pin says `datasource` is registered `system`, the directory lists it, and it has no row; the 高级 order literal drops it; a new 平台 Platform group pin; the ADR pin passes against the table as this PR leaves it. - Local, from `ui/`, under the verify lock: `npx vitest run packages/app-shell/src/views/studio-design/` — `Test Files 280 passed (280)`, `Tests 2322 passed (2322)`, `VERDICT command-exit 0`. `studioMenuPlacement.test.ts` alone on the final ADR text: 19 of 19, `VERDICT command-exit 0`. ## Acceptance notes - Two ADR-0084 sentences outside the table become dated history rather than live text, left as is (the card says no other ADR text): line ~463, "`datasource`'s and `form`'s still wait for their changes", and the 2026-11-25 silent item 1's order "`translation` · `api` · `datasource` · `external_catalog`". Both now point at, or are superseded by, the new note under the table. carrier: none — noted, not filed. ## Verification Read first, by risk: 1. `ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts`, `buildStudioMenu`: the one `continue` on `STUDIO_MENU_NO_ROW_TYPES`. 2. `docs/adr/0084-application-builder-information-architecture.md`, the 平台 Platform rows and the new note. 3. `studioMenuPlacement.test.ts`: `LISTABLE_TYPES` now excludes the no-row set. Two-minute check: `cd ui && npx vitest run packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts packages/app-shell/src/views/studio-design/studioMenuModel.test.ts` — both pass. Browser (showcase booted from this branch, `ui/` console over HMR, seeded admin): the showcase holds two datasources (`default`, `showcase_external`; `GET /api/v1/meta/datasource` 200). On `/studio/com.example.showcase/metadata/object` with the 高级 fold open, 平台 Platform reads Documentation 8 · Documentation Book 1 · Email Template 1 · API Endpoint 3 · Diagnostics, and no Datasources row; no other group lists it either. The screenshot is kept with the project thread (`card-37920/studio-menu-platform.png`). <details><summary>Local gates</summary> Derived with `node scripts/pm/dispatch-gates.mjs --commands` at a45fff4; reconciliation: "48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero)". - `node scripts/check-adr-0087-registration.mjs --base origin/main` :: exit 0 - `node scripts/check-adr-0087-registration.mjs --self-test` :: exit 0 - `node scripts/check-adr-links.mjs` :: exit 0 - `node scripts/check-adr-links.mjs --self-test` :: exit 0 - `node scripts/check-changeset-no-major.mjs --base origin/main` :: exit 0 - `node scripts/check-closing-keyword-parity.mjs` :: exit 0 - `node scripts/check-closing-keyword-parity.mjs --self-test` :: exit 0 - `node scripts/check-comment-mask-corpus.mjs` :: exit 0 - `node scripts/check-empty-changeset.mjs --base origin/main` :: exit 0 - `node scripts/check-empty-changeset.mjs --self-test` :: exit 0 - `node scripts/check-sdui-manifest.mjs` :: exit 0 - `node scripts/check-sdui-manifest.mjs --self-test` :: exit 0 - `node scripts/ci/plan-test-core-shards.mjs --self-test` :: exit 0 - `node scripts/ci/snapshot-next.mjs --self-test` :: exit 0 - `node scripts/pm/check-governed-queue-guard.mjs --self-test` :: exit 0 - `node scripts/pm/release-rehearsal-clone.mjs --self-test` :: exit 0 - `node scripts/release-pending-publish.mjs --self-test` :: exit 0 - `pnpm --filter @objectstack/lint run check:doc-formula-expressions` :: exit 0 - `pnpm --filter @objectstack/spec run check:duration-unit-keys` :: exit 0 - `pnpm check:adr-anchors` :: exit 0 - `pnpm check:adr-index` :: exit 0 - `pnpm check:adr-symbol-anchors` :: exit 0 - `pnpm check:changeset-gate-self-tests` :: exit 0 - `pnpm check:ci-filter-parity` :: exit 0 - `pnpm check:closed-ceremony-text` :: exit 0 - `pnpm check:cross-package-test-inputs` :: exit 0 - `pnpm check:dispatcher-error-vocabulary` :: exit 0 - `pnpm check:doc-authoring` :: exit 0 - `pnpm check:driver-memory-census` :: exit 0 - `pnpm check:engine-double-contract` :: exit 0 - `pnpm check:gitlink-declared` :: exit 0 - `pnpm check:nul-bytes` :: exit 0 - `pnpm check:pm-governed-merges` :: exit 0 - `pnpm check:pm-prior-rulings` :: exit 0 - `pnpm check:published-files` :: exit 0 - `pnpm check:query-options-erasure` :: exit 0 - `pnpm check:refd-timer-probe` :: exit 0 - `pnpm check:registry-log-declared` :: exit 0 - `pnpm check:rest-log-spy-declared` :: exit 0 - `pnpm check:skill-identifier-liveness` :: exit 0 - `pnpm check:test-source-alias` :: exit 0 - `pnpm check:tier-file-adoption` :: exit 0 - `pnpm check:type-check-coverage` :: exit 0 - `pnpm check:type-check-debt` :: exit 0 - `pnpm check:undeclared-dep-imports` :: exit 0 - `pnpm check:watch-hint-literal` :: exit 0 - `pnpm check:where-matcher` :: exit 0 - `pnpm --dir ui exec vitest run scripts/` :: exit 0 `node scripts/pm/overlap-check.mjs` at a45fff4: `VERDICT clean exit 0` (origin/main f926dfa merges cleanly; #37927, which shares the ADR file, merges cleanly). </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 73d0240 commit 7fbfd8f

9 files changed

Lines changed: 124 additions & 28 deletions
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
feat(studio): the Studio menu draws no datasource row; a connection is managed in Setup → Integrations alone
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
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.

‎docs/adr/0084-application-builder-information-architecture.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
193193
| **平台 Platform** | `system` | 3 | `email_template` 邮件模板 | 高级 |
194194
| **平台 Platform** | `system` | 4 | `translation` | 高级 |
195195
| **平台 Platform** | `system` | 5 | `api` | 高级 |
196-
| **平台 Platform** | `system` | 6 | `datasource` | 高级 |
197-
| **平台 Platform** | `system` | 7 | `external_catalog` | 高级 |
196+
| **平台 Platform** | `system` | 6 | `external_catalog` | 高级 |
197+
| **平台 Platform** | `system` | — | `datasource` | — |
198198
| **访问 Access** | `security` | 1 | `permission` 权限集 | 常用 |
199199
| **访问 Access** | `security` | 2 | `position` 岗位 | 常用 |
200200
| **访问 Access** | `security` | 3 | `assignment_rule` 分配规则 | 高级 |
@@ -211,6 +211,8 @@ Every type the spec registers, enumerated at `origin/main` `151e8123` from `pack
211211

212212
*(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.)*
213213

214+
*(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.)*
215+
214216
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).
215217

216218
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).)*

‎ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ import {
6868
Building2,
6969
CalendarClock,
7070
ChevronRight,
71-
Database,
7271
File,
7372
FileText,
7473
Gauge,
@@ -190,7 +189,6 @@ const STUDIO_MENU_TYPE_ICONS: Readonly<Record<string, LucideIcon>> = {
190189
email_template: Mail,
191190
translation: Languages,
192191
api: Globe,
193-
datasource: Database,
194192
external_catalog: Unplug,
195193
position: Users,
196194
assignment_rule: UserCog,

‎ui/packages/app-shell/src/views/studio-design/StudioPaletteGroups.surfaceScope-36900.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ describe("on a package, the palette lists the left menu and the package's items
260260
'studio-entry type:dashboard',
261261
'studio-entry type:flow',
262262
'studio-entry orgFlows',
263-
'studio-entry type:datasource',
263+
// objectstack#37920 — the menu draws no datasource row, so neither does the palette.
264264
'studio-entry diagnostics',
265265
'studio-entry type:permission',
266266
'studio-entry type:position',

‎ui/packages/app-shell/src/views/studio-design/studioMenuModel.test.ts‎

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
studioMenuScope,
3434
studioMenuTiers,
3535
} from './studioMenuModel';
36-
import { STUDIO_MENU_PLACEMENT } from './studioMenuPlacement';
36+
import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT } from './studioMenuPlacement';
3737
import { studioMenuGroupLabel } from './studioMenuGroupLabel';
3838
import { translateMetadataDomain } from '../metadata-admin/i18n';
3939
// 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)', () => {
6161

6262
// objectstack#37565 — rewritten on purpose: the fourth entry that is not a type, the cross-package
6363
// environment directory, left the menu for Setup (ADR-0084, amended 2026-11-26, question 5).
64-
it('a package: every type in its domain\'s group, and the three entries that are not a type', () => {
64+
// objectstack#37920 — rewritten on purpose: the served `datasource` draws no row, so 平台 Platform
65+
// holds diagnostics alone here (ADR-0084, amended 2026-11-26, decision 12). It was `type:datasource`
66+
// first, opening Setup's Datasources page.
67+
it('a package: every type in its domain\'s group but datasource, and the three entries that are not a type', () => {
6568
const menu = buildStudioMenu({ scope: studioMenuScope(PKG), types: TYPES, counts: { object: 4 } });
6669
expect(keysOf(menu)).toEqual({
6770
data: ['type:object'],
6871
ui: ['type:view'],
6972
automation: ['type:flow', 'orgFlows'],
70-
system: ['type:datasource', 'diagnostics'],
73+
system: ['diagnostics'],
7174
security: ['type:permission', 'owd'],
7275
ai: ['type:agent'],
7376
});
7477
const entry = (key: string) => menu.flatMap((g) => g.entries).find((e) => e.key === key)!;
7578
expect(entry('type:object')).toMatchObject({ to: `/studio/${PKG}/metadata/object?package=${PKG}`, count: 4 });
7679
expect(entry('type:view').count).toBeUndefined();
77-
// ADR-0146 D1 — runtime configuration is Setup's.
78-
expect(entry('type:datasource').to).toBe('/apps/setup/metadata/datasource');
7980
expect(entry('orgFlows').to).toBe('/studio/~org/metadata/flow?source=runtime');
8081
expect(entry('diagnostics').to).toBe(`/studio/${PKG}/metadata/_diagnostics`);
8182
// objectstack#36905 — the overview's own route.
@@ -130,6 +131,52 @@ describe('the menu groups (objectstack#36899, ADR-0084 amended)', () => {
130131
});
131132
});
132133

134+
// ADR-0084, amended 2026-11-26, decision 12: a connection is managed in Setup → Integrations alone.
135+
describe('the menu draws no datasource row (objectstack#37920)', () => {
136+
const served = [
137+
{ type: 'api', domain: 'system' },
138+
{ type: 'datasource', domain: 'system' },
139+
{ type: 'external_catalog', domain: 'system' },
140+
];
141+
142+
it('the type stays listable and draws no row: it is in the no-row set and has no placement row', () => {
143+
expect(STUDIO_MENU_NO_ROW_TYPES.has('datasource')).toBe(true);
144+
expect(STUDIO_MENU_PLACEMENT.map((row) => row.type)).not.toContain('datasource');
145+
});
146+
147+
it.each([PKG, '~org', '~all'])('%s: served, counted and settled, datasource draws no row; its neighbours do', (segment) => {
148+
for (const setupDirectory of [true, false]) {
149+
const menu = buildStudioMenu({
150+
scope: studioMenuScope(segment),
151+
types: served,
152+
counts: { datasource: 3, api: 1 },
153+
settled: true,
154+
setupDirectory,
155+
});
156+
const entries = menu.flatMap((g) => g.entries);
157+
expect(entries.map((e) => e.type)).not.toContain('datasource');
158+
expect(entries.some((e) => e.to.includes('/apps/setup/metadata/datasource'))).toBe(false);
159+
expect(menu.find((g) => g.group === 'system')!.entries.filter((e) => e.kind === 'type').map((e) => e.key)).toEqual([
160+
'type:api',
161+
'type:external_catalog',
162+
]);
163+
}
164+
});
165+
166+
it('a package whose only system type is datasource draws 平台 Platform with diagnostics alone, in the fold', () => {
167+
const menu = buildStudioMenu({ scope: studioMenuScope(PKG), types: [{ type: 'datasource', domain: 'system' }], counts: { datasource: 2 } });
168+
expect(keysOf(menu).system).toEqual(['diagnostics']);
169+
expect(studioMenuTiers(menu).common.map((g) => g.group)).not.toContain('system');
170+
});
171+
172+
it('on ~org and ~all, a datasource alone leaves no 平台 Platform group', () => {
173+
for (const segment of ['~org', '~all']) {
174+
const menu = buildStudioMenu({ scope: studioMenuScope(segment), types: [{ type: 'datasource', domain: 'system' }], counts: {} });
175+
expect(menu.map((g) => g.group), segment).not.toContain('system');
176+
}
177+
});
178+
});
179+
133180
/** A package's served types in the server's order: by domain, then alphabetically by type. */
134181
const SERVED = [
135182
{ type: 'dataset', domain: 'data' },
@@ -210,7 +257,7 @@ describe('the menu reads the placement table (objectstack#37201, ADR-0084 amende
210257
});
211258

212259
it('keeps every address and entry key: only the order and the tier are new', () => {
213-
for (const e of entries.filter((x) => x.kind === 'type' && x.type !== 'datasource')) {
260+
for (const e of entries.filter((x) => x.kind === 'type')) {
214261
expect(e.key).toBe(`type:${e.type}`);
215262
expect(e.to).toBe(`/studio/${PKG}/metadata/${e.type}?package=${PKG}`);
216263
}

‎ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
* `scopeDirectoryEntries`), plus every 常用 Common type
2121
* ({@link STUDIO_MENU_ALWAYS_TYPES}), so a package that holds no app, page,
2222
* dashboard, report, flow, permission set or agent still shows where the
23-
* first is made. Each opens the type's list in the "All metadata" area,
23+
* first is made. Not a type the menu draws no row for
24+
* (`STUDIO_MENU_NO_ROW_TYPES`): `datasource`, managed in Setup → Integrations
25+
* alone (ADR-0084, amended 2026-11-26, decision 12; objectstack#37920). Each opens the type's list in the "All metadata" area,
2426
* where an object, a flow and a permission set open their designers
2527
* full-screen (objectstack#36903-36905; objectstack#36909 retired the last of
2628
* the pillar redirects).
@@ -79,7 +81,6 @@
7981
*/
8082

8183
import { ENVIRONMENT_SCOPE_QUERY } from '../metadata-admin/catalog-scope.js';
82-
import { SETUP_DATASOURCES_PATH } from '../metadata-admin/metadataAreaHost.js';
8384
import { accessDirectoryPath } from '../setup/accessDirectory.js';
8485
import { isStudioAllPackagesScope } from './metadataArea.js';
8586
import {
@@ -93,7 +94,7 @@ import {
9394
} from './studioAddress.js';
9495
import { studioPackageOverviewPath } from './studioOverviewAddress.js';
9596
import { isStudioOrgScope, studioOrgScopePath } from './studioScope.js';
96-
import { STUDIO_MENU_PLACEMENT, type StudioMenuTier } from './studioMenuPlacement.js';
97+
import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT, type StudioMenuTier } from './studioMenuPlacement.js';
9798

9899
export type { StudioMenuTier } from './studioMenuPlacement.js';
99100

@@ -174,8 +175,6 @@ function typeEntryPath(scope: StudioMenuScope, type: string, setupDirectory: boo
174175
if (setupDirectory) return accessDirectoryPath(type);
175176
return studioMetadataAreaAddress(STUDIO_ALL_PACKAGES_SEGMENT, encodeURIComponent(type), { query: ENVIRONMENT_SCOPE_QUERY });
176177
}
177-
// ADR-0146 D1 — a datasource is Setup's runtime configuration, as its directory tile says.
178-
if (type === 'datasource') return SETUP_DATASOURCES_PATH;
179178
return studioMetadataAreaAddress(scope.packageId, encodeURIComponent(type), {
180179
query: `package=${encodeURIComponent(scope.packageId)}`,
181180
});
@@ -188,7 +187,8 @@ const PLACEMENT_TIER: ReadonlyMap<string, StudioMenuTier> = new Map(STUDIO_MENU_
188187
/**
189188
* The menu's groups and entries. `types` are the served type entries the
190189
* directory rule already scoped to this menu (`scopeDirectoryEntries`); a type
191-
* whose domain is none of the six is not drawn. Inside a group the types
190+
* whose domain is none of the six is not drawn, nor is a type the menu draws
191+
* no row for (`STUDIO_MENU_NO_ROW_TYPES`), in any scope. Inside a group the types
192192
* follow the placement table, an unplaced type after the placed ones in
193193
* served order, then the entries that are not a type. `settled` says the
194194
* diagnostics sweep has answered, so a missing count means none.
@@ -208,6 +208,7 @@ export function buildStudioMenu(input: {
208208
const rank = (type: string) => PLACEMENT_INDEX.get(type) ?? STUDIO_MENU_PLACEMENT.length;
209209
const placed = [...types].sort((a, b) => rank(a.type) - rank(b.type));
210210
for (const t of placed) {
211+
if (STUDIO_MENU_NO_ROW_TYPES.has(t.type)) continue;
211212
const entries = groups.get(t.domain as StudioMenuGroup);
212213
if (!entries) continue;
213214
const tier = PLACEMENT_TIER.get(t.type) ?? 'advanced';

‎ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts‎

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
*
88
* Three holds:
99
* - against `DEFAULT_METADATA_TYPE_REGISTRY`: every type the directory can
10-
* list has exactly one row, and every row names a registered, listable
11-
* type — so a newly registered type fails here until it is placed;
10+
* list has exactly one row unless the menu draws no row for it
11+
* (`STUDIO_MENU_NO_ROW_TYPES`: `datasource`, objectstack#37920), and every
12+
* row names a registered, listable type — so a newly registered type fails
13+
* here until it is placed;
1214
* - against the ruling: the rows, in order, with their tiers. The expected
1315
* values are literals, so a reordered or re-tiered row fails here, not in
1416
* the menu;
@@ -23,13 +25,16 @@ import { dirname, resolve } from 'node:path';
2325
import { fileURLToPath } from 'node:url';
2426
import { DEFAULT_METADATA_TYPE_REGISTRY } from '@objectstack/spec/kernel';
2527
import { HIDDEN_DIRECTORY_TYPES } from '../metadata-admin/directoryScope.js';
26-
import { STUDIO_MENU_PLACEMENT } from './studioMenuPlacement.js';
28+
import { STUDIO_MENU_NO_ROW_TYPES, STUDIO_MENU_PLACEMENT } from './studioMenuPlacement.js';
2729

2830
/** The types a package's directory can list: every registered type it does not hide. */
29-
const LISTABLE_TYPES = DEFAULT_METADATA_TYPE_REGISTRY.map((entry) => entry.type).filter(
31+
const DIRECTORY_TYPES = DEFAULT_METADATA_TYPE_REGISTRY.map((entry) => entry.type).filter(
3032
(type) => !HIDDEN_DIRECTORY_TYPES.has(type),
3133
);
3234

35+
/** The types the menu draws a row for: every type the directory lists but the no-row ones. */
36+
const LISTABLE_TYPES = DIRECTORY_TYPES.filter((type) => !STUDIO_MENU_NO_ROW_TYPES.has(type));
37+
3338
describe('the menu placement table agrees with the registry (objectstack#37200)', () => {
3439
it('every type the directory can list has exactly one row', () => {
3540
for (const type of LISTABLE_TYPES) {
@@ -48,6 +53,15 @@ describe('the menu placement table agrees with the registry (objectstack#37200)'
4853
it('the rows and the listable types are the same set', () => {
4954
expect(STUDIO_MENU_PLACEMENT.map((row) => row.type).sort()).toEqual([...LISTABLE_TYPES].sort());
5055
});
56+
57+
// ADR-0084, amended 2026-11-26, decision 12: the type stays registered `system` and the
58+
// directory still lists it; like `field`, it is a type that draws no row.
59+
it('datasource is a registered system type the directory lists, and it has no row (objectstack#37920)', () => {
60+
expect([...STUDIO_MENU_NO_ROW_TYPES]).toEqual(['datasource']);
61+
expect(DEFAULT_METADATA_TYPE_REGISTRY.find((entry) => entry.type === 'datasource')?.domain).toBe('system');
62+
expect(DIRECTORY_TYPES).toContain('datasource');
63+
expect(STUDIO_MENU_PLACEMENT.map((row) => row.type)).not.toContain('datasource');
64+
});
5165
});
5266

5367
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#
6680
'picklist', 'hook', 'mapping', 'object_extension', 'seed',
6781
'view', 'action',
6882
'job',
69-
'doc', 'book', 'email_template', 'translation', 'api', 'datasource', 'external_catalog',
83+
'doc', 'book', 'email_template', 'translation', 'api', 'external_catalog',
7084
'assignment_rule', 'sharing_rule', 'queue', 'capability',
7185
'ai_context', 'knowledge_source',
7286
]);
@@ -184,6 +198,14 @@ describe('the groups the 2026-11-26 placements touch read as ADR-0084 lists them
184198
});
185199
});
186200

201+
// objectstack#37920 — the datasource row is gone; external_catalog closes up behind api.
202+
it('平台 Platform: no 常用 type | doc · book · email_template · translation · api · external_catalog', () => {
203+
expect(groupTiers('system')).toEqual({
204+
common: [],
205+
advanced: ['doc', 'book', 'email_template', 'translation', 'api', 'external_catalog'],
206+
});
207+
});
208+
187209
it('访问 Access: permission · position | assignment_rule · sharing_rule · queue · capability', () => {
188210
expect(groupTiers('security')).toEqual({
189211
common: ['permission', 'position'],

‎ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts‎

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,17 @@
2121
*
2222
* A type with no row here is drawn in `advanced`, at the end of its group. It
2323
* is never invisible: `buildStudioMenu` (`studioMenuModel.ts`) applies that
24-
* rule when it reads this list (objectstack#37201).
24+
* rule when it reads this list (objectstack#37201). The one exception is a
25+
* type the menu draws no row for ({@link STUDIO_MENU_NO_ROW_TYPES}).
26+
*
27+
* ## Types that draw no row
28+
*
29+
* `datasource` is a listable type the menu draws no row for, in any scope
30+
* (ADR-0084, amended 2026-11-26, decision 12; objectstack#37920): a connection
31+
* is configuration bound to an environment, managed in Setup → Integrations
32+
* alone. The type stays registered `system`; like `field`, which the
33+
* directory already hides, it is a type that draws no row, so this list holds
34+
* no row for it either.
2535
*
2636
* ## Placements by name
2737
*
@@ -42,8 +52,8 @@
4252
*
4353
* Three pins hold this list, all in `studioMenuPlacement.test.ts`:
4454
* - the registry: against `DEFAULT_METADATA_TYPE_REGISTRY`, every type the
45-
* directory can list has exactly one row, and every row names a
46-
* registered, listable type;
55+
* directory can list has exactly one row unless the menu draws no row for
56+
* it, and every row names a registered, listable type;
4757
* - the ruled order: the rows, in order, with their tiers, as literals
4858
* (ruling on #37192, and the placements by name of 2026-11-26), so a
4959
* reordered or re-tiered row fails there;
@@ -101,7 +111,6 @@ export const STUDIO_MENU_PLACEMENT: readonly StudioMenuPlacementRow[] = Object.f
101111
{ type: 'email_template', tier: 'advanced' },
102112
{ type: 'translation', tier: 'advanced' },
103113
{ type: 'api', tier: 'advanced' },
104-
{ type: 'datasource', tier: 'advanced' },
105114
{ type: 'external_catalog', tier: 'advanced' },
106115
// 高级 — security (访问)
107116
{ type: 'assignment_rule', tier: 'advanced' },
@@ -112,3 +121,10 @@ export const STUDIO_MENU_PLACEMENT: readonly StudioMenuPlacementRow[] = Object.f
112121
{ type: 'ai_context', tier: 'advanced' },
113122
{ type: 'knowledge_source', tier: 'advanced' },
114123
] as const satisfies readonly StudioMenuPlacementRow[]);
124+
125+
/**
126+
* Listable types the menu draws no row for, in any scope (ADR-0084, amended
127+
* 2026-11-26, decision 12; objectstack#37920). Each has no row in
128+
* {@link STUDIO_MENU_PLACEMENT}; `buildStudioMenu` drops it.
129+
*/
130+
export const STUDIO_MENU_NO_ROW_TYPES: ReadonlySet<string> = new Set(['datasource']);

‎ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export interface StudioPaletteGroup {
5353

5454
/**
5555
* The types a package's palette reads no item of: a datasource is Setup's
56-
* runtime configuration (ADR-0146 D1), so the menu's entry for it already
57-
* leaves Studio and its items have no Studio page.
56+
* runtime configuration (ADR-0146 D1), so the menu draws no row for it
57+
* (objectstack#37920) and its items have no Studio page.
5858
*/
5959
export const STUDIO_PALETTE_ITEMLESS_TYPES: ReadonlySet<string> = new Set(['datasource']);
6060

0 commit comments

Comments
 (0)