Merge branch 'GopeedLab:main' into main

This commit is contained in:
sun committed 2026-09-14 09:55:31 +08:00
commit ee9b16794e
61 files changed
+2211 -456

No files matched your search

+3
View File
@@ -24,6 +24,9 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<!-- app_links owns scheme navigation for both task creation and extension installation. -->
<key>FlutterDeepLinkingEnabled</key>
<false/>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict> <dict>
+21
View File
@@ -1,6 +1,27 @@
import Flutter import Flutter
import UIKit import UIKit
import app_links
class SceneDelegate: FlutterSceneDelegate { class SceneDelegate: FlutterSceneDelegate {
override func scene(
_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions
) {
super.scene(scene, willConnectTo: session, options: connectionOptions)
forwardGopeedLinks(connectionOptions.urlContexts)
}
override func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
super.scene(scene, openURLContexts: URLContexts)
forwardGopeedLinks(URLContexts)
}
private func forwardGopeedLinks(_ contexts: Set<UIOpenURLContext>) {
// app_links 6.x only registers AppDelegate callbacks. UIScene delivers
// both cold-start and running-app scheme links here instead.
for context in contexts where context.url.scheme?.lowercased() == "gopeed" {
AppLinks.shared.handleLink(url: context.url)
}
}
} }
@@ -144,7 +144,7 @@ class AppDeepLinkController extends AsyncNotifier<AppDeepLinkState> {
Map<String, dynamic> _decodeParams(String params) { Map<String, dynamic> _decodeParams(String params) {
final safeParams = params.replaceAll('"', '').replaceAll(' ', '+'); final safeParams = params.replaceAll('"', '').replaceAll(' ', '+');
final paramsJson = String.fromCharCodes(base64Decode(base64.normalize(safeParams))); final paramsJson = utf8.decode(base64Decode(base64.normalize(safeParams)));
return jsonDecode(paramsJson) as Map<String, dynamic>; return jsonDecode(paramsJson) as Map<String, dynamic>;
} }
+52 -32
View File
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -15,6 +16,8 @@ import '../../features/tasks/domain/task_record.dart';
import '../../features/tasks/presentation/pages/task_details_page.dart'; import '../../features/tasks/presentation/pages/task_details_page.dart';
import '../../features/tasks/presentation/pages/task_files_page.dart'; import '../../features/tasks/presentation/pages/task_files_page.dart';
import 'shells/main_shell.dart'; import 'shells/main_shell.dart';
import 'mobile_exit_guard.dart';
import 'runtime_page.dart';
class AppRouter { class AppRouter {
static final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>(); static final GlobalKey<NavigatorState> rootNavigatorKey = GlobalKey<NavigatorState>();
@@ -27,6 +30,36 @@ class AppRouter {
} }
static GoRouter build(WebAuthController webAuthController) { static GoRouter build(WebAuthController webAuthController) {
// Keep desktop and web sections as peers; native mobile retains home below them.
final isMobile =
!kIsWeb && (defaultTargetPlatform == TargetPlatform.android || defaultTargetPlatform == TargetPlatform.iOS);
final sectionRoutes = [
GoRoute(
path: isMobile ? 'extensions' : '/extensions',
builder: _runtimePage((context, state) => const ExtensionsPage()),
routes: [
GoRoute(
path: ':id',
builder: _runtimePage(
(context, state) => ExtensionDetailsPage(
extensionId: state.pathParameters['id'] ?? '',
initialItem: state.extra is ExtensionListItem ? state.extra as ExtensionListItem : null,
),
),
),
],
),
GoRoute(
path: isMobile ? 'settings' : '/settings',
builder: _runtimePage((context, state) => const SettingsPage()),
routes: [
GoRoute(
path: ':section',
builder: _runtimePage((context, state) => SettingsPage(sectionKey: state.pathParameters['section'])),
),
],
),
];
return GoRouter( return GoRouter(
navigatorKey: rootNavigatorKey, navigatorKey: rootNavigatorKey,
refreshListenable: webAuthController, refreshListenable: webAuthController,
@@ -44,60 +77,47 @@ class AppRouter {
routes: [ routes: [
GoRoute(path: '/login', parentNavigatorKey: rootNavigatorKey, builder: (context, state) => const LoginPage()), GoRoute(path: '/login', parentNavigatorKey: rootNavigatorKey, builder: (context, state) => const LoginPage()),
ShellRoute( ShellRoute(
builder: (context, state, child) => MainShell(child: child), builder: (context, state, child) => MobileExitGuard(child: MainShell(child: child)),
routes: [ routes: [
GoRoute( GoRoute(
path: '/', path: '/',
builder: (context, state) => const HomePage(), builder: _runtimePage((context, state) => const HomePage()),
routes: [ routes: [
GoRoute(path: 'create', builder: (context, state) => const CreateTaskWindowPage()), GoRoute(path: 'create', builder: _runtimePage((context, state) => const CreateTaskWindowPage())),
GoRoute( GoRoute(
path: 'tasks/:id', path: 'tasks/:id',
builder: (context, state) => TaskDetailsPage( builder: _runtimePage(
taskId: state.pathParameters['id'] ?? '', (context, state) => TaskDetailsPage(
initialTask: state.extra is TaskRecord ? state.extra as TaskRecord : null, taskId: state.pathParameters['id'] ?? '',
initialTask: state.extra is TaskRecord ? state.extra as TaskRecord : null,
),
), ),
routes: [ routes: [
GoRoute( GoRoute(
path: 'files', path: 'files',
builder: (context, state) => TaskFilesPage( builder: _runtimePage(
taskId: state.pathParameters['id'] ?? '', (context, state) => TaskFilesPage(
initialTask: state.extra is TaskRecord ? state.extra as TaskRecord : null, taskId: state.pathParameters['id'] ?? '',
initialTask: state.extra is TaskRecord ? state.extra as TaskRecord : null,
),
), ),
), ),
], ],
), ),
if (isMobile) ...sectionRoutes,
], ],
), ),
GoRoute( if (!isMobile) ...sectionRoutes,
path: '/extensions',
builder: (context, state) => const ExtensionsPage(),
routes: [
GoRoute(
path: ':id',
builder: (context, state) => ExtensionDetailsPage(
extensionId: state.pathParameters['id'] ?? '',
initialItem: state.extra is ExtensionListItem ? state.extra as ExtensionListItem : null,
),
),
],
),
GoRoute(
path: '/settings',
builder: (context, state) => const SettingsPage(),
routes: [
GoRoute(
path: ':section',
builder: (context, state) => SettingsPage(sectionKey: state.pathParameters['section']),
),
],
),
], ],
), ),
], ],
); );
} }
static GoRouterWidgetBuilder _runtimePage(GoRouterWidgetBuilder builder) {
return (context, state) => RuntimePage(builder: (context) => builder(context, state));
}
static String _safeReturnLocation(String? location) { static String _safeReturnLocation(String? location) {
if (location == null || location.isEmpty) return '/'; if (location == null || location.isEmpty) return '/';
final uri = Uri.tryParse(location); final uri = Uri.tryParse(location);
@@ -0,0 +1,61 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import '../../shared/navigation/app_exit_confirmation_controller.dart';
/// Handles exit at the shell route after the nested Navigator declines a pop.
/// Child routes and dialogs still pop through GoRouter before reaching this guard.
class MobileExitGuard extends StatefulWidget {
const MobileExitGuard({super.key, required this.child});
final Widget child;
@override
State<MobileExitGuard> createState() => _MobileExitGuardState();
}
class _MobileExitGuardState extends State<MobileExitGuard> with WidgetsBindingObserver {
final _controller = AppExitConfirmationController();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state != AppLifecycleState.resumed) _controller.dispose();
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
if (kIsWeb || defaultTargetPlatform != TargetPlatform.android) return widget.child;
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, _) {
if (!didPop) unawaited(_controller.handleBack(context));
},
child: NotificationListener<NavigationNotification>(
onNotification: (notification) {
if (notification.canHandlePop) return false;
// An empty nested back stack still has this shell's exit guard.
// Otherwise its startup notification disables Android's back callback.
const NavigationNotification(canHandlePop: true).dispatch(context);
return true;
},
child: widget.child,
),
);
}
}
@@ -0,0 +1,30 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../application/app_runtime_controller.dart';
import '../../l10n/l10n.dart';
/// Gates page content without unmounting the Navigator during startup.
class RuntimePage extends ConsumerWidget {
const RuntimePage({super.key, required this.builder});
final WidgetBuilder builder;
@override
Widget build(BuildContext context, WidgetRef ref) {
return ref
.watch(appRuntimeControllerProvider)
.when(
loading: () => const Scaffold(child: Center(child: CircularProgressIndicator())),
error: (error, _) => Scaffold(
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 420),
child: Text(context.l10n.runtimeInitializationFailed(error.toString()), textAlign: TextAlign.center),
),
),
),
data: (_) => builder(context),
);
}
}
@@ -4,7 +4,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import '../../../api/model/create_task.dart'; import '../../../api/model/create_task.dart';
import '../../application/app_deep_link_controller.dart'; import '../../application/app_deep_link_controller.dart';
@@ -16,10 +15,7 @@ import '../../../features/tasks/application/pending_create_task.dart';
import '../../../features/tasks/application/pending_update_task.dart'; import '../../../features/tasks/application/pending_update_task.dart';
import '../../../features/tasks/application/tasks_controller.dart'; import '../../../features/tasks/application/tasks_controller.dart';
import '../../../features/tasks/presentation/widgets/pending_update_dialog.dart'; import '../../../features/tasks/presentation/widgets/pending_update_dialog.dart';
import '../../../l10n/l10n.dart';
import '../../../core/window/app_window_launcher.dart'; import '../../../core/window/app_window_launcher.dart';
import '../../../core/utils/breakpoints.dart';
import '../../../shared/navigation/app_exit_confirmation_controller.dart';
import '../../../shared/widgets/app_toast.dart'; import '../../../shared/widgets/app_toast.dart';
class MainShell extends ConsumerStatefulWidget { class MainShell extends ConsumerStatefulWidget {
@@ -34,7 +30,6 @@ class MainShell extends ConsumerStatefulWidget {
class _MainShellState extends ConsumerState<MainShell> { class _MainShellState extends ConsumerState<MainShell> {
String? _shownUpdateVersion; String? _shownUpdateVersion;
bool _handlingPendingUpdateRequest = false; bool _handlingPendingUpdateRequest = false;
final _exitConfirmationController = AppExitConfirmationController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -65,40 +60,13 @@ class _MainShellState extends ConsumerState<MainShell> {
} }
}); });
final runtime = ref.watch(appRuntimeControllerProvider); final runtime = ref.watch(appRuntimeControllerProvider);
final content = runtime.when( if (runtime.hasValue) {
loading: () => const shad.Scaffold(child: Center(child: shad.CircularProgressIndicator())), ref.watch(appPlatformControllerProvider);
error: (error, _) => shad.Scaffold( ref.watch(appDeepLinkControllerProvider);
child: Center( ref.watch(appNotificationControllerProvider);
child: ConstrainedBox( }
constraints: const BoxConstraints(maxWidth: 420), // Keep the nested Navigator mounted even while the runtime is starting.
child: Text(context.l10n.runtimeInitializationFailed(error.toString()), textAlign: TextAlign.center), return widget.child;
),
),
),
data: (_) {
ref.watch(appPlatformControllerProvider);
ref.watch(appDeepLinkControllerProvider);
ref.watch(appNotificationControllerProvider);
return widget.child;
},
);
return _buildMobileBackGuard(context, content);
}
Widget _buildMobileBackGuard(BuildContext context, Widget child) {
final isAndroidMobile =
!kIsWeb &&
defaultTargetPlatform == TargetPlatform.android &&
MediaQuery.sizeOf(context).width < Breakpoints.mobile;
if (!isAndroidMobile || context.canPop()) return child;
return PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, _) {
if (!didPop) unawaited(_exitConfirmationController.handleBack(context));
},
child: child,
);
} }
void _schedulePendingUpdateRequest(PendingUpdateRequest request) { void _schedulePendingUpdateRequest(PendingUpdateRequest request) {
@@ -0,0 +1,23 @@
abstract final class CompactCountFormatter {
// Counts start compacting at ten thousand by product convention, then use
// progressively larger decimal units so the rendered label stays bounded.
static const _units = [
(divisor: 1000000000000000000, suffix: 'qi'),
(divisor: 1000000000000000, suffix: 'q'),
(divisor: 1000000000000, suffix: 't'),
(divisor: 1000000000, suffix: 'b'),
(divisor: 1000000, suffix: 'm'),
(divisor: 10000, suffix: 'w'),
];
static String format(int count) {
if (count <= 0) return '0';
if (count < _units.last.divisor) return count.toString();
final unit = _units.firstWhere((unit) => count >= unit.divisor);
final whole = count ~/ unit.divisor;
final tenth = (count % unit.divisor) ~/ (unit.divisor ~/ 10);
final value = whole < 10 && tenth > 0 ? '$whole.$tenth' : '$whole';
return '$value${unit.suffix}';
}
}
@@ -19,7 +19,7 @@ Future<bool> open(String filePath) async {
Future<bool> reveal(String filePath) async { Future<bool> reveal(String filePath) async {
try { try {
if (!(Platform.isWindows || Platform.isMacOS || Platform.isLinux)) { if (!(Platform.isWindows || Platform.isMacOS || Platform.isLinux)) {
return open(filePath); return false;
} }
if (await FileSystemEntity.isFile(filePath)) { if (await FileSystemEntity.isFile(filePath)) {
@@ -11,6 +11,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../../../../api/model/extension.dart' as api_extension; import '../../../../api/model/extension.dart' as api_extension;
import '../../../../api/model/store_extension.dart'; import '../../../../api/model/store_extension.dart';
import '../../../../core/utils/breakpoints.dart'; import '../../../../core/utils/breakpoints.dart';
import '../../../../core/utils/compact_count_formatter.dart';
import '../../../../core/window/app_window_chrome.dart'; import '../../../../core/window/app_window_chrome.dart';
import '../../../../shared/theme/app_design_tokens.dart'; import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/theme/app_palette.dart'; import '../../../../shared/theme/app_palette.dart';
@@ -24,8 +25,10 @@ import '../../application/extensions_controller.dart';
import '../../application/pending_extension_install.dart'; import '../../application/pending_extension_install.dart';
import '../widgets/extension_detail_view.dart'; import '../widgets/extension_detail_view.dart';
import '../widgets/extension_icon.dart'; import '../widgets/extension_icon.dart';
import '../widgets/extension_setting_field.dart';
import '../widgets/extension_update_dialog.dart';
const _extensionCardMinWidth = 280.0; const _extensionCardMinWidth = 290.0;
const _extensionGridSpacing = 10.0; const _extensionGridSpacing = 10.0;
int _extensionGridColumnCount(double width) { int _extensionGridColumnCount(double width) {
@@ -45,6 +48,9 @@ class ExtensionsPage extends ConsumerStatefulWidget {
class _ExtensionsPageState extends ConsumerState<ExtensionsPage> { class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
final _searchController = TextEditingController(); final _searchController = TextEditingController();
final _installController = TextEditingController(); final _installController = TextEditingController();
final _installAnchorKey = GlobalKey();
final _installPopoverKey = GlobalKey<_InstallPopoverState>();
bool _installDevMode = false;
final _listScrollController = ScrollController(); final _listScrollController = ScrollController();
final Map<String, TextEditingController> _settingControllers = {}; final Map<String, TextEditingController> _settingControllers = {};
ExtensionListItem? _detailItem; ExtensionListItem? _detailItem;
@@ -76,15 +82,28 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final palette = AppPalette.of(context); final palette = AppPalette.of(context);
final isDesktop = MediaQuery.sizeOf(context).width >= Breakpoints.mobile; final isDesktop = MediaQuery.sizeOf(context).width >= Breakpoints.mobile;
ref.listen(pendingExtensionInstallProvider, (previous, next) { final pendingInstall = ref.watch(pendingExtensionInstallProvider);
if (next == null) return; if (pendingInstall != null) {
ref.read(pendingExtensionInstallProvider.notifier).clear(); // The request can arrive before this page is mounted. Consume it only
unawaited( // after the toolbar is laid out, so cold and warm links share the same UI.
_runAction( WidgetsBinding.instance.addPostFrameCallback((_) {
() => ref.read(extensionsControllerProvider.notifier).installFromUrl(next.url, devInstall: next.devMode), if (!mounted || !identical(ref.read(pendingExtensionInstallProvider), pendingInstall)) return;
), if (_installPopoverKey.currentState?._installing == true) return;
); final anchorContext = _installAnchorKey.currentContext;
}); if (anchorContext == null) return;
_installController.text = pendingInstall.url;
_installDevMode = pendingInstall.devMode;
_showInstallPopover(anchorContext);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (!mounted || !identical(ref.read(pendingExtensionInstallProvider), pendingInstall)) return;
final popover = _installPopoverKey.currentState;
if (popover == null || popover._installing) return;
ref.read(pendingExtensionInstallProvider.notifier).clear();
unawaited(popover._install());
});
WidgetsBinding.instance.ensureVisualUpdate();
});
}
final stateAsync = ref.watch(extensionsControllerProvider); final stateAsync = ref.watch(extensionsControllerProvider);
final body = Stack( final body = Stack(
children: [ children: [
@@ -152,6 +171,7 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
onSearch: (query) => _runAction(() => ref.read(extensionsControllerProvider.notifier).searchStore(query)), onSearch: (query) => _runAction(() => ref.read(extensionsControllerProvider.notifier).searchStore(query)),
onSort: (sort) => _runAction(() => ref.read(extensionsControllerProvider.notifier).changeSort(sort)), onSort: (sort) => _runAction(() => ref.read(extensionsControllerProvider.notifier).changeSort(sort)),
onFilter: ref.read(extensionsControllerProvider.notifier).changeFilter, onFilter: ref.read(extensionsControllerProvider.notifier).changeFilter,
installAnchorKey: _installAnchorKey,
onOpenInstall: _openInstallPopover, onOpenInstall: _openInstallPopover,
onDevelopExtension: _openExtensionDevelopmentDocs, onDevelopExtension: _openExtensionDevelopmentDocs,
onInstallFolder: _installFromFolder, onInstallFolder: _installFromFolder,
@@ -167,7 +187,9 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
Future<void> _installFromUrl() async { Future<void> _installFromUrl() async {
final url = _installController.text.trim(); final url = _installController.text.trim();
if (url.isEmpty) return; if (url.isEmpty) return;
await _runAction(() => ref.read(extensionsControllerProvider.notifier).installFromUrl(url)); await _runAction(
() => ref.read(extensionsControllerProvider.notifier).installFromUrl(url, devInstall: _installDevMode),
);
} }
Future<void> _loadNextPageIfNeeded() async { Future<void> _loadNextPageIfNeeded() async {
@@ -190,7 +212,14 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
} }
void _openInstallPopover(BuildContext anchorContext) { void _openInstallPopover(BuildContext anchorContext) {
ref.read(extensionsControllerProvider.notifier).tryOpenDevMode(); if (AppWindowChrome.isDesktopWindow) {
ref.read(extensionsControllerProvider.notifier).tryOpenDevMode();
}
_installDevMode = false;
_showInstallPopover(anchorContext);
}
void _showInstallPopover(BuildContext anchorContext) {
if (_installPopover != null) return; if (_installPopover != null) return;
final overlay = const shad.PopoverOverlayHandler().show<void>( final overlay = const shad.PopoverOverlayHandler().show<void>(
context: anchorContext, context: anchorContext,
@@ -199,7 +228,17 @@ class _ExtensionsPageState extends ConsumerState<ExtensionsPage> {
offset: const Offset(0, 8), offset: const Offset(0, 8),
modal: false, modal: false,
consumeOutsideTaps: false, consumeOutsideTaps: false,
builder: (context) => _InstallPopover(controller: _installController, onInstallUrl: _installFromUrl), // Flutter's native selection toolbar uses the EditableText tap group.
// Pasting from it must not dismiss the form and restore search focus.
regionGroupId: EditableText,
builder: (context) => _InstallPopover(
key: _installPopoverKey,
controller: _installController,
onInstallUrl: _installFromUrl,
onFinished: () {
if (mounted && ref.read(pendingExtensionInstallProvider) != null) setState(() {});
},
),
); );
_installPopover = overlay; _installPopover = overlay;
unawaited( unawaited(
@@ -282,6 +321,7 @@ class _Content extends StatelessWidget {
required this.onSearch, required this.onSearch,
required this.onSort, required this.onSort,
required this.onFilter, required this.onFilter,
required this.installAnchorKey,
required this.onOpenInstall, required this.onOpenInstall,
required this.onDevelopExtension, required this.onDevelopExtension,
required this.onInstallFolder, required this.onInstallFolder,
@@ -299,6 +339,7 @@ class _Content extends StatelessWidget {
final ValueChanged<String> onSearch; final ValueChanged<String> onSearch;
final ValueChanged<StoreExtensionSort> onSort; final ValueChanged<StoreExtensionSort> onSort;
final ValueChanged<ExtensionListFilter> onFilter; final ValueChanged<ExtensionListFilter> onFilter;
final GlobalKey installAnchorKey;
final ValueChanged<BuildContext> onOpenInstall; final ValueChanged<BuildContext> onOpenInstall;
final VoidCallback onDevelopExtension; final VoidCallback onDevelopExtension;
final VoidCallback onInstallFolder; final VoidCallback onInstallFolder;
@@ -320,6 +361,7 @@ class _Content extends StatelessWidget {
onSearch: onSearch, onSearch: onSearch,
onSort: onSort, onSort: onSort,
onRefresh: onRefresh, onRefresh: onRefresh,
installAnchorKey: installAnchorKey,
onOpenInstall: onOpenInstall, onOpenInstall: onOpenInstall,
onDevelopExtension: onDevelopExtension, onDevelopExtension: onDevelopExtension,
onInstallFolder: onInstallFolder, onInstallFolder: onInstallFolder,
@@ -612,6 +654,7 @@ class _Toolbar extends StatelessWidget {
required this.onSearch, required this.onSearch,
required this.onSort, required this.onSort,
required this.onRefresh, required this.onRefresh,
required this.installAnchorKey,
required this.onOpenInstall, required this.onOpenInstall,
required this.onDevelopExtension, required this.onDevelopExtension,
required this.onInstallFolder, required this.onInstallFolder,
@@ -622,6 +665,7 @@ class _Toolbar extends StatelessWidget {
final ValueChanged<String> onSearch; final ValueChanged<String> onSearch;
final ValueChanged<StoreExtensionSort> onSort; final ValueChanged<StoreExtensionSort> onSort;
final VoidCallback onRefresh; final VoidCallback onRefresh;
final GlobalKey installAnchorKey;
final ValueChanged<BuildContext> onOpenInstall; final ValueChanged<BuildContext> onOpenInstall;
final VoidCallback onDevelopExtension; final VoidCallback onDevelopExtension;
final VoidCallback onInstallFolder; final VoidCallback onInstallFolder;
@@ -629,7 +673,6 @@ class _Toolbar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final palette = AppPalette.of(context); final palette = AppPalette.of(context);
final manualInstallBusy = state.busyExtensionIds.contains(ExtensionsController.manualInstallBusyKey);
final search = AppTextField( final search = AppTextField(
key: const ValueKey('extension-search-input'), key: const ValueKey('extension-search-input'),
controller: searchController, controller: searchController,
@@ -671,22 +714,21 @@ class _Toolbar extends StatelessWidget {
onPressed: onDevelopExtension, onPressed: onDevelopExtension,
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
if (state.devMode) ...[ if (AppWindowChrome.isDesktopWindow && state.devMode) ...[
_OutlineToolbarIconButton( _OutlineToolbarIconButton(
key: const ValueKey('load-local-extension-button'), key: const ValueKey('load-local-extension-button'),
tooltip: context.l10n.extensionLoadLocal, tooltip: context.l10n.extensionLoadLocal,
icon: Icons.folder_open_outlined, icon: Icons.folder_open_outlined,
loading: manualInstallBusy,
onPressed: onInstallFolder, onPressed: onInstallFolder,
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
], ],
Builder( Builder(
key: installAnchorKey,
builder: (buttonContext) => _OutlineToolbarIconButton( builder: (buttonContext) => _OutlineToolbarIconButton(
key: const ValueKey('install-extension-button'), key: const ValueKey('install-extension-button'),
tooltip: context.l10n.extensionInstallFromUrl, tooltip: context.l10n.extensionInstallFromUrl,
icon: Icons.add_link, icon: Icons.add_link,
loading: manualInstallBusy,
onPressed: () => onOpenInstall(buttonContext), onPressed: () => onOpenInstall(buttonContext),
), ),
), ),
@@ -762,18 +804,11 @@ class _FilterBar extends StatelessWidget {
} }
class _OutlineToolbarIconButton extends StatelessWidget { class _OutlineToolbarIconButton extends StatelessWidget {
const _OutlineToolbarIconButton({ const _OutlineToolbarIconButton({super.key, required this.tooltip, required this.icon, required this.onPressed});
super.key,
required this.tooltip,
required this.icon,
required this.onPressed,
this.loading = false,
});
final String tooltip; final String tooltip;
final IconData icon; final IconData icon;
final VoidCallback? onPressed; final VoidCallback? onPressed;
final bool loading;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -781,23 +816,18 @@ class _OutlineToolbarIconButton extends StatelessWidget {
message: tooltip, message: tooltip,
child: SizedBox.square( child: SizedBox.square(
dimension: 32, dimension: 32,
child: shad.IconButton.outline( child: shad.IconButton.outline(size: shad.ButtonSize.xSmall, onPressed: onPressed, icon: Icon(icon, size: 17)),
size: shad.ButtonSize.xSmall,
onPressed: loading ? null : onPressed,
icon: loading
? const SizedBox.square(dimension: 13, child: shad.CircularProgressIndicator())
: Icon(icon, size: 17),
),
), ),
); );
} }
} }
class _InstallPopover extends StatefulWidget { class _InstallPopover extends StatefulWidget {
const _InstallPopover({required this.controller, required this.onInstallUrl}); const _InstallPopover({super.key, required this.controller, required this.onInstallUrl, required this.onFinished});
final TextEditingController controller; final TextEditingController controller;
final Future<void> Function() onInstallUrl; final Future<void> Function() onInstallUrl;
final VoidCallback onFinished;
@override @override
State<_InstallPopover> createState() => _InstallPopoverState(); State<_InstallPopover> createState() => _InstallPopoverState();
@@ -859,8 +889,8 @@ class _InstallPopoverState extends State<_InstallPopover> {
setState(() => _installing = true); setState(() => _installing = true);
await widget.onInstallUrl(); await widget.onInstallUrl();
if (!mounted) return; if (!mounted) return;
setState(() => _installing = false);
await shad.closeOverlay(context); await shad.closeOverlay(context);
widget.onFinished();
} }
} }
@@ -994,71 +1024,97 @@ class _ExtensionCard extends ConsumerWidget {
const Spacer(), const Spacer(),
Row( Row(
children: [ children: [
if (item.store != null) ...[ if (item.store != null)
Icon(Icons.star_rounded, size: 15, color: palette.textMuted), Expanded(
const SizedBox(width: 3), child: Align(
Text('${item.stars}', style: TextStyle(color: palette.textSecondary, fontSize: 12)), alignment: Alignment.centerLeft,
const SizedBox(width: 10), child: FittedBox(
Icon(Icons.download_outlined, size: 15, color: palette.textMuted), fit: BoxFit.scaleDown,
const SizedBox(width: 3), alignment: Alignment.centerLeft,
Text('${item.installCount}', style: TextStyle(color: palette.textSecondary, fontSize: 12)), child: Row(
], key: ValueKey('extension-card-stats-${item.id}'),
const Spacer(), mainAxisSize: MainAxisSize.min,
if (canUpdate && installed != null) children: [
shad.GhostButton( Icon(Icons.star_rounded, size: 15, color: palette.textMuted),
density: shad.ButtonDensity.icon, const SizedBox(width: 3),
onPressed: busy Text(
? null CompactCountFormatter.format(item.stars),
: () => style: TextStyle(color: palette.textSecondary, fontSize: 12),
onAction(() => ref.read(extensionsControllerProvider.notifier).upgradeExtension(installed)), ),
child: const Icon(Icons.refresh), const SizedBox(width: 10),
), Icon(Icons.download_outlined, size: 15, color: palette.textMuted),
if (installed == null && item.store != null) const SizedBox(width: 3),
shad.GhostButton( Text(
key: ValueKey('install-store-extension-${item.store!.id}'), CompactCountFormatter.format(item.installCount),
density: shad.ButtonDensity.icon, style: TextStyle(color: palette.textSecondary, fontSize: 12),
onPressed: busy ),
? null ],
: () => onAction( ),
() => ref.read(extensionsControllerProvider.notifier).installFromStore(item.store!), ),
), ),
child: busy )
? const SizedBox.square(dimension: 14, child: shad.CircularProgressIndicator()) else
: const Icon(Icons.download), const Spacer(),
), const SizedBox(width: 8),
if ((item.homepage ?? '').isNotEmpty) Row(
shad.GhostButton( key: ValueKey('extension-card-actions-${item.id}'),
density: shad.ButtonDensity.icon, mainAxisSize: MainAxisSize.min,
onPressed: () => unawaited(launchUrl(Uri.parse(item.homepage!))), children: [
child: const Icon(Icons.home_outlined), if (canUpdate && installed != null)
), shad.GhostButton(
if ((item.repoUrl ?? '').isNotEmpty) density: shad.ButtonDensity.icon,
shad.GhostButton( key: ValueKey('update-extension-${installed.identity}'),
density: shad.ButtonDensity.icon, onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
onPressed: () => unawaited(launchUrl(Uri.parse(item.repoUrl!))), child: const Icon(Icons.refresh),
child: const Icon(Icons.code), ),
), if (installed == null && item.store != null)
if (installed?.settings?.isNotEmpty == true) shad.GhostButton(
shad.GhostButton( key: ValueKey('install-store-extension-${item.store!.id}'),
density: shad.ButtonDensity.icon, density: shad.ButtonDensity.icon,
onPressed: busy ? null : () => onOpenSettings(installed!), onPressed: busy
child: const Icon(Icons.settings_outlined), ? null
), : () => onAction(
if (installed != null) () => ref.read(extensionsControllerProvider.notifier).installFromStore(item.store!),
shad.GhostButton( ),
key: ValueKey('remove-extension-${installed.identity}'), child: busy
density: shad.ButtonDensity.icon, ? const SizedBox.square(dimension: 14, child: shad.CircularProgressIndicator())
onPressed: busy : const Icon(Icons.download),
? null ),
: () async { if ((item.homepage ?? '').isNotEmpty)
final confirmed = await _showRemoveExtensionDialog(context, installed.title); shad.GhostButton(
if (!confirmed || !context.mounted) return; density: shad.ButtonDensity.icon,
await onAction( onPressed: () => unawaited(launchUrl(Uri.parse(item.homepage!))),
() => ref.read(extensionsControllerProvider.notifier).removeExtension(installed), child: const Icon(Icons.home_outlined),
); ),
}, if ((item.repoUrl ?? '').isNotEmpty)
child: const Icon(Icons.delete_outline), shad.GhostButton(
), density: shad.ButtonDensity.icon,
onPressed: () => unawaited(launchUrl(Uri.parse(item.repoUrl!))),
child: const Icon(Icons.code),
),
if (installed?.settings?.isNotEmpty == true)
shad.GhostButton(
density: shad.ButtonDensity.icon,
onPressed: busy ? null : () => onOpenSettings(installed!),
child: const Icon(Icons.settings_outlined),
),
if (installed != null)
shad.GhostButton(
key: ValueKey('remove-extension-${installed.identity}'),
density: shad.ButtonDensity.icon,
onPressed: busy
? null
: () async {
final confirmed = await _showRemoveExtensionDialog(context, installed.title);
if (!confirmed || !context.mounted) return;
await onAction(
() => ref.read(extensionsControllerProvider.notifier).removeExtension(installed),
);
},
child: const Icon(Icons.delete_outline),
),
],
),
], ],
), ),
], ],
@@ -1174,7 +1230,7 @@ class _ExtensionSettingsPanel extends StatelessWidget {
separatorBuilder: (_, _) => const SizedBox(height: 14), separatorBuilder: (_, _) => const SizedBox(height: 14),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final setting = settings[index]; final setting = settings[index];
return _ExtensionSettingField(setting: setting, controller: controllers[setting.name]!); return ExtensionSettingField(setting: setting, controller: controllers[setting.name]!);
}, },
), ),
), ),
@@ -1202,39 +1258,6 @@ class _ExtensionSettingsPanel extends StatelessWidget {
} }
} }
class _ExtensionSettingField extends StatelessWidget {
const _ExtensionSettingField({required this.setting, required this.controller});
final api_extension.Setting setting;
final TextEditingController controller;
@override
Widget build(BuildContext context) {
final palette = AppPalette.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
setting.title,
style: TextStyle(color: palette.textPrimary, fontSize: 13, fontWeight: FontWeight.w700),
),
if (setting.description.isNotEmpty) ...[
const SizedBox(height: 4),
Text(setting.description, style: TextStyle(color: palette.textSecondary, fontSize: 12, height: 1.35)),
],
const SizedBox(height: 8),
if (setting.type == api_extension.SettingType.boolean)
AppTextField(controller: controller, placeholder: Text(context.l10n.booleanValueHint))
else
AppTextField(
controller: controller,
keyboardType: setting.type == api_extension.SettingType.number ? TextInputType.number : TextInputType.text,
),
],
);
}
}
class _ErrorState extends StatelessWidget { class _ErrorState extends StatelessWidget {
const _ErrorState({required this.error, required this.onRetry}); const _ErrorState({required this.error, required this.onRetry});
@@ -10,6 +10,7 @@ import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../../../api/model/store_extension.dart'; import '../../../../api/model/store_extension.dart';
import '../../../../core/utils/compact_count_formatter.dart';
import '../../../../l10n/l10n.dart'; import '../../../../l10n/l10n.dart';
import '../../../../shared/theme/app_design_tokens.dart'; import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/theme/app_palette.dart'; import '../../../../shared/theme/app_palette.dart';
@@ -19,6 +20,7 @@ import '../../../../shared/widgets/detail/app_detail_surface.dart';
import '../../../../util/util.dart'; import '../../../../util/util.dart';
import '../../application/extensions_controller.dart'; import '../../application/extensions_controller.dart';
import 'extension_icon.dart'; import 'extension_icon.dart';
import 'extension_update_dialog.dart';
class ExtensionDetailDrawer extends StatelessWidget { class ExtensionDetailDrawer extends StatelessWidget {
const ExtensionDetailDrawer({super.key, required this.item, required this.onClose}); const ExtensionDetailDrawer({super.key, required this.item, required this.onClose});
@@ -131,14 +133,10 @@ class ExtensionDetailView extends ConsumerWidget {
if (installed != null && canUpdate) if (installed != null && canUpdate)
AppLoadingButton( AppLoadingButton(
key: const ValueKey('extension-details-update'), key: const ValueKey('extension-details-update'),
loading: busy, loading: false,
variant: AppLoadingButtonVariant.primary, variant: AppLoadingButtonVariant.primary,
icon: const Icon(Icons.refresh, size: 16), icon: const Icon(Icons.refresh, size: 16),
onPressed: () => _runAction( onPressed: busy ? null : () => showExtensionUpdateDialog(context, installed),
context,
() => ref.read(extensionsControllerProvider.notifier).upgradeExtension(installed),
successMessage: context.l10n.extensionUpdateSuccess,
),
child: Text(context.l10n.newVersionUpdate), child: Text(context.l10n.newVersionUpdate),
), ),
if (installed != null && !canUpdate) if (installed != null && !canUpdate)
@@ -338,9 +336,9 @@ class _ExtensionStats extends StatelessWidget {
key: const ValueKey('extension-details-stats'), key: const ValueKey('extension-details-stats'),
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
_MetadataItem(icon: Icons.star_rounded, value: store.stars.toString()), _MetadataItem(icon: Icons.star_rounded, value: CompactCountFormatter.format(store.stars)),
const SizedBox(width: 12), const SizedBox(width: 12),
_MetadataItem(icon: Icons.download_outlined, value: store.installCount.toString()), _MetadataItem(icon: Icons.download_outlined, value: CompactCountFormatter.format(store.installCount)),
], ],
); );
} }
@@ -0,0 +1,87 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:flutter/services.dart';
import '../../../../api/model/extension.dart';
import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/widgets/app_text_field.dart';
class ExtensionSettingField extends StatelessWidget {
const ExtensionSettingField({super.key, required this.setting, required this.controller});
final Setting setting;
final TextEditingController controller;
@override
Widget build(BuildContext context) {
final palette = AppPalette.of(context);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
setting.title,
style: TextStyle(color: palette.textPrimary, fontSize: 13, fontWeight: FontWeight.w700),
),
if (setting.description.isNotEmpty) ...[
const SizedBox(height: 4),
Text(setting.description, style: TextStyle(color: palette.textSecondary, fontSize: 12, height: 1.35)),
],
const SizedBox(height: 8),
_buildInput(),
],
);
}
Widget _buildInput() {
if (setting.type == SettingType.boolean) {
return ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) =>
Switch(value: value.text == 'true', onChanged: (enabled) => controller.text = enabled.toString()),
);
}
final options = setting.options;
if (options != null && options.isNotEmpty) {
return ValueListenableBuilder<TextEditingValue>(
valueListenable: controller,
builder: (context, value, _) => LayoutBuilder(
builder: (context, constraints) => Select<String>(
value: options.any((option) => option.value.toString() == value.text) ? value.text : null,
placeholder: Text(setting.title),
constraints: BoxConstraints.tightFor(width: constraints.maxWidth),
popupConstraints: const BoxConstraints(maxHeight: 240),
itemBuilder: (context, selectedValue) => Text(
options.firstWhere((option) => option.value.toString() == selectedValue).label,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
popup: (context) => SelectPopup<String>(
items: SelectItemList(
children: [
for (final option in options)
SelectItemButton<String>(value: option.value.toString(), child: Text(option.label)),
],
),
),
onChanged: (selectedValue) {
if (selectedValue != null) controller.text = selectedValue;
},
),
),
);
}
final isNumber = setting.type == SettingType.number;
return AppTextField(
controller: controller,
keyboardType: isNumber ? const TextInputType.numberWithOptions(decimal: true, signed: true) : TextInputType.text,
inputFormatters: isNumber
? [
TextInputFormatter.withFunction(
(oldValue, newValue) => RegExp(r'^-?\d*\.?\d*$').hasMatch(newValue.text) ? newValue : oldValue,
),
]
: null,
);
}
}
@@ -0,0 +1,90 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import '../../../../api/model/extension.dart' as api;
import '../../../../l10n/l10n.dart';
import '../../../../shared/widgets/app_loading_button.dart';
import '../../../../shared/widgets/app_toast.dart';
import '../../application/extensions_controller.dart';
Future<void> showExtensionUpdateDialog(BuildContext context, api.Extension extension) async {
final overlay = const DialogOverlayHandler().show<bool>(
context: context,
alignment: Alignment.center,
barrierDismissable: false,
builder: (_) => _ExtensionUpdateDialog(extension: extension),
);
final updated = await overlay.future;
if (updated == true && context.mounted) {
showAppToast(context, context.l10n.extensionUpdateSuccess);
}
}
class _ExtensionUpdateDialog extends ConsumerStatefulWidget {
const _ExtensionUpdateDialog({required this.extension});
final api.Extension extension;
@override
ConsumerState<_ExtensionUpdateDialog> createState() => _ExtensionUpdateDialogState();
}
class _ExtensionUpdateDialogState extends ConsumerState<_ExtensionUpdateDialog> {
bool _updating = false;
bool _failed = false;
Future<void> _update() async {
if (_updating) return;
setState(() {
_updating = true;
_failed = false;
});
try {
await ref.read(extensionsControllerProvider.notifier).upgradeExtension(widget.extension);
} catch (_) {
if (!mounted) return;
setState(() {
_updating = false;
_failed = true;
});
return;
}
if (mounted) await closeOverlay(context, true);
}
@override
Widget build(BuildContext context) {
return PopScope(
canPop: !_updating,
child: AlertDialog(
key: const ValueKey('extension-update-dialog'),
title: Text(context.l10n.extensionCanUpdate),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(context.l10n.extensionUpdateConfirm(widget.extension.title)),
if (_failed) ...[
const SizedBox(height: 12),
Text(context.l10n.updateFailed, key: const ValueKey('extension-update-error')),
],
],
),
actions: [
SecondaryButton(
key: const ValueKey('cancel-update-extension-button'),
onPressed: _updating ? null : () => closeOverlay(context, false),
child: Text(context.l10n.cancel),
),
AppLoadingButton(
key: const ValueKey('confirm-update-extension-button'),
variant: AppLoadingButtonVariant.primary,
loading: _updating,
onPressed: _update,
child: Text(context.l10n.newVersionUpdate),
),
],
),
);
}
}
@@ -30,6 +30,7 @@ import '../../../tasks/presentation/widgets/task_drawer.dart';
import '../../../tasks/presentation/widgets/task_context_menu.dart'; import '../../../tasks/presentation/widgets/task_context_menu.dart';
import '../../../tasks/presentation/widgets/task_delete_dialog.dart'; import '../../../tasks/presentation/widgets/task_delete_dialog.dart';
import '../../../tasks/presentation/widgets/task_empty_state.dart'; import '../../../tasks/presentation/widgets/task_empty_state.dart';
import '../../../tasks/presentation/widgets/task_create_button.dart';
import '../../../tasks/presentation/widgets/task_file_browser_dialog.dart'; import '../../../tasks/presentation/widgets/task_file_browser_dialog.dart';
import '../../../tasks/presentation/widgets/task_update_url_dialog.dart'; import '../../../tasks/presentation/widgets/task_update_url_dialog.dart';
import '../widgets/primary_rail.dart'; import '../widgets/primary_rail.dart';
@@ -172,7 +173,10 @@ class _HomePageState extends ConsumerState<HomePage> {
loading: () => const Center(child: shad.CircularProgressIndicator()), loading: () => const Center(child: shad.CircularProgressIndicator()),
error: (error, _) => const TaskEmptyState(), error: (error, _) => const TaskEmptyState(),
data: (_) => filteredTasks.isEmpty data: (_) => filteredTasks.isEmpty
? TaskEmptyState(message: emptyStateMessage) ? TaskEmptyState(
message: emptyStateMessage,
onCreateTask: _searchController.text.trim().isEmpty ? _handleAddTask : null,
)
: ListView.separated( : ListView.separated(
padding: const EdgeInsets.only(bottom: 16), padding: const EdgeInsets.only(bottom: 16),
itemCount: filteredTasks.length, itemCount: filteredTasks.length,
@@ -260,6 +264,7 @@ class _HomePageState extends ConsumerState<HomePage> {
data: (_) => _MobileTasksView( data: (_) => _MobileTasksView(
tasks: filteredTasks, tasks: filteredTasks,
emptyStateMessage: emptyStateMessage, emptyStateMessage: emptyStateMessage,
onCreateTask: _searchController.text.trim().isEmpty ? _handleAddTask : null,
batchMode: _batchMode, batchMode: _batchMode,
batchSelection: _batchSelection, batchSelection: _batchSelection,
onToggleSelectAll: _toggleSelectAll, onToggleSelectAll: _toggleSelectAll,
@@ -685,6 +690,7 @@ class _MobileTasksView extends StatelessWidget {
required this.contextActionsForTask, required this.contextActionsForTask,
required this.pendingUpdateTaskId, required this.pendingUpdateTaskId,
this.emptyStateMessage, this.emptyStateMessage,
this.onCreateTask,
this.loading = false, this.loading = false,
}); });
@@ -705,6 +711,7 @@ class _MobileTasksView extends StatelessWidget {
final TaskContextActions Function(TaskRecord task, bool selected, bool allSelected) contextActionsForTask; final TaskContextActions Function(TaskRecord task, bool selected, bool allSelected) contextActionsForTask;
final String? pendingUpdateTaskId; final String? pendingUpdateTaskId;
final String? emptyStateMessage; final String? emptyStateMessage;
final VoidCallback? onCreateTask;
final bool loading; final bool loading;
@override @override
@@ -745,7 +752,7 @@ class _MobileTasksView extends StatelessWidget {
child: loading child: loading
? const Center(child: shad.CircularProgressIndicator()) ? const Center(child: shad.CircularProgressIndicator())
: tasks.isEmpty : tasks.isEmpty
? TaskEmptyState(message: emptyStateMessage) ? TaskEmptyState(message: emptyStateMessage, onCreateTask: onCreateTask)
: ListView.separated( : ListView.separated(
padding: const EdgeInsets.fromLTRB(16, 8, 16, 12), padding: const EdgeInsets.fromLTRB(16, 8, 16, 12),
itemCount: tasks.length, itemCount: tasks.length,
@@ -814,9 +821,19 @@ class _MobileTasksHeader extends StatelessWidget {
style: TextStyle(color: palette.textPrimary, fontSize: 22, fontWeight: FontWeight.w800), style: TextStyle(color: palette.textPrimary, fontSize: 22, fontWeight: FontWeight.w800),
), ),
), ),
_MobileHeaderIconButton(icon: Icons.add_rounded, onPressed: onAddTask), const SizedBox(width: AppDesignTokens.space8),
ConstrainedBox(
constraints: BoxConstraints(maxWidth: MediaQuery.sizeOf(context).width * 0.5),
child: TaskCreateButton(
key: const ValueKey('tasks-mobile-create-button'),
onPressed: onAddTask,
minHeight: 34,
compact: true,
),
),
const SizedBox(width: 8), const SizedBox(width: 8),
_MobileHeaderIconButton( _MobileHeaderIconButton(
key: const ValueKey('tasks-mobile-batch-button'),
icon: Icons.checklist_rtl_outlined, icon: Icons.checklist_rtl_outlined,
active: batchMode, active: batchMode,
badge: batchMode && selectedCount > 0 ? selectedCount.toString() : null, badge: batchMode && selectedCount > 0 ? selectedCount.toString() : null,
@@ -903,7 +920,13 @@ class _MobileBatchToolbar extends StatelessWidget {
} }
class _MobileHeaderIconButton extends StatelessWidget { class _MobileHeaderIconButton extends StatelessWidget {
const _MobileHeaderIconButton({required this.icon, required this.onPressed, this.active = false, this.badge}); const _MobileHeaderIconButton({
super.key,
required this.icon,
required this.onPressed,
this.active = false,
this.badge,
});
final IconData icon; final IconData icon;
final VoidCallback onPressed; final VoidCallback onPressed;
@@ -4,7 +4,7 @@ import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import '../../../../shared/theme/app_design_tokens.dart'; import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/theme/app_palette.dart'; import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/widgets/app_primary_button.dart'; import '../../../tasks/presentation/widgets/task_create_button.dart';
import '../../../../shared/widgets/app_text_field.dart'; import '../../../../shared/widgets/app_text_field.dart';
import '../../../../l10n/l10n.dart'; import '../../../../l10n/l10n.dart';
@@ -62,7 +62,7 @@ class TasksTopBar extends StatelessWidget {
ConstrainedBox( ConstrainedBox(
key: const ValueKey('tasks-create-button-container'), key: const ValueKey('tasks-create-button-container'),
constraints: const BoxConstraints(minWidth: 120, maxWidth: 190), constraints: const BoxConstraints(minWidth: 120, maxWidth: 190),
child: _AddTaskButton(onPressed: onAddTask), child: TaskCreateButton(onPressed: onAddTask),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Row( Row(
@@ -131,27 +131,6 @@ class _SearchField extends StatelessWidget {
} }
} }
class _AddTaskButton extends StatelessWidget {
const _AddTaskButton({required this.onPressed});
final VoidCallback onPressed;
@override
Widget build(BuildContext context) {
return AppPrimaryButton(
onPressed: onPressed,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.add),
const SizedBox(width: AppDesignTokens.space8),
Flexible(child: Text(context.l10n.create, maxLines: 1, overflow: TextOverflow.ellipsis)),
],
),
);
}
}
class _ActionIconButton extends StatelessWidget { class _ActionIconButton extends StatelessWidget {
const _ActionIconButton({required this.icon, required this.onPressed}); const _ActionIconButton({required this.icon, required this.onPressed});
@@ -10,6 +10,7 @@ import '../../../../util/package_info.dart';
import '../../../../util/updater.dart'; import '../../../../util/updater.dart';
import '../../../../util/util.dart'; import '../../../../util/util.dart';
import '../../../../l10n/l10n.dart'; import '../../../../l10n/l10n.dart';
import 'app_update_notes_viewport.dart';
typedef StartAppUpdate = Future<void> Function(VersionInfo versionInfo, UpdateProgressCallback onProgress); typedef StartAppUpdate = Future<void> Function(VersionInfo versionInfo, UpdateProgressCallback onProgress);
@@ -74,11 +75,18 @@ Future<void> showAppUpdateDialog(
key: const ValueKey('app-update-heading'), key: const ValueKey('app-update-heading'),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 3), const SizedBox(height: 8),
Text( Text(
'$appVersion → ${versionInfo.version}', '$appVersion → ${versionInfo.version}',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(color: palette.textSecondary, fontSize: 12, fontWeight: FontWeight.w400), style: DefaultTextStyle.of(dialogContext).style.copyWith(
inherit: false,
color: palette.textSecondary,
fontSize: 12,
fontWeight: FontWeight.w400,
height: 1.4,
decoration: TextDecoration.none,
),
), ),
], ],
), ),
@@ -90,18 +98,9 @@ Future<void> showAppUpdateDialog(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Text( AppUpdateNotesViewport(
dialogContext.l10n.releaseNotes, child: _ReleaseNotes(
style: TextStyle(color: palette.textPrimary, fontSize: 12, fontWeight: FontWeight.w700), notes: releaseNotes.isEmpty ? dialogContext.l10n.noReleaseNotes : releaseNotes,
),
const SizedBox(height: 10),
ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 210),
child: SingleChildScrollView(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: _ReleaseNotes(
notes: releaseNotes.isEmpty ? dialogContext.l10n.noReleaseNotes : releaseNotes,
),
), ),
), ),
if (updating) ...[ if (updating) ...[
@@ -157,7 +156,6 @@ Future<void> showAppUpdateDialog(
onPressed: () => unawaited(update()), onPressed: () => unawaited(update()),
loading: updating, loading: updating,
variant: AppLoadingButtonVariant.primary, variant: AppLoadingButtonVariant.primary,
icon: const Icon(Icons.system_update_alt_outlined, size: 17),
child: Text(dialogContext.l10n.newVersionUpdate), child: Text(dialogContext.l10n.newVersionUpdate),
), ),
], ],
@@ -0,0 +1,59 @@
import 'package:flutter/widgets.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import '../../../../shared/theme/app_design_tokens.dart';
class AppUpdateNotesViewport extends StatefulWidget {
const AppUpdateNotesViewport({super.key, required this.child});
final Widget child;
@override
State<AppUpdateNotesViewport> createState() => _AppUpdateNotesViewportState();
}
class _AppUpdateNotesViewportState extends State<AppUpdateNotesViewport> {
final _controller = ScrollController();
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
const fadeHeight = AppDesignTokens.space24;
return ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 240),
child: shad.Scrollbar(
controller: _controller,
thumbVisibility: true,
child: ShaderMask(
blendMode: BlendMode.dstIn,
shaderCallback: (bounds) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
// Mask colors control opacity only; they do not tint the content.
colors: const [shad.Colors.white, shad.Colors.white, shad.Colors.transparent],
stops: [0, (1 - fadeHeight / bounds.height).clamp(0.0, 1.0), 1],
).createShader(bounds),
child: ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
child: SingleChildScrollView(
controller: _controller,
padding: const EdgeInsetsDirectional.fromSTEB(
AppDesignTokens.space4,
0,
AppDesignTokens.space16,
// Keep the final line above the fade at the end of the scroll.
fadeHeight,
),
child: widget.child,
),
),
),
),
);
}
}
@@ -133,7 +133,7 @@ class TaskRecord {
status: status, status: status,
downloaded: _formatBytes(downloadedBytes), downloaded: _formatBytes(downloadedBytes),
total: totalBytes > 0 ? _formatBytes(totalBytes) : null, total: totalBytes > 0 ? _formatBytes(totalBytes) : null,
speed: task.progress.speed > 0 ? TransferRateFormatter.format(task.progress.speed).text : null, speed: totalBytes > 0 || task.progress.speed > 0 ? TransferRateFormatter.format(task.progress.speed).text : null,
uploadSpeed: task.uploading ? TransferRateFormatter.format(task.progress.uploadSpeed).text : null, uploadSpeed: task.uploading ? TransferRateFormatter.format(task.progress.uploadSpeed).text : null,
remainingSeconds: _remainingSeconds(task, totalBytes, downloadedBytes), remainingSeconds: _remainingSeconds(task, totalBytes, downloadedBytes),
downloadDuration: task.progress.used > 0 ? Duration(microseconds: (task.progress.used + 999) ~/ 1000) : null, downloadDuration: task.progress.used > 0 ? Duration(microseconds: (task.progress.used + 999) ~/ 1000) : null,
@@ -37,6 +37,8 @@ import '../../../../shared/widgets/app_toast.dart';
import '../../../../l10n/l10n.dart'; import '../../../../l10n/l10n.dart';
import '../../../../util/util.dart'; import '../../../../util/util.dart';
import '../../application/pending_create_task.dart'; import '../../application/pending_create_task.dart';
import '../../application/task_list_navigation.dart';
import '../widgets/history_search_field.dart';
import '../widgets/create_task_action_buttons.dart'; import '../widgets/create_task_action_buttons.dart';
import '../widgets/resolve_file_tree.dart'; import '../widgets/resolve_file_tree.dart';
@@ -687,24 +689,27 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
), ),
), ),
), ),
Container( SafeArea(
padding: const EdgeInsets.fromLTRB(24, 12, 24, 20), top: false,
decoration: BoxDecoration( child: Container(
border: Border(top: BorderSide(color: palette.border)), padding: const EdgeInsets.fromLTRB(24, 12, 24, 20),
), decoration: BoxDecoration(
child: Row( border: Border(top: BorderSide(color: palette.border)),
mainAxisAlignment: MainAxisAlignment.center, ),
children: [ child: Row(
CreateTaskActionButtons( mainAxisAlignment: MainAxisAlignment.center,
submitting: _creating, children: [
onCancel: _closeWindow, CreateTaskActionButtons(
onSubmit: _confirm, submitting: _creating,
cancelLabel: context.l10n.cancel, onCancel: _closeWindow,
submitLabel: context.l10n.confirm, onSubmit: _confirm,
cancelButtonKey: const ValueKey('create-task-cancel-button'), cancelLabel: context.l10n.cancel,
submitButtonKey: const ValueKey('create-task-confirm-button'), submitLabel: context.l10n.confirm,
), cancelButtonKey: const ValueKey('create-task-cancel-button'),
], submitButtonKey: const ValueKey('create-task-confirm-button'),
),
],
),
), ),
), ),
], ],
@@ -732,6 +737,8 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
} catch (error) { } catch (error) {
debugPrint('Unable to select downloading tasks: $error'); debugPrint('Unable to select downloading tasks: $error');
} }
} else {
ref.read(taskListNavigationProvider.notifier).showDownloading();
} }
await _closeWindow(); await _closeWindow();
} }
@@ -1244,20 +1251,9 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
height: screenSize.height < 560 ? screenSize.height * 0.55 : 360, height: screenSize.height < 560 ? screenSize.height * 0.55 : 360,
child: Column( child: Column(
children: [ children: [
SizedBox( HistorySearchField(
height: 38, controller: filterController,
child: AppTextField( onChanged: (value) => setDialogState(() => filterQuery = value),
key: const ValueKey('create-history-filter'),
controller: filterController,
placeholder: Text(
dialogContext.l10n.searchHistory,
style: TextStyle(color: palette.searchHint, fontSize: 13),
),
features: [
InputFeature.leading(Icon(Icons.search_rounded, size: 15, color: palette.textMuted)),
],
onChanged: (value) => setDialogState(() => filterQuery = value),
),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Expanded( Expanded(
@@ -0,0 +1,38 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import '../../../../l10n/l10n.dart';
import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/widgets/app_text_field.dart';
class HistorySearchField extends StatelessWidget {
const HistorySearchField({super.key, required this.controller, required this.onChanged});
final TextEditingController controller;
final ValueChanged<String> onChanged;
@override
Widget build(BuildContext context) {
final palette = AppPalette.of(context);
const textStyle = TextStyle(fontSize: 13);
return ConstrainedBox(
// Allow large accessibility text to grow instead of clipping the line.
constraints: const BoxConstraints(minHeight: 38),
child: AppTextField(
key: const ValueKey('create-history-filter'),
controller: controller,
style: textStyle,
padding: AppDesignTokens.compactTextFieldPadding,
placeholder: Text(
context.l10n.searchHistory,
// Match the editable text metrics so the cursor and hint align.
style: textStyle.copyWith(color: palette.searchHint),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
features: [InputFeature.leading(Icon(Icons.search_rounded, size: 15, color: palette.textMuted))],
onChanged: onChanged,
),
);
}
}
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart' show Colors, Icons;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad; import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import '../../../../../core/window/app_window_chrome.dart';
import '../../../../../shared/theme/app_design_tokens.dart'; import '../../../../../shared/theme/app_design_tokens.dart';
import '../../../../../shared/theme/app_palette.dart'; import '../../../../../shared/theme/app_palette.dart';
import '../../../domain/task_record.dart'; import '../../../domain/task_record.dart';
@@ -237,7 +238,10 @@ class _ProgressContent extends StatelessWidget {
TaskStatus.downloading => [(Icons.pause, onPause), (Icons.close, onDelete)], TaskStatus.downloading => [(Icons.pause, onPause), (Icons.close, onDelete)],
TaskStatus.paused => [(Icons.play_arrow, onResume), (Icons.close, onDelete)], TaskStatus.paused => [(Icons.play_arrow, onResume), (Icons.close, onDelete)],
TaskStatus.failed => [(Icons.refresh, onResume), (Icons.delete_outline, onDelete)], TaskStatus.failed => [(Icons.refresh, onResume), (Icons.delete_outline, onDelete)],
TaskStatus.completed => [(Icons.folder_open_outlined, null), (Icons.delete_outline, onDelete)], TaskStatus.completed => [
if (AppWindowChrome.isDesktopWindow) (Icons.folder_open_outlined, null),
(Icons.delete_outline, onDelete),
],
}; };
return actions return actions
@@ -306,7 +310,10 @@ class _CompletedContent extends StatelessWidget {
TaskStatus.downloading => [(Icons.pause, null), (Icons.close, onDelete)], TaskStatus.downloading => [(Icons.pause, null), (Icons.close, onDelete)],
TaskStatus.paused => [(Icons.play_arrow, null), (Icons.close, onDelete)], TaskStatus.paused => [(Icons.play_arrow, null), (Icons.close, onDelete)],
TaskStatus.failed => [(Icons.refresh, null), (Icons.delete_outline, onDelete)], TaskStatus.failed => [(Icons.refresh, null), (Icons.delete_outline, onDelete)],
TaskStatus.completed => [(Icons.folder_open_outlined, onReveal), (Icons.delete_outline, onDelete)], TaskStatus.completed => [
if (AppWindowChrome.isDesktopWindow) (Icons.folder_open_outlined, onReveal),
(Icons.delete_outline, onDelete),
],
}; };
return actions return actions
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart' show Colors, Icons;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad; import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import '../../../../../core/window/app_window_chrome.dart';
import '../../../../../shared/theme/app_design_tokens.dart'; import '../../../../../shared/theme/app_design_tokens.dart';
import '../../../../../shared/theme/app_palette.dart'; import '../../../../../shared/theme/app_palette.dart';
import '../../../domain/task_record.dart'; import '../../../domain/task_record.dart';
@@ -171,7 +172,10 @@ class _TaskCardMobileState extends State<TaskCardMobile> {
TaskStatus.downloading => [(Icons.pause, widget.onPause), (Icons.close, widget.onDelete)], TaskStatus.downloading => [(Icons.pause, widget.onPause), (Icons.close, widget.onDelete)],
TaskStatus.paused => [(Icons.play_arrow, widget.onResume), (Icons.close, widget.onDelete)], TaskStatus.paused => [(Icons.play_arrow, widget.onResume), (Icons.close, widget.onDelete)],
TaskStatus.failed => [(Icons.refresh, widget.onResume), (Icons.delete_outline, widget.onDelete)], TaskStatus.failed => [(Icons.refresh, widget.onResume), (Icons.delete_outline, widget.onDelete)],
TaskStatus.completed => [(Icons.folder_open_outlined, widget.onReveal), (Icons.delete_outline, widget.onDelete)], TaskStatus.completed => [
if (AppWindowChrome.isDesktopWindow) (Icons.folder_open_outlined, widget.onReveal),
(Icons.delete_outline, widget.onDelete),
],
}; };
return actions return actions
@@ -95,14 +95,18 @@ class TaskCardFooter extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
task.total != null ? '${task.downloaded} / ${task.total}' : context.l10n.unknownSize, task.total != null
? '${task.downloaded} / ${task.total}'
: task.downloadedBytes == 0
? context.l10n.unknownSize
: task.downloaded,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle(color: leftColor, fontSize: 10, height: 1), style: TextStyle(color: leftColor, fontSize: 10, height: 1),
), ),
), ),
const SizedBox(width: 12), const SizedBox(width: 12),
if (task.speed != null && !isError) ...[ if (task.speed != null) ...[
_TaskTransferSpeed(icon: Icons.south, value: task.speed!, color: metaColor), _TaskTransferSpeed(icon: Icons.south, value: task.speed!, color: metaColor),
const SizedBox(width: 8), const SizedBox(width: 8),
TickDivider(color: palette.progressTrack), TickDivider(color: palette.progressTrack),
@@ -0,0 +1,42 @@
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
import 'package:flutter/material.dart' show Icons;
import 'package:flutter/widgets.dart';
import '../../../../l10n/l10n.dart';
import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/widgets/app_primary_button.dart';
/// Shared creation action for task headers and empty-list guidance.
class TaskCreateButton extends StatelessWidget {
const TaskCreateButton({super.key, required this.onPressed, this.minHeight = 0, this.compact = false});
final VoidCallback onPressed;
final double minHeight;
final bool compact;
@override
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: BoxConstraints(minHeight: minHeight),
child: AppPrimaryButton(
onPressed: onPressed,
size: compact ? shad.ButtonSize.small : shad.ButtonSize.normal,
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.add, size: compact ? 16 : null),
SizedBox(width: compact ? AppDesignTokens.space4 : AppDesignTokens.space8),
Flexible(
child: Text(
context.l10n.create,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: compact ? const TextStyle(fontSize: 13) : null,
),
),
],
),
),
);
}
}
@@ -1,7 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/foundation.dart' show TargetPlatform, defaultTargetPlatform, kIsWeb; import 'package:flutter/foundation.dart' show TargetPlatform, defaultTargetPlatform, kIsWeb;
import 'package:flutter/material.dart' show Colors, Icons; import 'package:flutter/material.dart' show Colors, Icons, SelectionArea;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart' as shad; import 'package:shadcn_flutter/shadcn_flutter.dart' as shad;
@@ -122,7 +122,7 @@ class _TaskDetailsViewState extends ConsumerState<TaskDetailsView> {
? AppDesignTokens.taskDetailsMobilePadding ? AppDesignTokens.taskDetailsMobilePadding
: AppDesignTokens.taskDetailsDesktopPadding; : AppDesignTokens.taskDetailsDesktopPadding;
final runtimeStatus = _tabIndex == 1 ? ref.watch(taskRuntimeStatusProvider(widget.task.id)).value : null; final runtimeStatus = _tabIndex == 1 ? ref.watch(taskRuntimeStatusProvider(widget.task.id)).value : null;
return Column( final content = Column(
children: [ children: [
Container( Container(
height: 48, height: 48,
@@ -204,6 +204,7 @@ class _TaskDetailsViewState extends ConsumerState<TaskDetailsView> {
), ),
], ],
); );
return SelectionArea(key: const ValueKey('task-details-selection-area'), child: content);
} }
bool get _canOpenStoragePath { bool get _canOpenStoragePath {
@@ -0,0 +1,49 @@
import 'package:shadcn_flutter/shadcn_flutter.dart';
import '../../../../l10n/l10n.dart';
import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/widgets/app_tooltip.dart';
/// Keeps the action inside the localized sentence, including RTL word order.
class TaskEmptyCreateHint extends StatelessWidget {
const TaskEmptyCreateHint({super.key, required this.onCreateTask});
final VoidCallback onCreateTask;
@override
Widget build(BuildContext context) {
const actionMarker = '\uFFFC';
final parts = context.l10n.emptyTaskCreateHint(actionMarker).split(actionMarker);
return Text.rich(
TextSpan(
children: [
TextSpan(text: parts.first.trimRight()),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: AppTooltip(
message: context.l10n.create,
child: Semantics(
label: context.l10n.create,
child: SizedBox.square(
dimension: 30,
child: IconButton.outline(
key: const ValueKey('tasks-empty-create-button'),
density: ButtonDensity.compact,
onPressed: onCreateTask,
icon: const Icon(Icons.add, size: 16),
),
),
),
),
),
),
TextSpan(text: parts.last.trimLeft()),
],
),
textAlign: TextAlign.center,
style: TextStyle(color: AppPalette.of(context).textMuted, fontSize: 13),
);
}
}
@@ -1,35 +1,45 @@
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import '../../../../shared/theme/app_palette.dart'; import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/theme/app_design_tokens.dart';
import 'task_empty_create_hint.dart';
import '../../../../l10n/l10n.dart'; import '../../../../l10n/l10n.dart';
class TaskEmptyState extends StatelessWidget { class TaskEmptyState extends StatelessWidget {
const TaskEmptyState({super.key, this.message}); const TaskEmptyState({super.key, this.message, this.onCreateTask});
final String? message; final String? message;
final VoidCallback? onCreateTask;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final palette = AppPalette.of(context); final palette = AppPalette.of(context);
return Center( return Center(
child: ConstrainedBox( child: SingleChildScrollView(
constraints: const BoxConstraints(maxWidth: 360), child: ConstrainedBox(
child: Padding( constraints: const BoxConstraints(maxWidth: 360),
padding: const EdgeInsets.all(24), child: Padding(
child: Column( padding: const EdgeInsets.all(24),
mainAxisSize: MainAxisSize.min, child: Column(
children: [ mainAxisSize: MainAxisSize.min,
CustomPaint( children: [
key: const ValueKey('task-empty-illustration'), CustomPaint(
size: const Size(148, 108), key: const ValueKey('task-empty-illustration'),
painter: _TaskEmptyIllustrationPainter(palette: palette), size: const Size(148, 108),
), painter: _TaskEmptyIllustrationPainter(palette: palette),
const SizedBox(height: 18), ),
Text( const SizedBox(height: 18),
message ?? context.l10n.emptyTaskList, Text(
style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700), message ?? context.l10n.emptyTaskList,
), textAlign: TextAlign.center,
], style: TextStyle(color: palette.textPrimary, fontSize: 17, fontWeight: FontWeight.w700),
),
if (onCreateTask != null) ...[
const SizedBox(height: AppDesignTokens.space24),
TaskEmptyCreateHint(onCreateTask: onCreateTask!),
],
],
),
), ),
), ),
), ),
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "الإضافات", "extensions": "الإضافات",
"extensionInstallUrl": "عنوان التثبيت", "extensionInstallUrl": "عنوان التثبيت",
"extensionInstallSuccess": "تم التثبيت بنجاح", "extensionInstallSuccess": "تم التثبيت بنجاح",
"extensionUpdateConfirm": "هل تريد تحديث «{name}» إلى أحدث إصدار؟",
"extensionUpdateSuccess": "تم التحديث بنجاح", "extensionUpdateSuccess": "تم التحديث بنجاح",
"extensionDelete": "حذف الإضافة", "extensionDelete": "حذف الإضافة",
"extensionAlreadyLatest": "هذا هو أحدث إصدار بالفعل", "extensionAlreadyLatest": "هذا هو أحدث إصدار بالفعل",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "لا يدعم إصدار الويب تعديل إعدادات API مباشرة. عدّل خيارات بدء تشغيل الخادم أو ملف الإعدادات، ثم أعد تشغيل الخدمة لتطبيق التغييرات.", "webApiConfigReadOnlyHelp": "لا يدعم إصدار الويب تعديل إعدادات API مباشرة. عدّل خيارات بدء تشغيل الخادم أو ملف الإعدادات، ثم أعد تشغيل الخدمة لتطبيق التغييرات.",
"webMcpApiTokenHint": "إذا قمت بتكوين رمز API، فيجب تمرير معلومات المصادقة عند ربط الوكيل", "webMcpApiTokenHint": "إذا قمت بتكوين رمز API، فيجب تمرير معلومات المصادقة عند ربط الوكيل",
"useMcpApiTokenTemplate": "التبديل إلى إعدادات المصادقة", "useMcpApiTokenTemplate": "التبديل إلى إعدادات المصادقة",
"mcpRequiresTcp": "تتوفر إرشادات ربط الوكيل عندما يكون بروتوكول API هو TCP." "mcpRequiresTcp": "تتوفر إرشادات ربط الوكيل عندما يكون بروتوكول API هو TCP.",
"emptyTaskCreateHint": "اضغط على {action} لبدء التنزيل"
} }
+3 -1
View File
@@ -111,6 +111,7 @@
"extensions": "Uzantılar", "extensions": "Uzantılar",
"extensionInstallUrl": "Quraşdırma URL-i", "extensionInstallUrl": "Quraşdırma URL-i",
"extensionInstallSuccess": "Uğurla quraşdırıldı", "extensionInstallSuccess": "Uğurla quraşdırıldı",
"extensionUpdateConfirm": "“{name}” ən son versiyaya yenilənsin?",
"extensionUpdateSuccess": "Uğurla yeniləndi", "extensionUpdateSuccess": "Uğurla yeniləndi",
"extensionDelete": "Uzantını Sil", "extensionDelete": "Uzantını Sil",
"extensionAlreadyLatest": "Artıq son versiyadır", "extensionAlreadyLatest": "Artıq son versiyadır",
@@ -627,5 +628,6 @@
"webMcpApiTokenHint": "Əgər API açarı konfiqurasiya etmisinizsə, agenti qoşarkən doğrulama məlumatı tələb olunur", "webMcpApiTokenHint": "Əgər API açarı konfiqurasiya etmisinizsə, agenti qoşarkən doğrulama məlumatı tələb olunur",
"useMcpApiTokenTemplate": "Doğrulamalı konfiqurasiyaya keç", "useMcpApiTokenTemplate": "Doğrulamalı konfiqurasiyaya keç",
"webApiConfigReadOnlyHelp": "Veb versiyası API parametrlərinin onlayn dəyişdirilməsini dəstəkləmir. Server başlanğıc seçimlərini və ya konfiqurasiya faylını yeniləyin, sonra dəyişikliklərin qüvvəyə minməsi üçün xidməti yenidən başladın.", "webApiConfigReadOnlyHelp": "Veb versiyası API parametrlərinin onlayn dəyişdirilməsini dəstəkləmir. Server başlanğıc seçimlərini və ya konfiqurasiya faylını yeniləyin, sonra dəyişikliklərin qüvvəyə minməsi üçün xidməti yenidən başladın.",
"mcpRequiresTcp": "Agent əlaqə təlimatları API protokolu TCP olduqda mövcuddur." "mcpRequiresTcp": "Agent əlaqə təlimatları API protokolu TCP olduqda mövcuddur.",
"emptyTaskCreateHint": "Endirməyə başlamaq üçün {action} düyməsinə klikləyin"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Extensions", "extensions": "Extensions",
"extensionInstallUrl": "URL d'instal·lació", "extensionInstallUrl": "URL d'instal·lació",
"extensionInstallSuccess": "S'ha instal·lat amb èxit", "extensionInstallSuccess": "S'ha instal·lat amb èxit",
"extensionUpdateConfirm": "Vols actualitzar «{name}» a la versió més recent?",
"extensionUpdateSuccess": "S'ha actualitzat amb èxit", "extensionUpdateSuccess": "S'ha actualitzat amb èxit",
"extensionDelete": "Suprimeix l'extensió", "extensionDelete": "Suprimeix l'extensió",
"extensionAlreadyLatest": "Ja està actualitzada", "extensionAlreadyLatest": "Ja està actualitzada",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "La versió web no permet modificar la configuració de l’API en línia. Actualitza les opcions d’inici del servidor o el fitxer de configuració i reinicia el servei perquè els canvis tinguin efecte.", "webApiConfigReadOnlyHelp": "La versió web no permet modificar la configuració de l’API en línia. Actualitza les opcions d’inici del servidor o el fitxer de configuració i reinicia el servei perquè els canvis tinguin efecte.",
"webMcpApiTokenHint": "Si heu configurat un token d’API, cal proporcionar la informació d’autenticació en connectar l’agent", "webMcpApiTokenHint": "Si heu configurat un token d’API, cal proporcionar la informació d’autenticació en connectar l’agent",
"useMcpApiTokenTemplate": "Canvia a la configuració autenticada", "useMcpApiTokenTemplate": "Canvia a la configuració autenticada",
"mcpRequiresTcp": "Les instruccions de connexió d’agents estan disponibles quan el protocol de l’API és TCP." "mcpRequiresTcp": "Les instruccions de connexió d’agents estan disponibles quan el protocol de l’API és TCP.",
"emptyTaskCreateHint": "Fes clic a {action} per començar a baixar"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Erweiterungen", "extensions": "Erweiterungen",
"extensionInstallUrl": "Installations-URL", "extensionInstallUrl": "Installations-URL",
"extensionInstallSuccess": "Erfolgreich installiert", "extensionInstallSuccess": "Erfolgreich installiert",
"extensionUpdateConfirm": "„{name}“ auf die neueste Version aktualisieren?",
"extensionUpdateSuccess": "Erfolgreich aktualisiert", "extensionUpdateSuccess": "Erfolgreich aktualisiert",
"extensionDelete": "Erweiterung löschen", "extensionDelete": "Erweiterung löschen",
"extensionAlreadyLatest": "Es ist bereits die neueste Version", "extensionAlreadyLatest": "Es ist bereits die neueste Version",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "In der Web-Version können API-Einstellungen nicht online geändert werden. Ändere die Server-Startoptionen oder die Konfigurationsdatei und starte den Dienst neu, damit die Änderungen wirksam werden.", "webApiConfigReadOnlyHelp": "In der Web-Version können API-Einstellungen nicht online geändert werden. Ändere die Server-Startoptionen oder die Konfigurationsdatei und starte den Dienst neu, damit die Änderungen wirksam werden.",
"webMcpApiTokenHint": "Wenn du ein API-Token konfiguriert hast, müssen beim Verbinden des Agents Authentifizierungsinformationen übermittelt werden", "webMcpApiTokenHint": "Wenn du ein API-Token konfiguriert hast, müssen beim Verbinden des Agents Authentifizierungsinformationen übermittelt werden",
"useMcpApiTokenTemplate": "Zur authentifizierten Konfiguration wechseln", "useMcpApiTokenTemplate": "Zur authentifizierten Konfiguration wechseln",
"mcpRequiresTcp": "Anweisungen zur Agent-Verbindung sind verfügbar, wenn das API-Protokoll TCP ist." "mcpRequiresTcp": "Anweisungen zur Agent-Verbindung sind verfügbar, wenn das API-Protokoll TCP ist.",
"emptyTaskCreateHint": "Klicke auf {action}, um den Download zu starten"
} }
+18 -1
View File
@@ -111,6 +111,14 @@
"extensions": "Extensions", "extensions": "Extensions",
"extensionInstallUrl": "Install URL", "extensionInstallUrl": "Install URL",
"extensionInstallSuccess": "Installed successfully", "extensionInstallSuccess": "Installed successfully",
"extensionUpdateConfirm": "Update “{name}” to the latest version?",
"@extensionUpdateConfirm": {
"placeholders": {
"name": {
"type": "String"
}
}
},
"extensionUpdateSuccess": "Updated successfully", "extensionUpdateSuccess": "Updated successfully",
"extensionDelete": "Delete Extension", "extensionDelete": "Delete Extension",
"extensionAlreadyLatest": "It's already the latest version", "extensionAlreadyLatest": "It's already the latest version",
@@ -627,5 +635,14 @@
"webMcpApiTokenHint": "If you configured an API token, authentication information is required when connecting the agent", "webMcpApiTokenHint": "If you configured an API token, authentication information is required when connecting the agent",
"useMcpApiTokenTemplate": "Switch to authenticated configuration", "useMcpApiTokenTemplate": "Switch to authenticated configuration",
"webApiConfigReadOnlyHelp": "The web version cannot modify API settings online. Update the server startup options or configuration file, then restart the service for changes to take effect.", "webApiConfigReadOnlyHelp": "The web version cannot modify API settings online. Update the server startup options or configuration file, then restart the service for changes to take effect.",
"mcpRequiresTcp": "Agent connection instructions are available when the API protocol is TCP." "mcpRequiresTcp": "Agent connection instructions are available when the API protocol is TCP.",
"emptyTaskCreateHint": "Click {action} to start downloading",
"@emptyTaskCreateHint": {
"description": "Empty-list guidance; action is replaced with an inline create button.",
"placeholders": {
"action": {
"type": "String"
}
}
}
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Extensiones", "extensions": "Extensiones",
"extensionInstallUrl": "URL de instalación", "extensionInstallUrl": "URL de instalación",
"extensionInstallSuccess": "Instalado con éxito", "extensionInstallSuccess": "Instalado con éxito",
"extensionUpdateConfirm": "¿Actualizar «{name}» a la última versión?",
"extensionUpdateSuccess": "Actualizado con éxito", "extensionUpdateSuccess": "Actualizado con éxito",
"extensionDelete": "Eliminar Extensión", "extensionDelete": "Eliminar Extensión",
"extensionAlreadyLatest": "Ya es la versión más reciente", "extensionAlreadyLatest": "Ya es la versión más reciente",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "La versión web no permite modificar la configuración de la API en línea. Actualiza las opciones de inicio del servidor o el archivo de configuración y reinicia el servicio para aplicar los cambios.", "webApiConfigReadOnlyHelp": "La versión web no permite modificar la configuración de la API en línea. Actualiza las opciones de inicio del servidor o el archivo de configuración y reinicia el servicio para aplicar los cambios.",
"webMcpApiTokenHint": "Si has configurado un token de API, debes proporcionar la información de autenticación al conectar el agente", "webMcpApiTokenHint": "Si has configurado un token de API, debes proporcionar la información de autenticación al conectar el agente",
"useMcpApiTokenTemplate": "Cambiar a la configuración autenticada", "useMcpApiTokenTemplate": "Cambiar a la configuración autenticada",
"mcpRequiresTcp": "Las instrucciones de conexión de agentes están disponibles cuando el protocolo de la API es TCP." "mcpRequiresTcp": "Las instrucciones de conexión de agentes están disponibles cuando el protocolo de la API es TCP.",
"emptyTaskCreateHint": "Haz clic en {action} para empezar a descargar"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "افزونه‌ها", "extensions": "افزونه‌ها",
"extensionInstallUrl": "نشانی نصب", "extensionInstallUrl": "نشانی نصب",
"extensionInstallSuccess": "نصب شده با موفقیت", "extensionInstallSuccess": "نصب شده با موفقیت",
"extensionUpdateConfirm": "«{name}» به آخرین نسخه به‌روزرسانی شود؟",
"extensionUpdateSuccess": "به روز رسانی موفقیت آمیز", "extensionUpdateSuccess": "به روز رسانی موفقیت آمیز",
"extensionDelete": "حذف افزونه", "extensionDelete": "حذف افزونه",
"extensionAlreadyLatest": "این نسخه در حال حاضر آخرین نسخه است", "extensionAlreadyLatest": "این نسخه در حال حاضر آخرین نسخه است",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "نسخه وب از ویرایش آنلاین تنظیمات API پشتیبانی نمی‌کند. گزینه‌های راه‌اندازی سرور یا فایل پیکربندی را تغییر دهید و برای اعمال تغییرات سرویس را دوباره راه‌اندازی کنید.", "webApiConfigReadOnlyHelp": "نسخه وب از ویرایش آنلاین تنظیمات API پشتیبانی نمی‌کند. گزینه‌های راه‌اندازی سرور یا فایل پیکربندی را تغییر دهید و برای اعمال تغییرات سرویس را دوباره راه‌اندازی کنید.",
"webMcpApiTokenHint": "اگر توکن API را پیکربندی کرده‌اید، هنگام اتصال عامل باید اطلاعات احراز هویت را ارسال کنید", "webMcpApiTokenHint": "اگر توکن API را پیکربندی کرده‌اید، هنگام اتصال عامل باید اطلاعات احراز هویت را ارسال کنید",
"useMcpApiTokenTemplate": "تغییر به پیکربندی احراز هویت", "useMcpApiTokenTemplate": "تغییر به پیکربندی احراز هویت",
"mcpRequiresTcp": "راهنمای اتصال عامل زمانی در دسترس است که پروتکل API روی TCP باشد." "mcpRequiresTcp": "راهنمای اتصال عامل زمانی در دسترس است که پروتکل API روی TCP باشد.",
"emptyTaskCreateHint": "برای شروع دانلود روی {action} کلیک کنید"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Extensions", "extensions": "Extensions",
"extensionInstallUrl": "URL d'installation", "extensionInstallUrl": "URL d'installation",
"extensionInstallSuccess": "Installé avec succès", "extensionInstallSuccess": "Installé avec succès",
"extensionUpdateConfirm": "Mettre à jour « {name} » vers la dernière version ?",
"extensionUpdateSuccess": "Mis à jour avec succès", "extensionUpdateSuccess": "Mis à jour avec succès",
"extensionDelete": "Supprimer l'extension", "extensionDelete": "Supprimer l'extension",
"extensionAlreadyLatest": "C'est déjà la dernière version", "extensionAlreadyLatest": "C'est déjà la dernière version",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "La version web ne permet pas de modifier les paramètres de l’API en ligne. Modifiez les options de démarrage du serveur ou le fichier de configuration, puis redémarrez le service pour appliquer les changements.", "webApiConfigReadOnlyHelp": "La version web ne permet pas de modifier les paramètres de l’API en ligne. Modifiez les options de démarrage du serveur ou le fichier de configuration, puis redémarrez le service pour appliquer les changements.",
"webMcpApiTokenHint": "Si vous avez configuré un jeton API, les informations d’authentification doivent être transmises lors de la connexion de l’agent", "webMcpApiTokenHint": "Si vous avez configuré un jeton API, les informations d’authentification doivent être transmises lors de la connexion de l’agent",
"useMcpApiTokenTemplate": "Passer à la configuration authentifiée", "useMcpApiTokenTemplate": "Passer à la configuration authentifiée",
"mcpRequiresTcp": "Les instructions de connexion des agents sont disponibles lorsque le protocole de l’API est TCP." "mcpRequiresTcp": "Les instructions de connexion des agents sont disponibles lorsque le protocole de l’API est TCP.",
"emptyTaskCreateHint": "Cliquez sur {action} pour commencer le téléchargement"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Bővítmények", "extensions": "Bővítmények",
"extensionInstallUrl": "Telepítési URL", "extensionInstallUrl": "Telepítési URL",
"extensionInstallSuccess": "Sikeresen telepítve", "extensionInstallSuccess": "Sikeresen telepítve",
"extensionUpdateConfirm": "Frissíti a(z) „{name}” bővítményt a legújabb verzióra?",
"extensionUpdateSuccess": "Sikeresen frissítve", "extensionUpdateSuccess": "Sikeresen frissítve",
"extensionDelete": "Bővítmény törlése", "extensionDelete": "Bővítmény törlése",
"extensionAlreadyLatest": "Ez már a legfrissebb verzió", "extensionAlreadyLatest": "Ez már a legfrissebb verzió",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "A webes verzióban az API-beállítások nem módosíthatók online. Módosítsd a kiszolgáló indítási beállításait vagy a konfigurációs fájlt, majd indítsd újra a szolgáltatást.", "webApiConfigReadOnlyHelp": "A webes verzióban az API-beállítások nem módosíthatók online. Módosítsd a kiszolgáló indítási beállításait vagy a konfigurációs fájlt, majd indítsd újra a szolgáltatást.",
"webMcpApiTokenHint": "Ha API-tokent állítottál be, az ügynök csatlakoztatásakor meg kell adni a hitelesítési adatokat", "webMcpApiTokenHint": "Ha API-tokent állítottál be, az ügynök csatlakoztatásakor meg kell adni a hitelesítési adatokat",
"useMcpApiTokenTemplate": "Váltás hitelesített konfigurációra", "useMcpApiTokenTemplate": "Váltás hitelesített konfigurációra",
"mcpRequiresTcp": "Az ügynökcsatlakoztatási útmutató akkor érhető el, ha az API protokollja TCP." "mcpRequiresTcp": "Az ügynökcsatlakoztatási útmutató akkor érhető el, ha az API protokollja TCP.",
"emptyTaskCreateHint": "Kattints a {action} gombra a letöltés indításához"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Ekstensi", "extensions": "Ekstensi",
"extensionInstallUrl": "URL Instal", "extensionInstallUrl": "URL Instal",
"extensionInstallSuccess": "Diinstal dengan sukses", "extensionInstallSuccess": "Diinstal dengan sukses",
"extensionUpdateConfirm": "Perbarui “{name}” ke versi terbaru?",
"extensionUpdateSuccess": "Diperbaruhi dengan sukses", "extensionUpdateSuccess": "Diperbaruhi dengan sukses",
"extensionDelete": "Hapus Ekstensi", "extensionDelete": "Hapus Ekstensi",
"extensionAlreadyLatest": "Ini sudah versi terbaru", "extensionAlreadyLatest": "Ini sudah versi terbaru",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Versi web tidak dapat mengubah pengaturan API secara online. Perbarui opsi startup server atau file konfigurasi, lalu mulai ulang layanan agar perubahan diterapkan.", "webApiConfigReadOnlyHelp": "Versi web tidak dapat mengubah pengaturan API secara online. Perbarui opsi startup server atau file konfigurasi, lalu mulai ulang layanan agar perubahan diterapkan.",
"webMcpApiTokenHint": "Jika Anda telah mengatur token API, informasi autentikasi harus disertakan saat menghubungkan agen", "webMcpApiTokenHint": "Jika Anda telah mengatur token API, informasi autentikasi harus disertakan saat menghubungkan agen",
"useMcpApiTokenTemplate": "Beralih ke konfigurasi terautentikasi", "useMcpApiTokenTemplate": "Beralih ke konfigurasi terautentikasi",
"mcpRequiresTcp": "Petunjuk koneksi agen tersedia saat protokol API menggunakan TCP." "mcpRequiresTcp": "Petunjuk koneksi agen tersedia saat protokol API menggunakan TCP.",
"emptyTaskCreateHint": "Klik {action} untuk mulai mengunduh"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Estensioni", "extensions": "Estensioni",
"extensionInstallUrl": "Installa URL", "extensionInstallUrl": "Installa URL",
"extensionInstallSuccess": "Installato con successo", "extensionInstallSuccess": "Installato con successo",
"extensionUpdateConfirm": "Aggiornare «{name}» alla versione più recente?",
"extensionUpdateSuccess": "Aggiornato con successo", "extensionUpdateSuccess": "Aggiornato con successo",
"extensionDelete": "Elimina estensione", "extensionDelete": "Elimina estensione",
"extensionAlreadyLatest": "È già l'ultima versione", "extensionAlreadyLatest": "È già l'ultima versione",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "La versione web non consente di modificare online le impostazioni API. Aggiorna le opzioni di avvio del server o il file di configurazione, quindi riavvia il servizio per applicare le modifiche.", "webApiConfigReadOnlyHelp": "La versione web non consente di modificare online le impostazioni API. Aggiorna le opzioni di avvio del server o il file di configurazione, quindi riavvia il servizio per applicare le modifiche.",
"webMcpApiTokenHint": "Se hai configurato un token API, devi fornire le informazioni di autenticazione quando colleghi l’agente", "webMcpApiTokenHint": "Se hai configurato un token API, devi fornire le informazioni di autenticazione quando colleghi l’agente",
"useMcpApiTokenTemplate": "Passa alla configurazione autenticata", "useMcpApiTokenTemplate": "Passa alla configurazione autenticata",
"mcpRequiresTcp": "Le istruzioni per connettere gli agenti sono disponibili quando il protocollo API è TCP." "mcpRequiresTcp": "Le istruzioni per connettere gli agenti sono disponibili quando il protocollo API è TCP.",
"emptyTaskCreateHint": "Fai clic su {action} per iniziare il download"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "拡張機能", "extensions": "拡張機能",
"extensionInstallUrl": "インストールURL", "extensionInstallUrl": "インストールURL",
"extensionInstallSuccess": "正常にインストールされました", "extensionInstallSuccess": "正常にインストールされました",
"extensionUpdateConfirm": "「{name}」を最新バージョンに更新しますか?",
"extensionUpdateSuccess": "正常に更新されました", "extensionUpdateSuccess": "正常に更新されました",
"extensionDelete": "拡張機能を削除", "extensionDelete": "拡張機能を削除",
"extensionAlreadyLatest": "既に最新バージョンです", "extensionAlreadyLatest": "既に最新バージョンです",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Web 版では API 設定をオンラインで変更できません。サーバーの起動オプションまたは設定ファイルを変更し、サービスを再起動して反映してください。", "webApiConfigReadOnlyHelp": "Web 版では API 設定をオンラインで変更できません。サーバーの起動オプションまたは設定ファイルを変更し、サービスを再起動して反映してください。",
"webMcpApiTokenHint": "API トークンを設定している場合、エージェント接続時に認証情報を渡す必要があります", "webMcpApiTokenHint": "API トークンを設定している場合、エージェント接続時に認証情報を渡す必要があります",
"useMcpApiTokenTemplate": "認証付き設定に切り替える", "useMcpApiTokenTemplate": "認証付き設定に切り替える",
"mcpRequiresTcp": "API プロトコルが TCP の場合にエージェント接続手順を利用できます。" "mcpRequiresTcp": "API プロトコルが TCP の場合にエージェント接続手順を利用できます。",
"emptyTaskCreateHint": "{action}をクリックしてダウンロードを開始"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "확장 프로그램", "extensions": "확장 프로그램",
"extensionInstallUrl": "설치 URL", "extensionInstallUrl": "설치 URL",
"extensionInstallSuccess": "설치되었습니다", "extensionInstallSuccess": "설치되었습니다",
"extensionUpdateConfirm": "“{name}”을(를) 최신 버전으로 업데이트할까요?",
"extensionUpdateSuccess": "업데이트되었습니다", "extensionUpdateSuccess": "업데이트되었습니다",
"extensionDelete": "확장 프로그램 삭제", "extensionDelete": "확장 프로그램 삭제",
"extensionAlreadyLatest": "이미 최신 버전입니다", "extensionAlreadyLatest": "이미 최신 버전입니다",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "웹 버전에서는 API 설정을 온라인으로 수정할 수 없습니다. 서버 시작 옵션이나 구성 파일을 변경한 후 서비스를 다시 시작해야 적용됩니다.", "webApiConfigReadOnlyHelp": "웹 버전에서는 API 설정을 온라인으로 수정할 수 없습니다. 서버 시작 옵션이나 구성 파일을 변경한 후 서비스를 다시 시작해야 적용됩니다.",
"webMcpApiTokenHint": "API 토큰을 설정한 경우 에이전트 연결 시 인증 정보를 전달해야 합니다", "webMcpApiTokenHint": "API 토큰을 설정한 경우 에이전트 연결 시 인증 정보를 전달해야 합니다",
"useMcpApiTokenTemplate": "인증 구성으로 전환", "useMcpApiTokenTemplate": "인증 구성으로 전환",
"mcpRequiresTcp": "API 프로토콜이 TCP일 때 에이전트 연결 안내를 사용할 수 있습니다." "mcpRequiresTcp": "API 프로토콜이 TCP일 때 에이전트 연결 안내를 사용할 수 있습니다.",
"emptyTaskCreateHint": "{action}을 눌러 다운로드 시작"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Wtyczki", "extensions": "Wtyczki",
"extensionInstallUrl": "Instaluj z url", "extensionInstallUrl": "Instaluj z url",
"extensionInstallSuccess": "Instalacja zakończona", "extensionInstallSuccess": "Instalacja zakończona",
"extensionUpdateConfirm": "Zaktualizować „{name}” do najnowszej wersji?",
"extensionUpdateSuccess": "Aktualizacja zakończona", "extensionUpdateSuccess": "Aktualizacja zakończona",
"extensionDelete": "Usuń wtyczkę", "extensionDelete": "Usuń wtyczkę",
"extensionAlreadyLatest": "Wtyczka w aktualnej wersji", "extensionAlreadyLatest": "Wtyczka w aktualnej wersji",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Wersja webowa nie obsługuje edycji ustawień API online. Zmień opcje uruchamiania serwera lub plik konfiguracyjny, a następnie uruchom usługę ponownie.", "webApiConfigReadOnlyHelp": "Wersja webowa nie obsługuje edycji ustawień API online. Zmień opcje uruchamiania serwera lub plik konfiguracyjny, a następnie uruchom usługę ponownie.",
"webMcpApiTokenHint": "Jeśli skonfigurowano token API, podczas łączenia agenta należy przekazać dane uwierzytelniające", "webMcpApiTokenHint": "Jeśli skonfigurowano token API, podczas łączenia agenta należy przekazać dane uwierzytelniające",
"useMcpApiTokenTemplate": "Przełącz na konfigurację z uwierzytelnianiem", "useMcpApiTokenTemplate": "Przełącz na konfigurację z uwierzytelnianiem",
"mcpRequiresTcp": "Instrukcje łączenia agentów są dostępne, gdy protokół API to TCP." "mcpRequiresTcp": "Instrukcje łączenia agentów są dostępne, gdy protokół API to TCP.",
"emptyTaskCreateHint": "Kliknij {action}, aby rozpocząć pobieranie"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Extensões", "extensions": "Extensões",
"extensionInstallUrl": "Link de Instalação", "extensionInstallUrl": "Link de Instalação",
"extensionInstallSuccess": "Instalado com Sucesso", "extensionInstallSuccess": "Instalado com Sucesso",
"extensionUpdateConfirm": "Atualizar “{name}” para a versão mais recente?",
"extensionUpdateSuccess": "Atualizado com Sucesso", "extensionUpdateSuccess": "Atualizado com Sucesso",
"extensionDelete": "Excluir Extensão", "extensionDelete": "Excluir Extensão",
"extensionAlreadyLatest": "Já é a última versão", "extensionAlreadyLatest": "Já é a última versão",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "A versão web não permite alterar as definições da API online. Atualize as opções de arranque do servidor ou o ficheiro de configuração e reinicie o serviço para aplicar as alterações.", "webApiConfigReadOnlyHelp": "A versão web não permite alterar as definições da API online. Atualize as opções de arranque do servidor ou o ficheiro de configuração e reinicie o serviço para aplicar as alterações.",
"webMcpApiTokenHint": "Se configurou um token de API, é necessário fornecer as informações de autenticação ao ligar o agente", "webMcpApiTokenHint": "Se configurou um token de API, é necessário fornecer as informações de autenticação ao ligar o agente",
"useMcpApiTokenTemplate": "Mudar para a configuração autenticada", "useMcpApiTokenTemplate": "Mudar para a configuração autenticada",
"mcpRequiresTcp": "As instruções de conexão de agentes estão disponíveis quando o protocolo da API é TCP." "mcpRequiresTcp": "As instruções de conexão de agentes estão disponíveis quando o protocolo da API é TCP.",
"emptyTaskCreateHint": "Clique em {action} para começar a baixar"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Расширения", "extensions": "Расширения",
"extensionInstallUrl": "URL для установки", "extensionInstallUrl": "URL для установки",
"extensionInstallSuccess": "Установка завершена", "extensionInstallSuccess": "Установка завершена",
"extensionUpdateConfirm": "Обновить «{name}» до последней версии?",
"extensionUpdateSuccess": "Обновление завершено", "extensionUpdateSuccess": "Обновление завершено",
"extensionDelete": "Удалить расширение", "extensionDelete": "Удалить расширение",
"extensionAlreadyLatest": "Это последняя версия", "extensionAlreadyLatest": "Это последняя версия",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "В веб-версии нельзя изменить настройки API онлайн. Измените параметры запуска сервера или файл конфигурации, затем перезапустите службу.", "webApiConfigReadOnlyHelp": "В веб-версии нельзя изменить настройки API онлайн. Измените параметры запуска сервера или файл конфигурации, затем перезапустите службу.",
"webMcpApiTokenHint": "Если настроен API-токен, при подключении агента необходимо передать данные аутентификации", "webMcpApiTokenHint": "Если настроен API-токен, при подключении агента необходимо передать данные аутентификации",
"useMcpApiTokenTemplate": "Переключиться на конфигурацию с аутентификацией", "useMcpApiTokenTemplate": "Переключиться на конфигурацию с аутентификацией",
"mcpRequiresTcp": "Инструкции по подключению агентов доступны, когда протокол API — TCP." "mcpRequiresTcp": "Инструкции по подключению агентов доступны, когда протокол API — TCP.",
"emptyTaskCreateHint": "Нажмите {action}, чтобы начать загрузку"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "நீட்டிப்புகள்", "extensions": "நீட்டிப்புகள்",
"extensionInstallUrl": "நிறுவப்படும் URL", "extensionInstallUrl": "நிறுவப்படும் URL",
"extensionInstallSuccess": "வெற்றிகரமாக நிறுவப்பட்டது", "extensionInstallSuccess": "வெற்றிகரமாக நிறுவப்பட்டது",
"extensionUpdateConfirm": "“{name}” ஐ சமீபத்திய பதிப்பிற்குப் புதுப்பிக்கவா?",
"extensionUpdateSuccess": "வெற்றிகரமாக புதுப்பிக்கப்பட்டது", "extensionUpdateSuccess": "வெற்றிகரமாக புதுப்பிக்கப்பட்டது",
"extensionDelete": "நீட்டிப்பை நீக்கு", "extensionDelete": "நீட்டிப்பை நீக்கு",
"extensionAlreadyLatest": "இது ஏற்கனவே சமீபத்திய பதிப்பாகும்", "extensionAlreadyLatest": "இது ஏற்கனவே சமீபத்திய பதிப்பாகும்",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "இணையப் பதிப்பில் API அமைப்புகளை ஆன்லைனில் மாற்ற முடியாது. சேவையக தொடக்க விருப்பங்கள் அல்லது உள்ளமைவு கோப்பை மாற்றி, மாற்றங்கள் செயல்பட சேவையை மறுதொடக்கம் செய்யவும்.", "webApiConfigReadOnlyHelp": "இணையப் பதிப்பில் API அமைப்புகளை ஆன்லைனில் மாற்ற முடியாது. சேவையக தொடக்க விருப்பங்கள் அல்லது உள்ளமைவு கோப்பை மாற்றி, மாற்றங்கள் செயல்பட சேவையை மறுதொடக்கம் செய்யவும்.",
"webMcpApiTokenHint": "API டோக்கனை அமைத்திருந்தால், முகவரை இணைக்கும்போது அங்கீகாரத் தகவலை அனுப்ப வேண்டும்", "webMcpApiTokenHint": "API டோக்கனை அமைத்திருந்தால், முகவரை இணைக்கும்போது அங்கீகாரத் தகவலை அனுப்ப வேண்டும்",
"useMcpApiTokenTemplate": "அங்கீகார உள்ளமைவுக்கு மாறு", "useMcpApiTokenTemplate": "அங்கீகார உள்ளமைவுக்கு மாறு",
"mcpRequiresTcp": "API நெறிமுறை TCP ஆக இருக்கும்போது முகவர் இணைப்பு வழிமுறைகள் கிடைக்கும்." "mcpRequiresTcp": "API நெறிமுறை TCP ஆக இருக்கும்போது முகவர் இணைப்பு வழிமுறைகள் கிடைக்கும்.",
"emptyTaskCreateHint": "பதிவிறக்கத்தைத் தொடங்க {action} ஐ அழுத்தவும்"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Eklentiler", "extensions": "Eklentiler",
"extensionInstallUrl": "Kurulum URL'si", "extensionInstallUrl": "Kurulum URL'si",
"extensionInstallSuccess": "Başarıyla kuruldu", "extensionInstallSuccess": "Başarıyla kuruldu",
"extensionUpdateConfirm": "“{name}” en son sürüme güncellensin mi?",
"extensionUpdateSuccess": "Başarıyla güncellendi", "extensionUpdateSuccess": "Başarıyla güncellendi",
"extensionDelete": "Eklentiyi Sil", "extensionDelete": "Eklentiyi Sil",
"extensionAlreadyLatest": "Zaten en son sürüm", "extensionAlreadyLatest": "Zaten en son sürüm",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Web sürümü API ayarlarının çevrimiçi değiştirilmesini desteklemez. Sunucu başlatma seçeneklerini veya yapılandırma dosyasını güncelleyin ve değişikliklerin etkili olması için hizmeti yeniden başlatın.", "webApiConfigReadOnlyHelp": "Web sürümü API ayarlarının çevrimiçi değiştirilmesini desteklemez. Sunucu başlatma seçeneklerini veya yapılandırma dosyasını güncelleyin ve değişikliklerin etkili olması için hizmeti yeniden başlatın.",
"webMcpApiTokenHint": "Bir API anahtarı yapılandırdıysanız, ajan bağlanırken kimlik doğrulama bilgileri iletilmelidir", "webMcpApiTokenHint": "Bir API anahtarı yapılandırdıysanız, ajan bağlanırken kimlik doğrulama bilgileri iletilmelidir",
"useMcpApiTokenTemplate": "Kimlik doğrulamalı yapılandırmaya geç", "useMcpApiTokenTemplate": "Kimlik doğrulamalı yapılandırmaya geç",
"mcpRequiresTcp": "Ajan bağlantı yönergeleri API protokolü TCP olduğunda kullanılabilir." "mcpRequiresTcp": "Ajan bağlantı yönergeleri API protokolü TCP olduğunda kullanılabilir.",
"emptyTaskCreateHint": "İndirmeye başlamak için {action} düğmesine tıklayın"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Розширення", "extensions": "Розширення",
"extensionInstallUrl": "URL для встановлення", "extensionInstallUrl": "URL для встановлення",
"extensionInstallSuccess": "Встановлено успішно", "extensionInstallSuccess": "Встановлено успішно",
"extensionUpdateConfirm": "Оновити «{name}» до останньої версії?",
"extensionUpdateSuccess": "Оновлено успішно", "extensionUpdateSuccess": "Оновлено успішно",
"extensionDelete": "Видалити розширення", "extensionDelete": "Видалити розширення",
"extensionAlreadyLatest": "Вже остання версія", "extensionAlreadyLatest": "Вже остання версія",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "У вебверсії не можна змінювати налаштування API онлайн. Змініть параметри запуску сервера або файл конфігурації, а потім перезапустіть службу.", "webApiConfigReadOnlyHelp": "У вебверсії не можна змінювати налаштування API онлайн. Змініть параметри запуску сервера або файл конфігурації, а потім перезапустіть службу.",
"webMcpApiTokenHint": "Якщо налаштовано API-токен, під час підключення агента потрібно передати дані автентифікації", "webMcpApiTokenHint": "Якщо налаштовано API-токен, під час підключення агента потрібно передати дані автентифікації",
"useMcpApiTokenTemplate": "Перейти до конфігурації з автентифікацією", "useMcpApiTokenTemplate": "Перейти до конфігурації з автентифікацією",
"mcpRequiresTcp": "Інструкції з підключення агентів доступні, коли протокол API — TCP." "mcpRequiresTcp": "Інструкції з підключення агентів доступні, коли протокол API — TCP.",
"emptyTaskCreateHint": "Натисніть {action}, щоб почати завантаження"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "Tiện ích mở rộng", "extensions": "Tiện ích mở rộng",
"extensionInstallUrl": "Liên kết cài đặt", "extensionInstallUrl": "Liên kết cài đặt",
"extensionInstallSuccess": "Cài đặt thành công", "extensionInstallSuccess": "Cài đặt thành công",
"extensionUpdateConfirm": "Cập nhật “{name}” lên phiên bản mới nhất?",
"extensionUpdateSuccess": "Cập nhật thành công", "extensionUpdateSuccess": "Cập nhật thành công",
"extensionDelete": "Xóa tiện ích mở rộng", "extensionDelete": "Xóa tiện ích mở rộng",
"extensionAlreadyLatest": "Đây đã là phiên bản mới nhất", "extensionAlreadyLatest": "Đây đã là phiên bản mới nhất",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Phiên bản web không hỗ trợ sửa cấu hình API trực tuyến. Hãy cập nhật tùy chọn khởi động máy chủ hoặc tệp cấu hình rồi khởi động lại dịch vụ để áp dụng thay đổi.", "webApiConfigReadOnlyHelp": "Phiên bản web không hỗ trợ sửa cấu hình API trực tuyến. Hãy cập nhật tùy chọn khởi động máy chủ hoặc tệp cấu hình rồi khởi động lại dịch vụ để áp dụng thay đổi.",
"webMcpApiTokenHint": "Nếu đã cấu hình API Token, bạn cần truyền thông tin xác thực khi kết nối tác nhân", "webMcpApiTokenHint": "Nếu đã cấu hình API Token, bạn cần truyền thông tin xác thực khi kết nối tác nhân",
"useMcpApiTokenTemplate": "Chuyển sang cấu hình có xác thực", "useMcpApiTokenTemplate": "Chuyển sang cấu hình có xác thực",
"mcpRequiresTcp": "Hướng dẫn kết nối tác nhân khả dụng khi giao thức API là TCP." "mcpRequiresTcp": "Hướng dẫn kết nối tác nhân khả dụng khi giao thức API là TCP.",
"emptyTaskCreateHint": "Nhấn {action} để bắt đầu tải xuống"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "扩展", "extensions": "扩展",
"extensionInstallUrl": "安装链接", "extensionInstallUrl": "安装链接",
"extensionInstallSuccess": "安装成功", "extensionInstallSuccess": "安装成功",
"extensionUpdateConfirm": "确定将“{name}”更新到最新版本吗?",
"extensionUpdateSuccess": "更新成功", "extensionUpdateSuccess": "更新成功",
"extensionDelete": "删除扩展", "extensionDelete": "删除扩展",
"extensionAlreadyLatest": "已经是最新版本", "extensionAlreadyLatest": "已经是最新版本",
@@ -443,5 +444,6 @@
"webMcpApiTokenHint": "若已配置 API Token,接入 Agent 时需要传递认证信息", "webMcpApiTokenHint": "若已配置 API Token,接入 Agent 时需要传递认证信息",
"useMcpApiTokenTemplate": "切换为认证配置", "useMcpApiTokenTemplate": "切换为认证配置",
"webApiConfigReadOnlyHelp": "Web 版本不支持在线修改 API 配置。请修改服务端启动参数或配置文件,并重启服务后使配置生效。", "webApiConfigReadOnlyHelp": "Web 版本不支持在线修改 API 配置。请修改服务端启动参数或配置文件,并重启服务后使配置生效。",
"mcpRequiresTcp": "API 通讯协议为 TCP 时才能使用 Agent 接入指引。" "mcpRequiresTcp": "API 通讯协议为 TCP 时才能使用 Agent 接入指引。",
"emptyTaskCreateHint": "点击{action}开始下载"
} }
+3 -1
View File
@@ -104,6 +104,7 @@
"extensions": "擴充功能", "extensions": "擴充功能",
"extensionInstallUrl": "安裝 URL", "extensionInstallUrl": "安裝 URL",
"extensionInstallSuccess": "安裝成功", "extensionInstallSuccess": "安裝成功",
"extensionUpdateConfirm": "確定將「{name}」更新到最新版本嗎?",
"extensionUpdateSuccess": "更新成功", "extensionUpdateSuccess": "更新成功",
"extensionDelete": "刪除擴充功能", "extensionDelete": "刪除擴充功能",
"extensionAlreadyLatest": "已是最新版本", "extensionAlreadyLatest": "已是最新版本",
@@ -443,5 +444,6 @@
"webApiConfigReadOnlyHelp": "Web 版本不支援線上修改 API 設定。請修改伺服器啟動參數或設定檔,並重新啟動服務後使設定生效。", "webApiConfigReadOnlyHelp": "Web 版本不支援線上修改 API 設定。請修改伺服器啟動參數或設定檔,並重新啟動服務後使設定生效。",
"webMcpApiTokenHint": "若已設定 API Token,接入 Agent 時需要傳遞認證資訊", "webMcpApiTokenHint": "若已設定 API Token,接入 Agent 時需要傳遞認證資訊",
"useMcpApiTokenTemplate": "切換為認證設定", "useMcpApiTokenTemplate": "切換為認證設定",
"mcpRequiresTcp": "API 通訊協定為 TCP 時才能使用 Agent 接入指引。" "mcpRequiresTcp": "API 通訊協定為 TCP 時才能使用 Agent 接入指引。",
"emptyTaskCreateHint": "點擊{action}開始下載"
} }
@@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@@ -7,18 +9,40 @@ import '../widgets/app_toast.dart';
class AppExitConfirmationController { class AppExitConfirmationController {
static const confirmationWindow = Duration(seconds: 2); static const confirmationWindow = Duration(seconds: 2);
DateTime? _lastBackAt; OverlayEntry? _toast;
Timer? _timer;
Future<void> handleBack(BuildContext context) async { Future<void> handleBack(BuildContext context) async {
final now = DateTime.now(); if (_toast != null) {
final lastBackAt = _lastBackAt; dispose();
if (lastBackAt != null && now.difference(lastBackAt) <= confirmationWindow) {
_lastBackAt = null;
await SystemNavigator.pop(); await SystemNavigator.pop();
return; return;
} }
_lastBackAt = now; final message = context.l10n.pressBackAgainToExit;
showAppToast(context, context.l10n.pressBackAgainToExit); final themes = InheritedTheme.capture(from: context, to: Overlay.of(context, rootOverlay: true).context);
_toast = OverlayEntry(
builder: (_) => IgnorePointer(
child: SafeArea(
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(24),
child: themes.wrap(AppToastContent(message: message)),
),
),
),
),
);
Overlay.of(context, rootOverlay: true).insert(_toast!);
_timer = Timer(confirmationWindow, dispose);
}
void dispose() {
_timer?.cancel();
_timer = null;
_toast?.remove();
_toast?.dispose();
_toast = null;
} }
} }
Loaded 50 of 61 files, more files were not shown because too many files have changed in this diff. Show more