Skip to content

Commit fa2c751

Browse files
CL-6843: Remove draft-only Notifications section from settings registry (#356)
* CL-6843: Remove draft-only Notifications section from settings registry Honest absence over fake toggles — same pattern as AgentSection. No per-user preference store backs personal notification prefs yet; keep the dormant component for re-add when one exists. Workbench-scoped mute/mentions in chat-ui are unchanged. * Fix lint: prettier for CL-6843 notifications remove
1 parent 6c666cf commit fa2c751

5 files changed

Lines changed: 42 additions & 34 deletions

File tree

‎packages/settings-ui/README.md‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ Presentational primitives come from `@corbits/react-ui`
88
package holds the workbench-specific section composition, HTTP clients,
99
and the domain model of which sections exist and who can see them.
1010

11-
Sections are grouped Account (personal: chat notifications, account,
12-
connections) and Everyone (account-wide: people, roles, grants, audit) —
13-
the single-concept collapse of the old Personal/Workspace split, since
11+
Sections are grouped Account (personal: account) and Everyone
12+
(account-wide: connections, people, roles, grants, audit) — the
13+
single-concept collapse of the old Personal/Workspace split, since
1414
there is one workbench per account today. `resolveSettingsSectionGroups`
1515
is the one source of truth a host reads for both the settings stage and
1616
its own section nav, so the two never drift; `insertEveryoneSections` lets
1717
a host splice in its own account-wide sections (e.g. Agents/Skills)
18-
alongside these.
18+
alongside these. Notifications and "Your agent" stay out of the registry
19+
until a preference store backs them (honest absence over draft-only
20+
toggles).
1921

2022
## Key modules
2123

@@ -25,8 +27,9 @@ alongside these.
2527
- `people-section.tsx` / `roles-section.tsx` / `grants-section.tsx` /
2628
`connections-section.tsx` — the Everyone-group and account-scoped
2729
management surfaces, each with its own API module
28-
- `account-section.tsx` / `notifications-section.tsx` / `audit-section.tsx`
29-
— the Account-group surfaces
30+
- `account-section.tsx` / `audit-section.tsx` — the Account-group and
31+
Advanced surfaces (`notifications-section.tsx` remains as a dormant
32+
draft until a preference store exists)
3033
- `access.ts` / `tenancy-api.ts` — tenancy-gate resolution and the
3134
principals/roles/grants HTTP client
3235
- `access-policy.tsx` — the grant preview/editor shared by roles and grants

‎packages/settings-ui/src/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export {
2020
AppearanceSection,
2121
AgentGeneralSection,
2222
} from "./account-section";
23-
export { NotificationsSection } from "./notifications-section";
23+
// NotificationsSection is not exported: it is draft-only and not in the
24+
// registry (CL-6843). Re-export when a preference store backs it.
2425
export { AuditSection } from "./audit-section";
2526
export { AccessPolicyBlock, AccessPolicyEditor } from "./access-policy";
2627
export {

‎packages/settings-ui/src/notifications-section.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
// inbox / notify stack; these toggles are the operator-facing surface for
33
// which classes of activity should surface. No per-user preference store
44
// is mounted yet — draft state only, with an honesty note on save.
5+
//
6+
// REMOVED FROM THE SETTINGS REGISTRY (see section-registry.tsx; CL-6843):
7+
// toggles that save nothing are fake controls, not a settings section —
8+
// honest absence beats that. Re-add the "chat" section to
9+
// `SETTINGS_SECTION_GROUPS`'s "account" group only once a per-user
10+
// preference store exists for these fields and Save actually persists
11+
// them, not before. (Workbench-scoped mute/mentions prefs live on
12+
// `@corbits/chat-ui`'s workbench settings surface and already persist —
13+
// that is a different surface.)
514

615
import { Button, SettingsPanel } from "@corbits/react-ui";
716
import { Check } from "@corbits/icons";

‎packages/settings-ui/src/section-registry.tsx‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,13 @@
1818
// `resolveSettingsSectionGroups` — the domain model of "what settings
1919
// exist and who can see them" lives here, not in an app.
2020

21-
import {
22-
Bell,
23-
Key,
24-
ListBullets,
25-
Shield,
26-
Star,
27-
User,
28-
Users,
29-
} from "@corbits/icons";
21+
import { Key, ListBullets, Shield, Star, User, Users } from "@corbits/icons";
3022

3123
import { AccountSection } from "./account-section";
3224
import type { TenancyAccess } from "./access";
3325
import { AuditSection } from "./audit-section";
3426
import { ConnectionsSection } from "./connections-section";
3527
import { GrantsSection } from "./grants-section";
36-
import { NotificationsSection } from "./notifications-section";
3728
import { PeopleSection } from "./people-section";
3829
import { RolesSection } from "./roles-section";
3930
import type { SettingsSection, SettingsSectionGroup } from "./shell";
@@ -57,8 +48,10 @@ const SETTINGS_SECTION_GROUPS: readonly SettingsSectionGroupDef[] = [
5748
label: SETTINGS_STRINGS.groupAccountLabel,
5849
// No "Your agent" section here: it has no preference store to back it.
5950
// Re-add only once a hub preference store exists and save actually persists.
60-
// Account (General) leads — it is the reference's landing section
61-
// (account card, theme, timezone); notifications follow.
51+
// No Notifications ("chat") section either: toggles with no per-user
52+
// preference store are fake controls — see notifications-section.tsx
53+
// for the re-add condition (CL-6843). Account (General) is the sole
54+
// Account-group section until those stores exist.
6255
sections: [
6356
{
6457
id: "account",
@@ -72,12 +65,6 @@ const SETTINGS_SECTION_GROUPS: readonly SettingsSectionGroupDef[] = [
7265
/>
7366
),
7467
},
75-
{
76-
id: "chat",
77-
title: SETTINGS_STRINGS.notificationsSectionTitle,
78-
icon: Bell,
79-
render: () => <NotificationsSection />,
80-
},
8168
],
8269
},
8370
{

‎packages/settings-ui/test/section-registry.test.tsx‎

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ function ids(groups: ReturnType<typeof resolveSettingsSectionGroups>) {
4040
}
4141

4242
describe("resolveSettingsSectionGroups", () => {
43-
test("Account's Notifications and Account sections are always full; gated Everyone sections are absent, not disabled", () => {
43+
test("Account's Account section is always full; gated Everyone sections are absent, not disabled", () => {
4444
expect(ids(resolveSettingsSectionGroups(denied))).toEqual([
45-
{ id: "account", sections: ["account", "chat"] },
45+
{ id: "account", sections: ["account"] },
4646
{ id: "everyone", sections: ["audit"] },
4747
]);
4848
});
4949

5050
test("an allowed gate adds its section in registry order", () => {
5151
expect(ids(resolveSettingsSectionGroups(allowed))).toEqual([
52-
{ id: "account", sections: ["account", "chat"] },
52+
{ id: "account", sections: ["account"] },
5353
{
5454
id: "everyone",
5555
sections: ["connections", "people", "roles", "grants", "audit"],
@@ -65,7 +65,7 @@ describe("resolveSettingsSectionGroups", () => {
6565
credentials: "denied",
6666
};
6767
expect(ids(resolveSettingsSectionGroups(loading))).toEqual([
68-
{ id: "account", sections: ["account", "chat"] },
68+
{ id: "account", sections: ["account"] },
6969
{ id: "everyone", sections: ["grants", "audit"] },
7070
]);
7171
});
@@ -93,6 +93,17 @@ describe("resolveSettingsSectionGroups", () => {
9393
}
9494
});
9595

96+
test("never registers the notifications section — no preference store exists to back it yet", () => {
97+
for (const access of [denied, allowed]) {
98+
const account = resolveSettingsSectionGroups(access).find(
99+
(group) => group.id === "account",
100+
);
101+
expect(account?.sections.map((section) => section.id)).not.toContain(
102+
"chat",
103+
);
104+
}
105+
});
106+
96107
test("every section carries a leading icon for a host's own nav", () => {
97108
for (const group of resolveSettingsSectionGroups(allowed)) {
98109
for (const section of group.sections) {
@@ -114,7 +125,7 @@ describe("insertEveryoneSections", () => {
114125
extra,
115126
);
116127
expect(ids(groups)).toEqual([
117-
{ id: "account", sections: ["account", "chat"] },
128+
{ id: "account", sections: ["account"] },
118129
{ id: "everyone", sections: ["agents", "skills", "audit"] },
119130
]);
120131
});
@@ -125,10 +136,7 @@ describe("insertEveryoneSections", () => {
125136
extra,
126137
);
127138
const account = groups.find((group) => group.id === "account");
128-
expect(account?.sections.map((section) => section.id)).toEqual([
129-
"account",
130-
"chat",
131-
]);
139+
expect(account?.sections.map((section) => section.id)).toEqual(["account"]);
132140
});
133141

134142
test("is a no-op when there is nothing to insert", () => {

0 commit comments

Comments
 (0)