Files
pipelines/app/notes/notification-settings.md
T
alan b109ab3e06 Notify on run end only for runs marked Notify me
Auto runs no longer alert on failure or success; only notify_mode on does,
unless the run_finished setting (now 'Notify when any run ends', default off)
opts into every run end. Waiting still notifies auto and on runs. The setting
is stored under a new key so a value saved under the old meaning is ignored.
2026-10-31 16:52:04 +00:00

2.1 KiB

Notification settings (ntfy checkboxes)

Settings has a Phone notifications section beside the in-app Notifications permission tile. It holds three checkboxes for the server's global ntfy choices: Notify when any run ends (run_finished, default off, subtitle "Otherwise only runs started with Notify me"), Chat needs your answer or approval (chat_needs_you, default on) and Chat reply finished (chat_reply_finished, default off), under one line saying they go through ntfy to the subscribed devices. Material uses CheckboxListTile. Cupertino uses CupertinoListTile with a CupertinoCheckbox in an inset grouped section. Colours come from the theme only.

Files: lib/features/settings/ntfy_settings_controller.dart (gateway load/toggle, revert on failure), lib/features/settings/settings_ntfy_section.dart (widget), wired into settings_screen.dart with the shared client as the ApiGateway.

Behaviour: the section loads notification_settings when the shared connection is connected and reloads after reconnecting. While offline it shows "Connect to a server to change these." Checkboxes are disabled while loading or saving. A toggle sends set_notification_settings with only that key and shows the new value at once. The stored reply then replaces every value. A refusal reverts the checkbox and shows "Could not save: " inline. A load failure shows the reason with a Retry button.

Verification: test/features/settings/settings_ntfy_section_test.dart covers both styles. It checks loading, the exact set request, and revert plus error on failure. It also covers the disabled state while loading, the offline state and retry after a failed load. The existing Settings screen and Templates wiring tests now answer the extra queued notification_settings read. Full flutter test passed, flutter analyze reported only the pre-existing info in artifact_viewer_page_test.dart, and flutter build web succeeded.

Not done: no browser capture or device run. Rendered behaviour is verified by widget tests only, and phone delivery of the new notifications was not tested.