You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 14f4d8f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(app-shell): Notification Settings offers Follow organization setting for digest and quiet hours (#36804)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBEaJzgBWzjWCNjBjkVoeRto)_
repo:objectstack#3 · os-support-ai · session_01WGufzi4PechTRCTBrfxV8W
Fixes#36701
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:成员在自己的「通知设置」页,对已自己设过的每日汇总或免打扰时段,多了一个「跟随组织设置」按钮;点了以后页面显示组织当前的设置,并标为来自组织。
- 为什么做:属于通知平台收口工作;成员自己改过一次后,原来只能找管理员才能回到跟随组织,这次让成员自己能撤回。
- 出错会怎样:只影响点了这个按钮的成员本人的汇总或免打扰;按钮只清空那一项,不删任何记录,成员可以随时再选回自己的值。
- 要你做什么:无。
## What changes
- **The action.** On the member's Notification Settings page, digest and
quiet hours each get a "Follow organization setting" button when that
field is the member's own answer (the door's `source` is `own`, so the
member's own general row sets it). Clicking it sends one update of the
member's own general row with that one field empty (`digest: null` or
`quiet_hours: null`), the same empty the Setup grid writes. Under ruling
7073270426 on #35123 empty is "not set": the next row decides, in the
end the organization's default. The page then reads the door again and
draws the value in force with its source label ("Organization default",
or "Default" when the organization sets nothing).
- **When it is not drawn.** No own general row, or the field already
inherited (`default` / `builtin`): there is nothing to clear, so the
button is hidden, not disabled. For a caller with no write grant it is
drawn disabled with the page's read-only reason, like every other
control.
- **What it is not.** The member's general row stays, and so does its
on/off; per-topic and per-channel rows are untouched. No delete is sent
(the member grant has none, ruling 6968686390).
- **Code.** `followOrganizationWrite(general, field)` in
`myPreferences.ts` (returns `null` when there is nothing to clear); the
page draws one button per field from it. The header docblock sentence
that said there is no reset to the organization default is rewritten to
what ships: the two fields follow the organization by an update to
empty; removing a row is still a delete the member grant does not carry.
- **Strings.** `notificationSettings.followOrganization` and
`notificationSettings.followOrganizationFor` (the button's accessible
name, naming the field) in all eleven built-in locales of
`@object-ui/i18n`, where the page's other strings live.
- **Server-side pin (test only).** A new case in the plugin-security
notification-preference suite, on the real SecurityPlugin, the shipped
permission sets and the real `PreferenceResolver`: a member saves their
own digest and quiet hours, clears both with an update to empty through
the own-row policy, the stored row holds empty, `effectiveFor` answers
the organization default for both, and a later change of the
organization default reaches the member.
Read first, by risk:
1.
`ui/packages/app-shell/src/console/notification-settings/myPreferences.ts`:
`followOrganizationWrite`, the condition that decides when there is
something to clear.
2.
`ui/packages/app-shell/src/console/notification-settings/NotificationSettingsPage.tsx`:
the two buttons and their disabled / read-only wiring.
3.
`packages/plugins/plugin-security/src/default-permission-sets.notification-preference.integration.test.ts`:
the new round-trip case.
Two-minute check: `pnpm --dir ui exec vitest run
packages/app-shell/src/console/notification-settings/`, expect 3 files
and 52 tests passing.
## Tests
- `ui/packages/app-shell/src/console/notification-settings/` (3 files):
52/52 pass. New: three unit cases for `followOrganizationWrite` (own
value cleared, explicit off cleared, nothing to clear), three page cases
(digest round trip, quiet-hours round trip, hidden when nothing to
clear), and the external-member read-only case now also asserts the
follow button is disabled with the reason and sends nothing.
- plugin-security
`default-permission-sets.notification-preference.integration.test.ts`:
38/38 pass (37 before plus the round-trip case).
- Ablations, each committed first, mutated through
`scripts/ablation-replace.mjs` (anchor 1 to 0 on disk), restored, and
the restored file's hash matched the HEAD blob:
- `followOrganizationWrite` always `null`: 6 tests red.
- the `source !== 'own'` half of its condition removed: 4 tests red (the
hidden-when-inherited cases and both round trips).
<details><summary>Run readings</summary>
- notification-settings directory: `Test Files 3 passed (3)`, `Tests 52
passed (52)`, lock verdict `command-exit 0`.
- plugin-security suite: `Test Files 1 passed (1)`, `Tests 38 passed
(38)`, lock verdict `command-exit 0`.
- grant map, Slack setup page and the whole `@object-ui/i18n` package:
`Test Files 109 passed (109)`, `Tests 2071 passed | 13 skipped`.
- `type-check` of `@object-ui/app-shell` and `@object-ui/i18n`,
`typecheck` of `@objectstack/plugin-security`: lock verdict
`command-exit 0`.
</details>
## Acceptance notes
- **The ruled-out sentence.** The old header line pointed at ruling
6968686390 on #34728: "Reset to the admin default is not built here. It
needs a delete ... If it is pulled later it is an own-row delete door on
its own card." That ruling scoped a whole-row reset out of that card on
the ground that it needs a delete. It does not forbid a per-field
follow, and ruling 7073270426 since made empty a legal "not set" state
for these two fields, so clearing them is an update inside the existing
grant. A whole-row reset (on/off and per-cell rows included) still needs
a delete and is still not built.
- **Server acceptance of the empty update, measured.** The round-trip
case above is the measurement: the own-row policy accepts a member's
update writing empty to `digest` and `quiet_hours`, and the resolver
then answers the organization default.
- **Inherited display.** The door already says where each value comes
from (`own` / `default` / `builtin`), so the page labels the inherited
value without a server change.
- **Left as is.** The member's general row keeps deciding the matrix's
on/off for cells they did not set (the existing warning under the
General heading says so). Following the organization for on/off would
need that row removed, which is the delete above.
## Verification
Local derived gate families (`dispatch-gates.mjs --commands`, head
`9268c30fe`): 72 derived; 70 ran with exit 0; `--ran` with recorded exit
codes answers 72 accounted for, 70 run, 2 NOT-MEASURED, 0 UNRUN. Two
families exited 3 (`PREREQUISITE NOT MET`, built output missing:
`check:i18n`, `check:dual-build-cjs-loads`) and are NOT MEASURED
locally; CI runs both in `Lint & Repo Gates`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufzi4PechTRCTBrfxV8W)_
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufzi4PechTRCTBrfxV8W -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
feat(app-shell): Notification Settings offers "Follow organization setting" for digest and quiet hours
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
Once a member has saved a digest or quiet hours of their own, the Notification Settings page now offers a "Follow organization setting" action beside each one. It empties that field on the member's own general preference (the same empty the Setup grid writes), so the organization's default decides again, including any later change to it. The page then shows the value in force as the organization default. The action appears only where the field is the member's own choice; where there is nothing to clear, it is not drawn.
12
+
13
+
The member's own general preference itself stays, and so does its on/off; per-topic and per-channel choices are not reset by this action.
14
+
15
+
New strings `notificationSettings.followOrganization` and `notificationSettings.followOrganizationFor` in all eleven built-in locales.
0 commit comments