push feature stable

This commit is contained in:
Fabian Freund
2026-07-19 14:25:48 +02:00
parent dc5e9bbd86
commit 36d85f9373
49 changed files with 5473 additions and 673 deletions
@@ -19,7 +19,6 @@
*/
import 'package:flutter/material.dart';
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:weblibre/features/settings/presentation/controllers/save_settings.dart';
import 'package:weblibre/features/settings/presentation/widgets/settings_detail.dart';
@@ -27,20 +26,8 @@ import 'package:weblibre/features/user/data/models/engine_settings.dart';
import 'package:weblibre/features/user/domain/presentation/dialogs/quit_browser_dialog.dart';
import 'package:weblibre/features/user/domain/repositories/engine_settings.dart';
import 'package:weblibre/utils/exit_app.dart';
import 'package:weblibre/utils/ui_helper.dart';
const List<SettingsSectionDefinition> experimentalSettingsSections = [
SettingsSectionDefinition(
title: 'Web Push',
entries: [
SettingsEntryDefinition(
title: 'Choose UnifiedPush Distributor',
subtitle: 'Select the app that delivers website push notifications',
keywords: ['notifications', 'push'],
child: _UnifiedPushDistributorTile(),
),
],
),
SettingsSectionDefinition(
title: 'Runtime & Startup',
entries: [
@@ -67,46 +54,13 @@ class ExperimentalSettingsScreen extends StatelessWidget {
Widget build(BuildContext context) {
return const SettingsDetailScaffold(
title: 'Experimental',
subtitle: 'Push delivery, runtime isolation, and startup behavior.',
subtitle: 'Runtime isolation and startup behavior.',
icon: MdiIcons.flaskOutline,
sections: experimentalSettingsSections,
);
}
}
class _UnifiedPushDistributorTile extends StatelessWidget {
const _UnifiedPushDistributorTile();
@override
Widget build(BuildContext context) {
return ListTile(
leading: const Icon(MdiIcons.bellBadgeOutline),
title: const Text('Choose UnifiedPush Distributor'),
subtitle: const Text(
'Select the app that should deliver website push notifications to WebLibre.',
),
trailing: const Icon(Icons.chevron_right),
onTap: () async {
final success = await GeckoBrowserService()
.pickUnifiedPushDistributor();
if (!context.mounted) {
return;
}
if (success) {
showInfoMessage(context, 'UnifiedPush distributor configured.');
} else {
showErrorMessage(
context,
'Could not configure UnifiedPush. Install a distributor and try again.',
);
}
},
);
}
}
class _IsolatedProcessEnabledTile extends HookConsumerWidget {
const _IsolatedProcessEnabledTile();
@@ -34,6 +34,7 @@ import 'package:weblibre/features/settings/presentation/screens/search_settings.
import 'package:weblibre/features/settings/presentation/screens/web_content_settings.dart';
import 'package:weblibre/features/settings/presentation/widgets/settings_detail.dart';
import 'package:weblibre/features/settings/presentation/widgets/toolbar_layout_content.dart';
import 'package:weblibre/features/web_push/presentation/screens/web_push_settings.dart';
class SettingsScreen extends HookWidget {
const SettingsScreen({super.key});
@@ -135,6 +136,14 @@ _CategoryGroups _buildCategories() {
sections: webContentSettingsSections,
onTap: (context) => WebContentSettingsRoute().push(context),
),
_SettingsCategoryDefinition(
title: 'Notifications',
subtitle: 'Web push delivery, distributor, site subscriptions',
icon: MdiIcons.bellBadgeOutline,
keywords: const ['push', 'unifiedpush', 'ntfy', 'distributor'],
sections: webPushSettingsSections,
onTap: (context) => WebPushSettingsRoute().push(context),
),
_SettingsCategoryDefinition(
title: 'Search',
subtitle: 'Providers, bangs, search history',