Skip to content

feat(setup): the environment directory moves from Studio to Setup's access group - #37602

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

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

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #37565

Clause-②: no
Metadata-protocol: none

维护者速读

  • 岗位、能力、权限集、共享规则的全环境目录,从 Studio 菜单搬到 Setup 的“访问控制”分组,名为“岗位与权限”。
  • Studio 菜单不再有这一项;旧的书签和链接只跳转一次,直接落到 Setup 的新页面。
  • 进入门槛没有放宽:新入口和新页面都要求进入 Studio 所需的同一项权限,外加 Setup 本身的权限。
  • 在目录里点开某一条,仍在 Studio 的编辑器中打开;Studio 找不到包时的默认落点暂时改为“无包”范围,等“移入包”功能上线后一并撤掉。

What changes

  • New Setup entry: nav_access_directory ("Positions and Permissions", icon key-round) in Setup's group_access_control, contributed by packages/platform-objects/src/apps/setup-nav.contributions.ts, with requiredPermissions: ['studio.access']. Labels in all 11 locale packs, source hashes updated.
  • New Setup page security:access-directory (/apps/setup/component/security/access-directory), registered in builtinComponents.tsx. It serves the directory and each environment type's list (permission, position, capability, sharing_rule, ?scope=environment) by mounting the existing metadata-admin directory and list pages under the cross-package leg's host shape (no package, writable), rooted at the page. Without studio.access it renders an alert naming the capability and reads nothing.
  • Rows open the item editor in Studio: an item, a create and a history under the Setup page go to /studio/~all/metadata/<type>/<name>?scope=environment, the editor the environment scope uses today, because an environment item is edited by name and may belong to no package.
  • Studio's ~all menu entry is retired (studioMenuModel.ts, its label key and icon). The package-less menu's access rows point at the Setup page's type lists.
  • Old addresses redirect once: /studio/~all, /studio/~all/metadata and a list of one of the four types in the environment scope, including Setup's old /apps/setup/metadata/... catalog addresses, land on the Setup page in one hop. The cross-package list of any other type, and item pages, stay in Studio.
  • Studio's no-package fallback (studioEntryFallbackPath, newPackageDoorPath) now lands on /studio/~org/metadata/flow?source=runtime instead of the retired directory. ⚠️ This is temporary: ~org retires with the Phase 4 "move into package" door (Q3 ruling 7184753035), and the fallback moves with it.
  • Surface added with the area's approval (claim amendment on App Studio 改版(3-2):「全部软件包」目录 ~all 搬到设置的访问分组,Studio 不再有这个入口 #37565): a one-line re-export of ACCESS_DIRECTORY_PATH from ui/packages/app-shell/src/index.ts; a doc-comment-only edit in StudioEntryRedirect.tsx; one sentence each in content/docs/permissions/authorization.mdx and content/docs/permissions/permission-sets.mdx, and two lines of content/docs/permissions/administrator-guide.mdx (the matrix editor's path and the where-to-find table row), re-pointed at Setup → Access Control (second claim amendment); and StudioPaletteGroups.tsx drops the retired kind's icon key and its import, which the full build refused to compile.

Answer to #37424 comment 7188504633 (a)

The package's 全部类型 directory still lists datasource where the package holds one, and that tile still opens Setup → Datasources (the directory's href override). This PR does not change that; removing the menu row is #37564's job. The new Setup access directory lists only the four environment types and never datasource.

Tests

  • New: views/setup/accessDirectory.test.ts (address model: what lands on Setup, what stays in Studio, one hop both ways) and views/setup/AccessDirectoryPage.test.tsx (gate refusal with control, the host shape, the four lists, scope added, items/create/history open in Studio).
  • Re-pointed, not weakened: every test that pinned ~all now pins the Setup page or the Studio item editor, and the retired entry is pinned absent (studioMenuModel, StudioMenu, StudioPaletteGroups.surfaceScope-36900, setupMetadataRedirect, AppContent.setupMetadataStudio-28578, console AppContent.legacyRedirects, AppContent.systemHubRoutes, StudioRoute.metadataArea-28561, StudioEntryRedirect, HomePage.noAgentsBuildChip-26614, StudioDesignSurface.metadataArea-28561, StudioMetadataArea.routes-28561, StudioPackageMenu-37139), and the live e2e declared-sharing-rules-reach-13091 lists from the Setup page.

Acceptance notes

Verification

Read at head f9a5798c.

  • Unit: 24 targeted vitest files green (the two new views/setup/ files plus every re-pointed ~all test).
  • Type-check: @object-ui/app-shell (src and tests), @object-ui/console, @object-ui/i18n green; full pnpm build and pnpm console:build green.
  • Derived gates (node scripts/pm/dispatch-gates.mjs --commands, 67 commands): all green, including check:i18n, check:dual-build-cjs-loads and check:test-source-alias (re-run after build / fix). One exception, environment-only: check-plugin-teardown-shape --self-test cannot read its pinned fixture commit in this shallow clone (exit 3, nothing judged); untouched by this diff.
  • Browser, showcase app booted locally, signed in as the seeded admin, light and dark (8 screenshots):
    • /apps/setup/component/security/access-directory shows the directory of the four types, with Access Control → Positions and Permissions selected in Setup's sidebar.
    • /studio/com.example.showcase/metadata: the Studio menu's Access group no longer carries the cross-package entry.
    • An old link, /studio/~all/metadata/position?scope=environment, lands on /apps/com.objectstack.setup/component/security/access-directory/position?scope=environment and lists the 17 positions.
  • Follow-up noted, not in this card: the Setup page reuses the directory's own heading ("All Metadata Types"); a page-specific heading would read better.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CZhAqkgRyMYuZeZt9S

@github-actions github-actions Bot added size/l 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 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects, touching 14 documentable anchor(s).

8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/client-sdk.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/deployment/cli.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/administrator-guide.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/authorization.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/permission-sets.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/system-context.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/ui/apps.mdx (via group_access_control (literal, a string literal in group), studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/ui/audience-based-interfaces.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v15.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/releases/v16.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/releases/v17/17-5.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/releases/v17/17-6.mdx (via studio.access (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see

Coarse fallback — 3 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 64819c10dafec38a15aacf44ceb492aefa89db12 — the merge of head f9a5798c8d63805f6b570de8ec74967385b8f9b2 into base 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 64819c10dafec38a15aacf44ceb492aefa89db12 && git checkout 64819c10dafec38a15aacf44ceb492aefa89db12
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 f9a5798c8d63805f6b570de8ec74967385b8f9b2 && git checkout -B drift-repro 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 && git merge --no-ff f9a5798c8d63805f6b570de8ec74967385b8f9b2

node scripts/docs-audit/affected-docs.mjs --json 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 0f6a1e518f3c4639b03f86a8c07d9d08d91bddb6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

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/l 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-2):「全部软件包」目录 ~all 搬到设置的访问分组,Studio 不再有这个入口

2 participants