Skip to content

Commit afc64fc

Browse files
feat(setup): platform-owned Setup items sit in their new groups under the new names; every old name stays searchable (#39057) (#39161)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLG265nPSasYMMTgKjN4W36)_ Fixes #39057 Clause-②: no (navigation data and labels move inside the declared shape; no accept set widens, no export moves) Metadata-protocol: none ## 维护者速读 - 管理员在系统设置左侧导航看到:平台自带的菜单项进入新的十个分组,按裁定顺序排列并改用新名字(公司信息排在用户与组织第一位),七个设置页面打开后的标题和总览卡片也同名改过来,「全部设置」不再出现在菜单里,但原地址仍能打开。 - 属于「系统设置导航改为两层十组」专题:让管理员按使用频率找到日常设置,并让改名后的页面仍能用旧名字搜到。 - 出错时管理员会在错误的分组里看到某个菜单项,或者某个页面的名字和打开后的页面标题不一致;撤回只需回退本次改动,没有数据迁移。 - 需要你人工合并:本 PR 改了 `docs/adr/0057-erp-authorization-core-business-units-and-scope-depth.md` 里的一行锚点(`setup-nav.contributions.ts#group_people_org` 改指 `setup.app.ts#group_people_org`,旧分组 id 仍在那里以 `renamedFrom` 声明),`docs/adr/**` 属受管面,所以是 Tier H;行数 1764,未超 3000。须与 #39055(⌘K 按旧名搜)同一版发布,否则改名后旧名暂时搜不到。 ## What changes - **`setup-nav.contributions.ts`**: every platform-owned entry names one of the ten group ids directly (never a retired id, so `nav_contribution_group_renamed` no longer fires for these), in the epic's order. Company Information is the first entry of Users & Organization (ruling D3). Priorities leave slots for the capability plugins' entries (#39058): Apps & AI 100 / 300, Audit & Data 200, Company Settings 200, Notifications 200 / 400, Integrations & Developer 100 / 500; the slot plan is in the file header. - **Renames in all 11 locales** (en literal + bundle, 10 translated bundles, recorded source hashes recomputed): Packages to Installed Apps, Company to Company Information, Localization to Language & Region, Standard Unit Settings to Standard Unit Decimals, Calendar Exceptions to Holidays & Workday Swaps, Mail Delivery / SMS Delivery to Email Channel / SMS Channel, Authentication to Sign-in Methods, AI & Embedder to AI Model Service, Data Lifecycle to Data Retention, Notification Events to Delivery Log, Sessions to Active Sessions. Plugin-contributed entries renamed in the 10 translated bundles: Position Holders, Permission Set Assignment, Record Shares, Queues; their English label stays the plugin's literal (plugin-security's own pin holds the en bundle to it) and changes with #39058. - **Aliases (`keywords`)**: each renamed platform entry carries its former source-language name on the item; each translated locale carries its former label on its bundle node (label pinned beside it). Under either reading of replace-or-add (#39055) the data holds: the en list is on the item, each locale's own list on its node. Business Units carries Department / Organization Structure / Division, 部门 / 组织架构 / 事业部 in zh-CN (ruling D4), in all 11 locales. The seven groups with `renamedFrom` carry the retired groups' former names (source list on the `setup.app.ts` group, per-locale on the bundle node). `group_overview` left no group, so the pinned System Overview entry carries its former name: its label contains it in nine locales, and its zh-CN / zh-Hant bundle nodes list 总览 / 總覽 in `keywords`. - **`nav_settings_hub` removed** from navigation and from every bundle, added to the dead-id tombstone ledger; `/apps/setup/system/settings` keeps opening the hub (console route untouched, pinned by `AppContent.systemHubRoutes.test.tsx`). - **Tests**: new `setup-platform-items-39057.test.ts` (groups, order, priorities, zh-CN labels against the table, new label + former-label alias per renamed entry in 11 locales, BU aliases, group aliases, hub absence). Collateral pins updated where they read the old group ids or labels: `setup-packages-door`, `setup-packaged-actions-nav`, `setup-users-nav-view`, `sys-exchange-rate` / `sys-unit` / `sys-standard-unit-setting` object tests, cli `connect-agent-both-halves-wire` and `setup-diagnostics-audience` pins (the three former Diagnostics entries are now tracked wherever they sit), service-knowledge non-vacuity probe, service-settings hub parity (reads every group now). - **Settings page and hub titles (Q1 ruling A)**: `@objectstack/service-settings` translations, all 11 locales, `title` only, for company, localization, auth, mail, sms, ai and lifecycle, now equal the new nav labels, so the hub card, the page heading and the sidebar agree and `setup-nav-hub-parity` is green unchanged. en.ts gains title-only `sms` and `lifecycle` blocks (their other strings still come from the manifest literals); no manifest is touched. - **ADR-0057 anchor**: its symbol anchor `setup-nav.contributions.ts#group_people_org` now points at `setup.app.ts#group_people_org`, where the retired id is still declared (`renamedFrom`). One line; `docs/adr/**` makes this PR Tier H. ## Tests Union on `af54fa3e` (local, targeted; CI runs the farm): <details><summary>service-settings: 79 files, 1547 tests passed (hub parity green, unchanged); typecheck clean</summary> `pnpm --filter @objectstack/service-settings exec vitest run --maxWorkers=2` : Test Files 79 passed, Tests 1547 passed. `pnpm --filter @objectstack/service-settings typecheck` : exit 0. knowledge-turso `settings-contribution.test.ts` (reads the real settings bundles): 27 passed. </details> <details><summary>platform-objects: 132 files, 2313 tests passed</summary> `pnpm --filter @objectstack/platform-objects exec vitest run --maxWorkers=2` : Test Files 132 passed, Tests 2313 passed. </details> <details><summary>composed pins (on e2ed19b, no platform-objects change since): cli 23, service-knowledge 53, plugin-security 5, plugin-audit 3 passed; check-app-nav-i18n OK; check:i18n OK on af54fa3</summary> - cli: connect-agent-both-halves-wire, console-page-nav-entries, setup-diagnostics-audience, setup-integrations-order, setup-landing-audience, format.server-ready-dev-admin-audience: 23 passed. - `node packages/cli/scripts/check-app-nav-i18n.mjs`: OK (14 contributors, 11 locales; setup 63 merged nav ids, every id labelled in every locale). - `pnpm check:i18n`: OK (10 packages, all bundles in sync, no undeclared authoring keys). </details> <details><summary>Ablation (each red, each restored, `git diff HEAD` empty)</summary> Title change, `-- vitest run src/setup-nav-hub-parity.test.ts`: - restore zh-CN mail title 邮件投递: 1 failed (zh-CN parity, `{ ns: 'mail', hub: '邮件投递' }`); - delete en's title-only `sms` block: 1 failed (en parity, `ns: 'sms'`), proving the en block is what overrides the manifest literal. New nav pins, `-- vitest run src/apps/setup-platform-items-39057.test.ts`: - drop Users from Users & Organization: 1 failed (order); - point Currency & Units' contribution at `group_configuration`: 2 failed (retired id, order); - drop zh-CN Work Queues' alias: 1 failed; - restore zh-CN 邮件投递 label: 2 failed (table, rename); - reintroduce `nav_settings_hub` in place of Public Forms: 3 failed incl. hub absence; - cut Business Units' aliases to one: 1 failed. </details> ## Acceptance notes - The epic's table does not list 当前组织 (`nav_organization`); it stays in Users & Organization, last (Q2 ruling A). - The settings manifests' own `label` literals still carry the former names (sms `SMS Delivery`, objectql lifecycle `Data Lifecycle`, and company / localization / auth / mail / ai). They are no longer what any locale shows, since en.ts now carries every title, but a reader of a manifest sees the old name. Manifests were fenced off (#39044 holds `mail.manifest.ts`); for the manifest owners. - Table labels that differ from main and are not in the explicit rename lists, left unchanged: 系统概览 vs 概览 (pinned item in `setup.app.ts`, outside this card's fence), and plugin entries 浏览应用市场 vs 应用市场, 品牌 vs 品牌外观, 审批委派(外出)vs 审批委派. 权限集 in row 2 has no entry on main (`nav_permission_sets` is tombstoned). For #39058 and the maintainer. - When #39058 changes a plugin entry's English literal, the translated locales' recorded hashes for that entry must be refreshed in the same PR, or `withSourceFallback` serves English for it. - en.ts section comments still say "Configuration" / "Diagnostics" above moved entries; cosmetic. - `AppContent.tsx`'s docblock still names `nav_settings_hub` as the declared landing; the route is unchanged (fenced off). ## Verification Two minutes: `pnpm --filter @objectstack/platform-objects exec vitest run src/apps/setup-platform-items-39057.test.ts` should report 26 passed. Read first: `setup-nav.contributions.ts` (group ids and priorities), `translations/zh-CN.ts` (setup block), `service-settings/src/translations/en.ts` (the two title-only blocks). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzeZMKeDN64azVSgNLF <!-- signed: repo:objectstack@os-support-ai · os-support-ai · session_01WGufzeZMKeDN64azVSgNLF --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5161056 commit afc64fc

48 files changed

Lines changed: 1140 additions & 652 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
'@objectstack/service-settings': patch
4+
---
5+
6+
Setup's platform-owned entries sit in their new groups, in the new order, under the new names; every old name stays searchable
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Setup's navigation was regrouped into ten groups (#39050). The entries `@objectstack/platform-objects` contributes now name the new group ids directly, so none of them draws the `nav_contribution_group_renamed` notice:
12+
13+
- **Users & Organization:** Company Information (first), Users, Invitations, Teams, Business Units, Organizations, then the active organization's page.
14+
- **Access & Sharing:** Positions and Permissions. **Apps & AI:** Installed Apps, AI Model Service. **Audit & Data:** Recycle Bin, Data Retention, File Storage. **Company Settings:** Language & Region, Working Calendars, Holidays & Workday Swaps. **Currency & Units:** Exchange Rates, Units of Measure, Standard Unit Decimals. **Notifications:** Email Channel, SMS Channel, Delivery Log. **Login & Security:** Sign-in Methods, Access policy, Active Sessions. **Integrations & Developer:** API Keys, OAuth Applications, Public Forms.
15+
16+
Renamed, in every shipped locale: Packages → Installed Apps, Company → Company Information, Localization → Language & Region, Standard Unit Settings → Standard Unit Decimals, Calendar Exceptions → Holidays & Workday Swaps, Mail Delivery → Email Channel, SMS Delivery → SMS Channel, Authentication → Sign-in Methods, AI & Embedder → AI Model Service, Data Lifecycle → Data Retention, Notification Events → Delivery Log, Sessions → Active Sessions. The translated locales also rename four entries other packages contribute: Position Holders, Permission Set Assignment, Record Shares and Queues (their English label changes with each plugin's own entry).
17+
18+
Every renamed entry keeps its former name as a search alias (`keywords`): the source-language name on the entry, each locale's former name on that locale's bundle entry. Business Units carries Department / Organization Structure / Division (部门 / 组织架构 / 事业部), and each group that took a retired group over carries that group's former name.
19+
20+
The settings pages' own titles, and their cards on the settings hub, carry the same new names in every shipped locale (`@objectstack/service-settings`), so a page opens under the name its Setup entry shows: Mail Delivery → Email Channel, Localization → Language & Region, and likewise for Company, Authentication, SMS Delivery, AI & Embedder and Data Lifecycle.
21+
22+
"All Settings" (`nav_settings_hub`) left the navigation: every settings page has its own entry, and the command palette finds them. Its address, `/apps/setup/system/settings`, still opens the settings hub.
23+
24+
No action needed: nothing an app author writes changes. A third-party contribution that still names a retired group id keeps landing in the group that took it over.

‎docs/adr/0057-erp-authorization-core-business-units-and-scope-depth.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ open/paid resolver seam). It did **not** settle how the three org-shaped objects
386386
- `sys_team` (better-auth) — the **flat collaboration grouping**.
387387

388388
Left unaddressed, all three land flat in the Setup `group_people_org` menu
389-
(`packages/platform-objects/src/apps/setup-nav.contributions.ts#group_people_org`) and read as three
389+
(`packages/platform-objects/src/apps/setup.app.ts#group_people_org`) and read as three
390390
competing "organisation" concepts — the ambiguity is sharpest in a single-tenant install,
391391
where `sys_organization` is a single, un-creatable row. This addendum closes that gap. One
392392
decision per gap (ADR-0049 discipline); no model change, only surfacing + one denormalised

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,9 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
275275
// `branding` namespace, offered only where no organization wall stands,
276276
// and this harness composes platform-objects and the MCP bundle alone.
277277
expect(allowedIds).toContain('nav_packages');
278-
// `group_apps` retired into `group_apps_ai` through `renamedFrom` (#39053).
279-
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai')).toEqual(['nav_packages']);
278+
// Apps & AI as this composition serves it: Installed Apps, then AI
279+
// Model Service (#39057).
280+
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai')).toEqual(['nav_packages', 'nav_settings_ai']);
280281
expect(allowedIds).toContain('nav_public_forms');
281282
// #37087 — the id is Setup's alone now: Studio's entry of the same id
282283
// is retired with the console page it opened (`developer:public-forms`).

‎packages/cli/test/setup-diagnostics-audience.pin.test.ts‎

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@
1616
//
1717
// The gate moved off the group and onto the entries: Audit Log on
1818
// `view_all_audit_log`, Sessions and Notification Events on the
19-
// `manage_platform_settings` the group carried. Read over the wire, per caller:
19+
// `manage_platform_settings` the group carried. Since Setup was regrouped
20+
// (epic #39050, #39057) the three sit in three groups — Audit Log in Audit &
21+
// Data, Active Sessions in Login & Security, Delivery Log in Notifications —
22+
// and each still carries its own gate. Read over the wire, per caller:
2023
//
21-
// - `view_all_audit_log` alone → Diagnostics holds Audit Log, only;
22-
// - `manage_platform_settings` alone → Sessions and Notification Events, and
24+
// - `view_all_audit_log` alone → Audit Log, only, in Audit & Data;
25+
// - `manage_platform_settings` alone → Active Sessions and Delivery Log, and
2326
// NOT Audit Log (no entry reaches a
2427
// member who lacks its own gate);
25-
// - neither → no Diagnostics group at all;
28+
// - neither → none of the three;
2629
// - the platform administrator → all three, as before.
2730
//
2831
// ---------------------------------------------------------------------------
@@ -44,10 +47,13 @@ import { ADMIN_FULL_ACCESS_CAPABILITIES } from '@objectstack/spec';
4447

4548
type AnyRec = Record<string, any>;
4649

47-
// [#39053] The served anchor: `group_diagnostics` retired into it through
48-
// `renamedFrom`, and the contributions below still name the old id.
50+
// [#39053] The served anchor `group_diagnostics` retired into; the Audit Log
51+
// entry lands here. The two platform-settings entries moved out (#39057).
4952
const GROUP = 'group_audit_data';
5053

54+
/** The three entries the retired Diagnostics group held. */
55+
const FORMER_DIAGNOSTICS = ['nav_audit_logs', 'nav_notifications', 'nav_sessions'] as const;
56+
5157
/**
5258
* The manifests a plugin registers from `init()`, captured off a context that
5359
* serves exactly the `manifest` service, with inert stand-ins for the rest of
@@ -152,27 +158,35 @@ function allIds(items: AnyRec[] | undefined): string[] {
152158
return (items ?? []).flatMap((i) => [String(i?.id), ...allIds(i?.children)]);
153159
}
154160

161+
/** Which of the former Diagnostics entries the caller is served, anywhere in Setup. */
162+
function servedFormerDiagnostics(app: AnyRec): string[] {
163+
const ids = new Set(allIds(app?.navigation));
164+
return FORMER_DIAGNOSTICS.filter((id) => ids.has(id));
165+
}
166+
155167
describe('Setup → Diagnostics: each entry is served to the holders of its own gate', () => {
156168
it('a member holding view_all_audit_log, and no platform-settings power, is served the Audit Log entry', async () => {
157169
const setup = await servedSetup(['setup.access', 'view_all_audit_log']);
158-
expect(diagnostics(setup)).toEqual(['nav_audit_logs']);
170+
expect(servedFormerDiagnostics(setup)).toEqual(['nav_audit_logs']);
171+
// First in Audit & Data; the ungated Recycle Bin follows it.
172+
expect(diagnostics(setup)?.[0]).toBe('nav_audit_logs');
159173
});
160174

161175
it('a member without view_all_audit_log is not served the Audit Log entry, anywhere in Setup', async () => {
162176
const settingsOnly = await servedSetup(['setup.access', 'manage_platform_settings']);
163-
expect(diagnostics(settingsOnly)?.sort()).toEqual(['nav_notifications', 'nav_sessions']);
164-
expect(allIds(settingsOnly.navigation)).not.toContain('nav_audit_logs');
177+
expect(servedFormerDiagnostics(settingsOnly)).toEqual(['nav_notifications', 'nav_sessions']);
178+
expect(diagnostics(settingsOnly)).not.toContain('nav_audit_logs');
165179

166180
const neither = await servedSetup(['setup.access']);
167-
expect(diagnostics(neither)).toBeUndefined();
168-
expect(allIds(neither.navigation)).not.toContain('nav_audit_logs');
181+
expect(servedFormerDiagnostics(neither)).toEqual([]);
169182
// Control: the app itself is served to this member, so the absence above
170183
// is the entry's gate and not a withheld app.
171184
expect(allIds(neither.navigation).length).toBeGreaterThan(0);
172185
});
173186

174187
it('the platform administrator is served all three entries, as before', async () => {
175188
const admin = await servedSetup(ADMIN_FULL_ACCESS_CAPABILITIES.systemPermissions ?? []);
176-
expect(diagnostics(admin)?.sort()).toEqual(['nav_audit_logs', 'nav_notifications', 'nav_sessions']);
189+
expect(servedFormerDiagnostics(admin)).toEqual(['nav_audit_logs', 'nav_notifications', 'nav_sessions']);
190+
expect(diagnostics(admin)?.[0]).toBe('nav_audit_logs');
177191
});
178192
});

0 commit comments

Comments
 (0)