Remove Templates from Settings

Keep the Templates destination available through its direct routes while removing the obsolete Settings entry and wiring. Update navigation coverage and document the preserved route behavior.
This commit is contained in:
2026-11-12 01:02:11 +00:00
parent 4f1b45571f
commit 1e07ab1ddc
10 changed files with 155 additions and 100 deletions
-1
View File
@@ -923,7 +923,6 @@ class _PipelinesAppState extends State<PipelinesApp>
store: SharedPreferencesSettingsStore(
serverId: widget.serverId ?? '',
),
onOpenTemplates: _delegate.openTemplates,
notifications: _notifications,
deliveryService: _deliveryService,
deliveryServiceController: _deliveryController,
@@ -9,7 +9,6 @@ abstract final class SettingsKeys {
static const reconnect = ValueKey<String>('settings.reconnect');
static const workspace = ValueKey<String>('settings.workspace');
static const saveWorkspace = ValueKey<String>('settings.saveWorkspace');
static const templates = ValueKey<String>('settings.templates');
static const schedules = ValueKey<String>('settings.schedules');
static const keyboardShortcuts = ValueKey<String>(
'settings.keyboardShortcuts',
@@ -6,7 +6,7 @@ import 'settings_row.dart';
/// The Settings entry to the saved-schedule list.
///
/// The row only opens the route; the list's own controller performs the single
/// `list_schedules` read, exactly like the Templates entry.
/// `list_schedules` read.
const String settingsSchedulesLabel = 'Browse schedules';
const String settingsSchedulesSecondary =
'Saved run configurations for every pipeline.';
@@ -33,7 +33,6 @@ import 'security/settings_security_section.dart';
import 'settings_updates_section.dart';
import '../updates/app_updates.dart';
import 'settings_store.dart';
import 'settings_templates_section.dart';
import 'server_connections.dart';
import 'saved_servers_section.dart';
import 'managed_connection_section.dart';
@@ -58,7 +57,6 @@ class SettingsScreen extends StatefulWidget {
this.ping,
this.embedded = false,
this.navigationScope,
this.onOpenTemplates,
this.onOpenSchedules,
this.notifications,
this.showSignIn = false,
@@ -108,10 +106,6 @@ class SettingsScreen extends StatefulWidget {
/// The logical server scope used to restore the last Settings category.
final String? navigationScope;
/// Opens the Templates gallery. Null keeps Settings standalone/incomplete
/// without a dead row that would go nowhere.
final VoidCallback? onOpenTemplates;
/// Opens the saved-schedule list above Settings.
final VoidCallback? onOpenSchedules;
@@ -1,30 +0,0 @@
import 'package:flutter/material.dart';
import 'settings_keys.dart';
import 'settings_row.dart';
/// The Settings entry to the Templates gallery.
///
/// The row wording matches the web Settings page: `Browse templates` with the
/// server-catalogue secondary line. It only opens the route; loading the
/// catalogue is the gallery's own read.
const String settingsTemplatesLabel = 'Browse templates';
const String settingsTemplatesSecondary =
'Reusable pipeline definitions offered by the server.';
/// A navigation row (chevron) for a Settings group.
class SettingsTemplatesSection extends StatelessWidget {
const SettingsTemplatesSection({super.key, required this.onOpen});
final VoidCallback onOpen;
@override
Widget build(BuildContext context) => SettingsRow(
key: SettingsKeys.templates,
leading: const Icon(Icons.widgets_outlined),
title: const Text(settingsTemplatesLabel),
subtitle: const Text(settingsTemplatesSecondary),
chevron: true,
onTap: onOpen,
);
}
@@ -87,16 +87,11 @@ extension _SettingsTopicPages on _SettingsScreenState {
leadingRows: true,
children: const [SettingsKeyboardShortcutsSection()],
),
if (widget.onOpenSchedules != null || widget.onOpenTemplates != null)
if (widget.onOpenSchedules case final open?)
SettingsGroup(
title: 'Library',
leadingRows: true,
children: [
if (widget.onOpenSchedules case final open?)
SettingsSchedulesSection(onOpen: open),
if (widget.onOpenTemplates case final open?)
SettingsTemplatesSection(onOpen: open),
],
children: [SettingsSchedulesSection(onOpen: open)],
),
],
),