Files
pipelines/app/lib/features/settings/settings_page_sections.dart
T
alan fc7dbb0ac0 Remove ntfy: notifications go only through the app notification stream
Server: drop ntfy publishing (stage hooks, run outbox, chat attention, chat
tool notify, auto-switch and schedule notices), the chat push outbox (its
table is dropped at startup), ntfy status/endpoints and PIPELINES_NTFY_*.
The app_notifications stream, subscribe/clear and kinds are unchanged.
Notification settings keep run_finished/chat_needs_you/chat_reply_finished;
ntfy_enabled is accepted and ignored and its stored row is never read.

Stage type=ntfy is rejected: "ntfy stages were removed; notifications go to
the Pipelines apps — use the stage notify hook". The notify hook remains.

Installer: no ntfy build, accounts, config or supervisor child; manifest
gets top-level "mode" (legacy ntfy.mode still read). Reinstall retires an
old ntfy (safe PID-file stop, deletes binary, config, data dir, token, log,
with a note in logs/install.log); uninstall cleans leftovers.

App: ntfy settings section replaced by "Notification events"; texts updated.
Docs: docs/ntfy.md folded into docs/notifications.md; install, docker, cli,
author skill references updated; security review M1 marked resolved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 23:24:24 +00:00

258 lines
8.8 KiB
Dart

part of 'settings_screen.dart';
/// The Settings page's sections, in order. Each entry keeps the widgets the
/// former category pages held; a server-backed entry is `lazy`.
extension _SettingsPageSections on _SettingsScreenState {
List<SettingsSection> _pageSections() {
final servers = widget.servers;
return [
SettingsSection(
id: 'interface-size',
title: 'Interface size',
keywords: 'text size scale zoom large small font',
builder: (_) => const SettingsScaleSection(),
),
if (speechController.supported)
const SettingsSection(
id: 'read-aloud',
title: 'Read aloud',
keywords: 'speech voice audio speaking rate read aloud',
builder: _readAloudBuilder,
),
SettingsSection(
id: 'animations',
title: 'Animations',
keywords: 'animation speed motion quick switch',
builder: (_) => SettingsAnimationSection(
controller:
widget.animationSpeed ?? AnimationSpeedController.instance,
),
),
SettingsSection(
id: 'chat-navigation',
title: SettingsChatNavigationSection.title,
keywords: 'mobile phone chat navigation quick switch stack floating',
builder: (_) => const SettingsChatNavigationSection(),
),
SettingsSection(
id: 'design',
title: designSectionTitle,
keywords: 'design theme look style terminal monospace appearance',
builder: (_) => SettingsDesignSection(
controller: widget.designs ?? AppDesignController.instance,
),
),
SettingsSection(
id: 'font',
title: fontSectionTitle,
keywords: 'font typeface custom text',
builder: (_) => SettingsFontSection(
controller: widget.fonts ?? AppFontController.instance,
),
),
SettingsSection(
id: 'terminal',
title: 'Terminal',
keywords: 'terminal layout mode split',
builder: (_) => SettingsTerminalSection(
layout: widget.terminalLayout ?? TerminalLayout.instance,
),
),
if (servers != null) ...[
SettingsSection(
id: 'servers',
title: 'Servers',
keywords: 'saved server profile add remove switch address',
builder: (_) => SavedServersSection(connections: servers),
),
SettingsSection(
id: 'managed-connection',
title: 'Connection',
keywords: 'address current reconnect disconnect status',
builder: (_) => ManagedConnectionSection(
client: widget.client,
controller: _controller,
),
),
] else
SettingsSection(
id: 'connection',
title: 'Connection',
keywords: 'server url address connect disconnect reconnect status',
builder: (_) => SettingsConnectionSection(
controller: _controller,
serverUrlField: _serverUrlField,
),
),
if (widget.showSignIn)
SettingsSection(
id: 'sign-in',
title: 'Sign in',
keywords: 'login password web account',
builder: (_) => _single(
'Sign in',
SettingsSignInSection(
endpoint: _endpoint,
onChanged: _reconnectAfterSignIn,
),
),
),
if (widget.showSignIn || kIsWeb)
SettingsSection(
id: 'sign-in-security',
title: 'Sign-in security',
keywords: 'password sessions sign out everywhere revoke weak',
lazy: true,
builder: (_) => _single(
'Sign-in security',
SettingsSecuritySection(
endpoint: _endpoint,
onSignedOut: _reconnectAfterSignIn,
),
),
),
SettingsSection(
id: 'workspace',
title: 'Workspace',
keywords: 'workspace path folder directory server save',
builder: (_) => SettingsWorkspaceSection(
controller: _controller,
workspaceField: _workspaceField,
),
),
SettingsSection(
id: 'open-in-chat',
title: 'Open in chat',
keywords: 'open in chat run pipeline harness model default new chat',
lazy: true,
builder: (_) => SettingsOpenInChatSection(gateway: widget.client),
),
if (widget.notifications case final notifications?)
SettingsSection(
id: 'notifications',
title: notificationSectionTitle,
keywords: 'notification permission browser alerts enable',
builder: (_) =>
SettingsNotificationsSection(controller: notifications),
),
if (widget.deliveryService case final service? when service.supported)
SettingsSection(
id: 'device-delivery',
title: deviceDeliveryTitle,
keywords: 'background delivery battery android notifications',
builder: (_) => SettingsDeviceDeliverySection(
bridge: service,
controller: widget.deliveryServiceController,
requestNotificationPermission: widget.notifications == null
? null
: () async {
await widget.notifications!.requestPermission();
},
),
),
SettingsSection(
id: 'notification-events',
title: notificationEventsTitle,
keywords:
'notifications push phone events all devices run finished '
'chat needs you reply finished',
lazy: true,
builder: (_) => SettingsNotificationSettingsSection(
gateway: widget.client,
connected:
widget.client.state.kind == transport.ConnectionKind.connected,
),
),
SettingsSection(
id: 'data',
title: 'Data management',
keywords: 'storage retention worktrees cleanup disk usage',
builder: (_) => _single(
'Data management',
SettingsStorageSection(gateway: widget.client),
),
),
SettingsSection(
id: 'server',
title: 'Server',
keywords: 'health cpu memory gpu process stats',
builder: (_) =>
_single('Server', SettingsHealthSection(gateway: widget.client)),
),
if (widget.onOpenSchedules case final open?)
SettingsSection(
id: 'library',
title: 'Library',
keywords: 'schedules saved runs pipelines',
builder: (_) => SettingsGroup(
title: 'Library',
leadingRows: true,
children: [SettingsSchedulesSection(onOpen: open)],
),
),
if (widget.showAndroidDownload)
SettingsSection(
id: 'android-app',
title: 'Android app',
keywords: 'apk download install',
builder: (_) =>
_single('Android app', const SettingsAndroidDownloadSection()),
),
if (widget.showSignIn && appUpdatesSupported)
SettingsSection(
id: 'app-updates',
title: 'App updates',
keywords: 'update version build install',
builder: (_) => _single(
'App updates',
SettingsUpdatesSection(endpoint: _endpoint, servers: servers),
),
)
else if (!widget.showAndroidDownload)
SettingsSection(
id: 'app-updates-managed',
title: 'App updates',
keywords: 'update version build administrator',
builder: (_) => _single(
'App updates',
const Text(
'This installation is updated by its server administrator.',
),
),
),
// Help and about: the walkthrough's "Show the walkthrough" row sits in
// this group beside the keyboard shortcuts.
SettingsSection(
id: 'help',
title: 'Help and about',
keywords: 'keyboard shortcuts help about walkthrough tour guide',
builder: (_) => SettingsGroup(
title: 'Help and about',
leadingRows: true,
children: [
const SettingsKeyboardShortcutsSection(),
SettingsRow(
key: SettingsKeys.showWalkthrough,
leading: const Icon(Icons.school_outlined),
title: const Text('Show the walkthrough'),
subtitle: const Text('Replay the short tour of Pipelines.'),
chevron: true,
enabled: widget.onShowWalkthrough != null,
onTap: widget.onShowWalkthrough,
),
],
),
),
];
}
static Widget _readAloudBuilder(BuildContext _) =>
const SettingsReadAloudSection();
/// A group holding one free-form block (a form, a status with buttons).
Widget _single(String title, Widget child) => SettingsGroup(
title: title,
children: <Widget>[SettingsGroupItem(child: child)],
);
}