Files
pipelines/app/lib/features/settings/settings_phone_order.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

60 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import 'settings_section.dart';
/// The sections a phone shows first, in this order: how to reach the server
/// (Connection, Servers, Sign in) and then how it reaches you (the
/// notification sections). The rest keep their order after them.
const settingsPhoneFirstIds = [
'managed-connection',
'connection',
'servers',
'sign-in',
'notifications',
'device-delivery',
'notification-events',
];
/// [sections] reordered for a phone: [settingsPhoneFirstIds] first.
List<SettingsSection> settingsPhoneOrder(List<SettingsSection> sections) {
int rank(SettingsSection section) {
final index = settingsPhoneFirstIds.indexOf(section.id);
return index < 0 ? settingsPhoneFirstIds.length : index;
}
final indexed = sections.indexed.toList()
..sort((a, b) {
final byRank = rank(a.$2).compareTo(rank(b.$2));
return byRank != 0 ? byRank : a.$1.compareTo(b.$1);
});
return [for (final (_, section) in indexed) section];
}
const settingsTopicMenuKey = ValueKey<String>('settings.topics');
/// The phone's "Jump to topic" menu beside the search field: every shown
/// section by title; picking one scrolls to it (the wide layout has an index
/// column instead).
class SettingsTopicMenu extends StatelessWidget {
const SettingsTopicMenu({
super.key,
required this.sections,
required this.onJump,
});
final List<SettingsSection> sections;
final ValueChanged<String> onJump;
@override
Widget build(BuildContext context) => PopupMenuButton<String>(
key: settingsTopicMenuKey,
tooltip: 'Jump to topic',
icon: const Icon(Icons.toc),
onSelected: onJump,
itemBuilder: (_) => [
for (final section in sections)
PopupMenuItem(value: section.id, child: Text(section.title)),
],
);
}