Repository navigation
Commit 6f9f008
feat(service-messaging): the notification preference quiet_hours declares the quiet-hours widget (#31534)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X9QaksZP89FVq2pH6CVzsEb)_
Fixes #31426
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:通知偏好的「免打扰」字段 `quiet_hours` 加上 `widget:
'quiet-hours'`,控制台改用时区加两个时间的控件,不再显示 JSON 编辑框;存储格式不变。
- 为什么改:#31421 的前端控件(PR #31459,已合并)只认字段上的 widget 提示,和同一对象的 topic、channel
一样,这是它的服务端一半。
- 风险与回滚:只是一个界面提示,不改字段类型、不新增拒绝;未注册该控件的宿主照旧显示 JSON 编辑框。回滚即还原本 PR。
-
先看:`packages/services/service-messaging/src/objects/notification-preference.object.ts`
的 `quiet_hours`。
- 两分钟验证:`cd packages/services/service-messaging && npx vitest run
src/objects/notification-preference-topic-channel-help.test.ts`,预期 5
个全绿。
- 需要你做的:无,席位落地。
## What changes
- `sys_notification_preference.quiet_hours` declares `widget:
'quiet-hours'`, with a `[#30208 row 6, #31426]` comment like the ones on
`topic` and `channel`. The field stays `json`; the stored shape `{ tz?,
start: 'HH:MM', end: 'HH:MM' }` and every refusal are unchanged. The ui
half registers `field:quiet-hours` (PR #31459, merged).
- `content/docs/data-modeling/field-types.mdx` gains a short section on
the three notification preference widgets (`notification-topic`,
`notification-channel`, `quiet-hours`): which field each sits on, what
it draws, what it stores, and that an unregistered name falls back to
the type's default input. Per the ui seat's note on the card, the topic
and channel hints were undocumented until now.
- Changeset: `@objectstack/service-messaging` patch.
## Tests
- `notification-preference-topic-channel-help.test.ts` (the file that
pins the `topic` / `channel` hints) adds: `quiet_hours` declares
`widget: 'quiet-hours'` and stays `json`.
## Verification
<details><summary>Pin and ablation</summary>
```
npx vitest run src/objects/notification-preference-topic-channel-help.test.ts Tests 5 passed (5)
scripts/ablation-replace.mjs --delete the widget line (landed; restored to the HEAD blob):
× quiet_hours declares the quiet-hours widget and stays a json field (#31426)
AssertionError: expected undefined to be 'quiet-hours'
Tests 1 failed | 4 passed (5)
```
</details>
<details><summary>Gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derives 94 families; all
94 run with each exit code captured before any pipe, all exit 0, and
`--ran` reconciles: `94 derived famil(ies) accounted for — 94 run, 0
NOT-MEASURED`. After a typing fix in the new pin (a `required` read the
field shape does not type), `pnpm --filter
@objectstack/service-messaging typecheck` exits 0, `pnpm
check:query-options-erasure` exits 0, the pin and its ablation were
rerun as above, and `pnpm lint` over the two touched `.ts` files exits
0.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5kheduG7p1MXMoHHr4)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 827b193 commit 6f9f008
4 files changed
Lines changed: 36 additions & 0 deletions
File tree
- .changeset
- content/docs/data-modeling
- packages/services/service-messaging/src/objects
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1142 | 1156 | | |
1143 | 1157 | | |
1144 | 1158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
| |||
0 commit comments