Skip to content

feat(studio): the Studio menu draws no datasource row, and ADR-0084 writes it as a no-row entry - #37945

Draft
objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-f9vtm5
Draft

objectstack-fleet[bot] wants to merge 2 commits into
mainfrom
claude/project-thread-f9vtm5

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

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 ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #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).

Local gates

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT


Generated by Claude Code

The 平台 Platform group of App Studio's menu no longer lists Datasources, in
any scope; a connection is managed in Setup → Integrations alone (ADR-0084,
amended 2026-11-26, decision 12). The type stays registered `system` and the
type directory still lists it. ADR-0084's type → group table writes the
`datasource` row as a no-row entry like `field`'s, with a dated note.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibwtMGwDL8KdXqqaLLT
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwsYQqi3TBx2SFE978

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a45fff40937848fa7bf213fb61674d480ab66881
Local-runs: none
Scope: docs/adr/0084-application-builder-information-architecture.md + ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.ts, ui/packages/app-shell/src/views/studio-design/studioMenuModel.ts, ui/packages/app-shell/src/views/studio-design/studioMenuPlacement.test.ts, ui/packages/app-shell/src/views/studio-design/studioPaletteModel.ts, ui/packages/app-shell/src/views/studio-design/StudioMenu.tsx
Security-touching: no
Rule-change-verified: none

PR #37945, card #37920, net diff against main (merge base 73d5e347; main has since added three lines to ADR-0084 in the top-bar table near line 410, card #37685, a different section from this PR's hunks at lines 193-214). Read-only: the card with its four comments, decision 12 on #37424, the PR body, file list and diff, the tree at the head via git show, and the head's check-runs.

Check-runs on this head, read at review time. Completed and green: Auto Label, Dogfood Regression Gate, Plan Test Core shards, Build UI Deps, Check Documentation Links, Type Check · workspace, Check PR Size, PR-body guards, Governed Surface Queue Guard, filter. Skipped by the workflow's own planning: UI Published Artifacts, Build Core, Dogfood Verify CLI, Build Docs, the matrix Dogfood shard, Temporal Conformance, the two opt-in harnesses, Queue verdict, Borrowed queue verdict, Schedule gate. No check has failed. STILL PENDING, not waited on: Test UI 1/16 to 9/16 (the shards that run the two test files this record leans on), Test Core 1/10, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset (not yet completed at the first read), Type Check · source gates, Type Check · consumer gates, Lint · ESLint, Lint · scoped · tooling self-tests, Lint · scoped · slot lookup & corpus, Lint · scoped · query-options erasure, Lint · CI, release & engine gates, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates. This PASS is a design verdict on the tree; it does not stand in for those conclusions, and the queue reads them itself.

① Derived judgments

  • Accept-set: none changes. No spec schema, no registry entry, no authorable key is touched; datasource stays registered system in DEFAULT_METADATA_TYPE_REGISTRY (the new test pins it). Right.
  • Menu surface: buildStudioMenu emits no type:datasource entry on a package, on ~org or on ~all, with setupDirectory true or false. That is decision 12's sentence ("the Studio menu drops the datasource entry") and ADR-0084 line 446 ("The menu draws no datasource row"). Right.
  • Palette surface: StudioPaletteGroups.tsx:171 builds its groups from buildStudioMenu(...), so the studio-entry type:datasource row leaves the ⌘K palette with no palette code change. Right, and a consequence the ADR sentence implies (the palette lists the menu's own entries).
  • Module surface: one new export, STUDIO_MENU_NO_ROW_TYPES, in studioMenuPlacement.ts; typeEntryPath loses its datasource branch and the module its SETUP_DATASOURCES_PATH import. Neither file is re-exported from the package index. Right.
  • Unchanged, and rightly so: HIDDEN_DIRECTORY_TYPES (field, package, form), so the 全部类型 directory still lists the type; DirectoryPage.tsx:415 and the datasource/* route in StudioMetadataArea.tsx:493, both still reading SETUP_DATASOURCES_PATH; STUDIO_PALETTE_ITEMLESS_TYPES, still read at StudioPaletteGroups.tsx:87 over the directory-scoped types, which include datasource.

② Semver level

.changeset/37920-studio-menu-no-datasource-row.md: @object-ui/app-shell patch, Clause-②: no, Metadata-protocol: none. The diff publishes from that one package; nothing a metadata author can write changes, so the kind is none and the level is patch (AGENTS.md: "none takes patch; a non-protocol change ... ships patch"). No removed public export, so no BREAKING banner is owed. The PR body carries the same two lines.

Clause-②: no — agreed; no accept-set widens or narrows.

The changeset's last sentence ("its tile and every datasource URL in the area still open Setup's Datasources page") is true of the tree. The Check Changeset run had not completed at the first read.

③ Boundary flags

  • PR body, Acceptance notes — two ADR sentences outside the table left as dated history. Read both. Line 463's amendment note ("datasource's and form's still wait for their changes — the note under the table") is dated 2026-11-26 and links the very block where this PR's 2026-11-27 note now sits, so a reader following it lands on the correction. The 2026-11-25 silent item 1's order "translation · api · datasource · external_catalog" records how the Order column was derived on that date; the table and its new note now supersede it for datasource. Both are dated statements, not live rules, and the card says "No other ADR text". Answered: leaving them is correct; no carrier needed.
  • Card question (a) — answered from the code and the answer holds. scopeDirectoryEntries hides only field, package, form; DirectoryPage.tsx:415 gives the datasource tile SETUP_DATASOURCES_PATH. ADR-0084's sentence is about the menu; the type keeps one group (平台 Platform) in the directory and its tile leaves Studio, so a connection is still managed in Setup alone. No mismatch.
  • Seat scope amendment 2 — the stale "33 entries" / "AI 4" counts and the knowledge_source row are ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740's. Verified: the ADR diff is exactly two rewritten table rows (lines 196-197) and one added note (line 214). Lines 208 (knowledge_source), 210 and 212 (the counts) are byte-identical to main. The new note restates only the 平台 Platform count (7), which the card allows ("the table's count note if one names the 平台 Platform rows") and which is true.
  • open_questions in the dev report: empty. The report's two out_of_scope_findings are the two flags above.
  • Card acceptance, "A screenshot of the 平台 group on the PR": the PR body describes the browser read and says the image is kept with the project thread, not attached to the PR. Outside ④'s scope; left to the lane seat's ACCEPT.
  • SQL push-down: not applicable. The diff is a pure in-memory menu model, a doc and tests; no query, no id materialisation, no join.

④ Design judgment

No must-fix, no should-fix.

docs/adr/0084-application-builder-information-architecture.md (hits)

  • Against its ruling: decision 12 on 专题:App Studio 改版(Studio 是开发软件包的入口:左右两栏、软件包切换和概览页、列表页按前端样式、专用色和新名字) #37424 reads "Datasources are managed only in Setup → Integrations. A connection is environment-bound configuration, so the Studio menu drops the datasource entry (task 6)." The ADR already carries it at line 446 and line 487; this PR only carries the table out, as line 463 says a row is rewritten "in the change that moves it — the same pull request". Holds.
  • Row form: | **平台 Platform** | system| — |datasource | — | is cell for cell the form of | **数据 Data** | data| — |field | — |, and like it sits last in its group. Holds.
  • external_catalog 7 to 6: the ADR's 平台 Platform orders now read doc 1, book 2, email_template 3, translation 4, api 5, external_catalog 6; STUDIO_MENU_PLACEMENT's system rows read doc, book, email_template, translation, api, external_catalog. Same sequence.
  • "Never invisible" (line 308, objectstack#37201): the ADR's rule is "A type with no row in the table is drawn in 高级, at the end of its group. It is never invisible." As the ADR writes it, the trigger is a type the TABLE has no row for. datasource keeps a row in the table, written with no order and no tier, which is the ADR's own notation for "draws no row" (line 216, and line 446: "like field, it is a type that draws no row"). So the exception does not contradict the rule as written, and it IS written in the ADR: line 446 (the amendment), line 487 (the stands/replaced table) and now the table row and its note. The type also stays reachable from the fold's 全部类型 row, so nothing a builder could reach before becomes unreachable.
  • The dated note, sentence by sentence: "carries out Amendment (2026-11-26) for one row and decides nothing" — true, the amendment decided it; "The menu draws no row for it by the same change" — true (buildStudioMenu); "written as field's is — no order, no tier, last in its group" — true; "external_catalog, the one type that was behind it, is one place earlier, sixth" — true; "stays registered system and keeps its row in this table, so 平台 Platform still counts 7: six rows with an order, and this one" — true (six ordered rows plus this one). The note is true.
  • Nit N1: the legend at line 216 still explains the dash for field alone ("field carries no order and no tier because it draws no row"); datasource now shares the notation and is explained only by the dated note two lines above. Accepted deviation under the card's "No other ADR text"; a natural rider for ADR-0084: the type-to-group note, fold sentence and item 6 heading catch up with the knowledge_source row #37740 when that card redraws the notes.

studioMenuPlacement.ts (implementing)

  • The row is gone and STUDIO_MENU_NO_ROW_TYPES = {'datasource'} is the named exception; the docblock states the never-invisible rule and then "The one exception is a type the menu draws no row for", citing the amendment and the card. The code's rule is keyed on the placement LIST having no row, where the ADR's is keyed on the TABLE, so without the set the type would have fallen into the unplaced branch and been drawn in 高级 — the set is necessary, not decoration. Agrees with the contract.
  • Break attempt, exception creep: the test pins [...STUDIO_MENU_NO_ROW_TYPES] to exactly ['datasource'], so a second type cannot be hidden through this set without a red test and, by the ADR pin's row count, an ADR row rewritten to the dash form. The exception cannot grow silently.

studioMenuModel.ts (implementing)

  • One continue on the set at the top of the placement loop, before group lookup, tier and path, independent of scope and of setupDirectory: "in any scope" is literally true. The continue cannot leave an empty 平台 Platform group behind, since groups with no entries are filtered at the return.
  • Retired branch: typeEntryPath is module-private with one caller (line 216), which can no longer be reached with datasource; the removed import has no other use in the file. Nothing dangles. SETUP_DATASOURCES_PATH keeps its two live readers.
  • Nit N2: the header docblock's inserted sentence ("Not a type the menu draws no row for ...") is a fragment placed between "still shows where the first is made." and "Each opens the type's list", so "Each" now reads across it. Wording only.

studioMenuPlacement.test.ts (implementing; the gate that ties the table to the list)

  • Still binds every drawn row: LISTABLE_TYPES is the directory's types less the no-row set; set equality with the placement rows holds both ways; the ADR pin requires rows.length to equal LISTABLE_TYPES.length, equal tiers both ways, and per-group order equal to the Order column. Break attempts read against the regex ADR_ROW: restoring | 6 | datasource | 高级 | in the ADR makes the row count one too many — red; restoring the placement row makes the set equality red; leaving external_catalog at 7 passes the order test (it sorts) but is exactly what the ADR diff fixes, and a duplicate order would still sort correctly — the pin has always bound sequence, not the printed number.
  • Not weakened: the ruled-order literal drops one name, a new 平台 Platform group pin and a new registration pin are added, and in studioMenuModel.test.ts the old filter x.type !== 'datasource' is removed from the address check, which tightens it.
  • Nit N3: ADR_ROW requires a numeric Order, so a dash row (field's, and now datasource's) is read by no assertion; deleting the datasource row from the ADR outright would stay green. Same shape field has had since Studio 菜单(M2):类型顺序和「常用 / 高级」写成一张表,用测试钉住注册表和 ADR #37200; no effect on what the menu draws.

studioPaletteModel.ts (implementing; judged in scope, since its docblock describes the menu's behaviour)

  • Only the docblock of STUDIO_PALETTE_ITEMLESS_TYPES changes, from "the menu's entry for it already leaves Studio" to "the menu draws no row for it". True of the tree. The set itself is still needed: the palette's item reads iterate the directory-scoped types, not the menu's entries, so without it the palette would fetch datasource items. The ⌘K palette's entries do derive from buildStudioMenu (StudioPaletteGroups.tsx:171), and the re-pointed surfaceScope-36900 expectation matches.

StudioMenu.tsx (implementing; judged in scope, as the consumer that draws the entries)

  • The datasource: Database icon row and the Database import are removed together; no other use of Database remains in the file (other files in the folder import their own). studioMenuEntryIcon falls back to the group icon for an unmapped type, so no lookup can fail. Nothing dangles.

Remainder of the diff (the changeset, studioMenuModel.test.ts, StudioPaletteGroups.surfaceScope-36900.test.tsx): the lane seat's ACCEPT at TIER_DEFAULT.

Nits N1 to N3 have no effect on correctness or the contract and are left as accepted deviations; none needs a change on this head.

Implemented-by: claude/project-thread-f9vtm5
Reviewed-by: session_01L9qibwsYQqi3TBx2SFE978

VERDICT: PASS

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App Studio 改版(3-4):Studio 菜单去掉「数据源」一行——数据源只在「设置 › 集成」里管

2 participants