From d3d94b69a9f98a0a4b68dc6ee830466471adf26d Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Mon, 1 Jun 2026 11:28:03 +0900 Subject: feat(notifications): topic-only input (drop URL validation) The Settings field is now a plain topic name (e.g. `my-secret-topic`) instead of a full URL. The transport always posts to `https://ntfy.sh/` (URL-encoded), and the only server-side check is "non-empty when enabled". Removes the user-visible "string does not match the expected pattern" error people hit when typing a bare topic. - packages/core/src/notifications/ntfy.ts: drop validateTopicUrl; add buildNtfyUrl(topic) + exported NTFY_BASE_URL. - packages/core/src/notifications/types.ts, config.ts: rename topicUrl -> topic; update docs. - packages/api/src/routes/notifications.ts: only validates non-empty topic when enabled. Also fixes a latent bug where notifySubagents was dropped on every PUT (was not passed to normalizeNtfyConfig). - packages/frontend/src/lib/components/SettingsPanel.svelte: relabel field "Topic URL" -> "Topic"; placeholder "your-secret-topic"; updated helper copy. - Tests updated: rewrote validateTopicUrl coverage as buildNtfyUrl coverage + proof that previously-rejected topics (dots, spaces, unicode, "Any Topic Whatsoever") now POST cleanly. - HANDOFF.md: added a short "topic-only input" section. --- packages/frontend/src/lib/components/SettingsPanel.svelte | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'packages/frontend/src/lib') diff --git a/packages/frontend/src/lib/components/SettingsPanel.svelte b/packages/frontend/src/lib/components/SettingsPanel.svelte index 08e86ac..dc9d07d 100644 --- a/packages/frontend/src/lib/components/SettingsPanel.svelte +++ b/packages/frontend/src/lib/components/SettingsPanel.svelte @@ -32,7 +32,7 @@ type NotificationEventType = interface NtfyConfigView { enabled: boolean; - topicUrl: string; + topic: string; authToken: string; hasAuthToken?: boolean; events: Record; @@ -48,7 +48,7 @@ const NTFY_EVENT_LABELS: Record = { const DEFAULT_NTFY: NtfyConfigView = { enabled: false, - topicUrl: "", + topic: "", authToken: "", hasAuthToken: false, events: { @@ -162,7 +162,7 @@ async function saveNtfy(): Promise { // `authToken: ""` ⇒ explicit clear (the user typed and cleared). const payload: Partial & { authToken?: string } = { enabled: ntfy.enabled, - topicUrl: ntfy.topicUrl, + topic: ntfy.topic, events: ntfy.events, notifySubagents: ntfy.notifySubagents, }; @@ -421,15 +421,15 @@ $effect(() => { -- cgit v1.2.3