Skip to content

feat(account-menu): draw the Account app's declared grp_account_menu; built-in org rows yield when cloud-managed - #39923

Open
objectstack-fleet[bot] wants to merge 5 commits into
mainfrom
claude/project-thread-cdzmyb
Open

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Fixes #39901

What changes

Phase 1 of #39900: the account menu stops hard-coding its rows and draws the Account app's declared group.

  • packages/platform-objects/src/apps/account.app.ts declares a last top-level group grp_account_menu (last, so the app landing never elects it):
    • grp_account_menu_organization (reserved sub-group): My Organizations /organizations?manage=1 and Create Organization /organizations?create=1, both visible: 'features.multiOrgEnabled != false && features.cloudManaged != true'. These are the built-in rows that yield when features.cloudManaged.
    • Account Settings (account:profile_card, ungated).
    • grp_account_menu_admin (reserved sub-group): Setup /apps/setup with requiredPermissions: ['setup.access'].
    • Labels for the 7 new ids in all 11 platform locales (zh-CN: 账户菜单 / 组织 / 管理 / 我的组织 / 创建组织 / 账户设置 / 系统设置).
  • ui/packages/app-shell/src/layout/AccountMenu.tsx wraps the menu in an ExpressionProvider bound to the served features, the current user and the Account app, filters the group with the shared member gates (useNavMemberGates + navEntriesShownToMember: visible, requiredPermissions, requiresObject/Service, dataSource), and lays it out as:
    identity · organization section (walled org name as a section label, org rows, then the switcher) · account rows + Connect an AI Assistant + host entries + hidden apps · Preferences (theme, language, notifications) · admin section · Log out.
  • accountMenuNav.ts (new) splits the group into {organization, account, assistant, admin} and withoutAccountMenuGroup keeps the group out of the Account app's sidebar (UnifiedSidebar).
  • useOrgMenuPosture.ts: orgMenuEntries is replaced by offersOrganizationSwitcher (multi-org, not cloud-managed, more than one membership); new useServedFeatures().

Resulting menus (browser-verified, see below):

  • Admin, multi-org: 我的组织 · 创建组织 · 账户设置 · 连接 AI 助手 · 偏好设置 · 系统设置 · 退出登录.
  • Single-org: 账户设置 · 连接 AI 助手 · 偏好设置 (语言) · [系统设置 for setup.access holders] · 退出登录.
  • 初始设置 and the hidden apps stay.

No new menu extension point (ruling 6937513776 holds): cloud#5494 contributes 我的组织 ↗ through the existing navigationContributions. It should target grp_account_menu_organization so the row lands in the organization section; targeting grp_account_menu still renders, but in the account section. An absolute https: href renders with an ↗ and leaves through the unsaved-edits guard.

Deviations from the card / order

  1. Setup is gated with requiredPermissions: ['setup.access'] (the shared gate the sidebar uses) rather than a hasCapability visible predicate.
  2. connectAssistantPath is kept: Home's ConnectAssistantCard still uses it. The menu no longer does.
  3. The Profile row is relabelled Account Settings to match the epic's final menu.
  4. The walled organization name is now the organization section's label instead of a row.
  5. When the auth config read fails, the org rows are withheld (before: shown by default). A predicate naming an absent features key faults; the server always serves multiOrgEnabled and cloudManaged as booleans.

Why

#39900 phase 1: the menu's rows become metadata the Account app owns, so the cloud host can yield and contribute rows without a new extension point.

Verification

  • packages/platform-objects: new account-menu-group.test.ts (7 tests) — group top-level and last, child order, org rows' url/visible, Settings ungated, Setup permission, zh-CN labels, AppSchema parses.
  • app-shell: new accountMenuNav-39901.test.ts (8 tests); updated AccountMenu / AppHeader / UnifiedSidebar / ConsoleLayout tests (cloud-managed yields every built-in org row; a cloud contribution renders first and leaves via location.assign; empty features withholds org rows; served zh labels; host entry after Connect AI; unsaved-edits departure for Connect AI). The expression mount-sites ratchet now lists AccountMenu.tsx.
  • Runs: affected set 145 files (all pass after the ratchet update), layout/ + hooks/ 299 files pass. The full app-shell + console suite exceeded the 40-min container limit, so it was not run whole.
  • Gates: 71 run (exit codes recorded). All pass except NOT MEASURED, not caused by this diff: check-plugin-teardown-shape --self-test exit 3 (shallow clone), check:dual-build-cjs-loads exit 3 (no dist for studio/client-react), pnpm --dir ui exec vitest run scripts/ OOM-killed in the container. check:test-source-alias was re-run after the fix: exit 0.
  • Browser (objectstack dev app-showcase + console Vite, Playwright, desktop 1440×900 and iPhone 13, en and zh-CN):
    • OS_TENANCY_POSTURE=isolated (multi-org): org section with org name, 我的组织 / 创建组织, then 账户设置 · 连接 AI 助手 · 偏好设置 · 系统设置 · 退出登录.
    • OS_TENANCY_POSTURE=single: no org section; 账户设置 · 连接 AI 助手 · 偏好设置 · 系统设置 · 退出登录.
    • The Account app's sidebar does not show 账户菜单 in either posture.
    • Not exercised in the browser: a non-admin single-org member (covered by unit tests) and the cloud-managed posture (covered by unit tests; cloud#5494 verifies on the host).

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (packages/spec untouched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjMg6r6nVfcAADVPeFv

@github-actions github-actions Bot added size/xl 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 Dec 6, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

L1: ACCEPT at head 7e6d10f2 · reviewer of record repo:cloud@hotlong · read 2026-12-06T13:43Z.

@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/ai/connect-mcp.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/api/client-sdk.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/deployment/cli.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/deployment/cloud-connection.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/permissions/capabilities.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/permissions/delegated-administration.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/permissions/permission-sets.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/permissions/system-context.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/protocol/kernel/config-resolution.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/ui/apps.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/ui/audience-based-interfaces.mdx (via setup.access (literal, a string literal in navigation))

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

  • content/docs/releases/v17/17-5.mdx (via setup.access (literal, a string literal in navigation))
  • content/docs/releases/v17/17-6.mdx (via setup.access (literal, a string literal in navigation))

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 — 4 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 70836da70450e4e311173636848e1ba0719b94a5 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 3d5b6172423c2b6778062da8c6ce2df98d9c3a00 — the merge of head 21f24cbd2b2fe61276869336ce980797570aaf9c into base 70836da70450e4e311173636848e1ba0719b94a5, 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 3d5b6172423c2b6778062da8c6ce2df98d9c3a00 && git checkout 3d5b6172423c2b6778062da8c6ce2df98d9c3a00
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 70836da70450e4e311173636848e1ba0719b94a5 21f24cbd2b2fe61276869336ce980797570aaf9c && git checkout -B drift-repro 70836da70450e4e311173636848e1ba0719b94a5 && git merge --no-ff 21f24cbd2b2fe61276869336ce980797570aaf9c

node scripts/docs-audit/affected-docs.mjs --json 70836da70450e4e311173636848e1ba0719b94a5

⚠️ 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 70836da70450e4e311173636848e1ba0719b94a5 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 6, 2026 13:43
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge December 6, 2026 13:43
The #17647 wire pin counts every served Account nav id. grp_account_menu
adds five for a permissionless principal (the Setup row and the admin
sub-group it empties are pruned by requiredPermissions), so 15 becomes 20;
pin the pruning too.

Claude-Session: https://claude.ai/code/session_01Q4EjjMg6r6nVfcAADVPeFv
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

L1: ACCEPT (delta) at head 21f24cbd · reviewer of record repo:cloud@hotlong · read 2026-12-06T14:14Z.

@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 47665983877 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (11/12) — 失败步骤: Run this shard's tests(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 6 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:cloud@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

L1: ACCEPT (re-arm) at head 21f24cbd · reviewer of record repo:cloud@hotlong · read 2026-12-06T15:40Z.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@hotlong · hotlong · session_01Q4EjjQzFqHGjUAXt8kBQhV

Re-land: the merge queue dropped this at 15:41Z because of the Test Core (11/12) runner-shutdown flake (exit 143, no test failure; fleet card #39940). The head 21f24cbd is unchanged and its checks are green. The ACCEPT stands, so I'm re-arming.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 6, 2026
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 47671357473 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (11/12) — 失败步骤: Run this shard's tests(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 5 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

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/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants