From 6c4770b750c7639127cb48fd3be888dc4cdbab9e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 12:48:42 +0000 Subject: [PATCH 1/2] feat(service-messaging): the notification preference's quiet_hours declares the quiet-hours widget The console draws its quiet-hours control instead of the JSON editor; the field stays json with the same stored shape. field-types.mdx documents the three notification preference widgets. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5kheduG7p1MXMoHHr4 --- .changeset/31426-quiet-hours-widget-hint.md | 10 ++++++++++ content/docs/data-modeling/field-types.mdx | 14 ++++++++++++++ ...ification-preference-topic-channel-help.test.ts | 6 ++++++ .../src/objects/notification-preference.object.ts | 7 +++++++ 4 files changed, 37 insertions(+) create mode 100644 .changeset/31426-quiet-hours-widget-hint.md diff --git a/.changeset/31426-quiet-hours-widget-hint.md b/.changeset/31426-quiet-hours-widget-hint.md new file mode 100644 index 00000000000..a3367b0ef90 --- /dev/null +++ b/.changeset/31426-quiet-hours-widget-hint.md @@ -0,0 +1,10 @@ +--- +'@objectstack/service-messaging': patch +--- + +feat(service-messaging): the notification preference's `quiet_hours` declares the `quiet-hours` widget + +Clause-②: no +Metadata-protocol: none + +`sys_notification_preference.quiet_hours` now carries `widget: 'quiet-hours'`, so the console draws its quiet-hours control (a time-zone picker and two times) instead of the JSON editor, as `topic` and `channel` already name their pick-or-type inputs. The field stays `json` with the same stored shape, `{ tz?, start: 'HH:MM', end: 'HH:MM' }`, and nothing new is refused. `field-types.mdx` documents the three notification preference widgets. diff --git a/content/docs/data-modeling/field-types.mdx b/content/docs/data-modeling/field-types.mdx index 6b0553a56ed..bbfa9a1508b 100644 --- a/content/docs/data-modeling/field-types.mdx +++ b/content/docs/data-modeling/field-types.mdx @@ -1139,6 +1139,20 @@ has none, the list is empty, or the load fails, the field is a text box that takes the typed name; a failure is shown with its cause, and the box stays editable. +### Notification preference inputs (`notification-topic`, `notification-channel`, `quiet-hours`) + +The platform's notification preference (`sys_notification_preference`) declares three +widgets, so the record form offers choices instead of a bare box: + +| Widget | Field | Draws | Stores | +|---|---|---|---| +| `notification-topic` | `topic` (`text`; also on `sys_notification_template`) | a pick-or-type list from `GET /api/v1/messaging/preference-options` | the topic as written, `*` for all | +| `notification-channel` | `channel` (`text`) | the same list, marking a known channel whose service is not configured | the channel id as written, `*` for all | +| `quiet-hours` | `quiet_hours` (`json`) | a time-zone picker and two times | `{ tz?, start: 'HH:MM', end: 'HH:MM' }` | + +A typed topic or channel the list does not hold is still stored. Like every `widget` value, +a name no host registers falls back to the type's default input. + ### A widget's face on the record heading A `text` field that declares `widget: 'recipient-picker'` or `widget: 'object-ref'` is drawn diff --git a/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts b/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts index c669ab9b682..95917575b65 100644 --- a/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts +++ b/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts @@ -90,4 +90,10 @@ describe('sys_notification_preference topic / channel help (#25346)', () => { expect(templateFields.channel?.widget).toBeUndefined(); expect(templateFields.channel?.type).toBe('text'); }); + + it('quiet_hours declares the quiet-hours widget and stays a json field (#31426)', () => { + expect(fields.quiet_hours?.widget).toBe('quiet-hours'); + expect(fields.quiet_hours?.type).toBe('json'); + expect(fields.quiet_hours?.required).toBe(false); + }); }); diff --git a/packages/services/service-messaging/src/objects/notification-preference.object.ts b/packages/services/service-messaging/src/objects/notification-preference.object.ts index 3ddb169c2cd..84e50174f64 100644 --- a/packages/services/service-messaging/src/objects/notification-preference.object.ts +++ b/packages/services/service-messaging/src/objects/notification-preference.object.ts @@ -202,6 +202,13 @@ export const NotificationPreference = ObjectSchema.create({ quiet_hours: Field.json({ label: 'Quiet Hours', required: false, + // [#30208 row 6, #31426] The widget hint names the console's + // quiet-hours control (#31421): a time-zone picker and two times + // over the same stored `{ tz?, start: 'HH:MM', end: 'HH:MM' }`. + // The field stays `json`, nothing new is refused, and an + // unregistered widget degrades to the JSON editor. + // `notification-preference-topic-channel-help.test.ts` pins it. + widget: 'quiet-hours', description: 'A daily window when notifications are held and delivered when it ends, for example ' + '{ "tz": "Europe/Berlin", "start": "22:00", "end": "07:00" }. Times are HH:MM in that time zone (UTC when tz is left out), ' + From 1863f9895b1b0e4552a0cd82acc2079bb813ac03 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 13:21:30 +0000 Subject: [PATCH 2/2] test(service-messaging): type the quiet-hours pin's reads Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5kheduG7p1MXMoHHr4 --- .../objects/notification-preference-topic-channel-help.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts b/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts index 95917575b65..a847542daff 100644 --- a/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts +++ b/packages/services/service-messaging/src/objects/notification-preference-topic-channel-help.test.ts @@ -94,6 +94,5 @@ describe('sys_notification_preference topic / channel help (#25346)', () => { it('quiet_hours declares the quiet-hours widget and stays a json field (#31426)', () => { expect(fields.quiet_hours?.widget).toBe('quiet-hours'); expect(fields.quiet_hours?.type).toBe('json'); - expect(fields.quiet_hours?.required).toBe(false); }); });