Merge latest main into 2.0.0-beta.2

This commit is contained in:
Levi committed 2026-09-12 16:55:20 +08:00
commit ddce649c8b
74 files changed
+431 -176

No files matched your search

+1 -1
View File
@@ -63,7 +63,7 @@ Connect Gopeed to an AI agent and manage downloads with natural language. For ex
Gopeed 2.0.0 is currently in public beta, introducing a redesigned interface, a native communication architecture that connects desktop and mobile clients directly to the Go core through FFI, a more consistent cross-platform experience, improved task management, more flexible API support, and MCP-based AI agent integration. Some features may still be incomplete or unstable, so please try it and report any issues you encounter. Gopeed 2.0.0 is currently in public beta, introducing a redesigned interface, a native communication architecture that connects desktop and mobile clients directly to the Go core through FFI, a more consistent cross-platform experience, improved task management, more flexible API support, and MCP-based AI agent integration. Some features may still be incomplete or unstable, so please try it and report any issues you encounter.
- [Download Gopeed 2.0.0 Beta 1](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.1) - [Download Gopeed 2.0.0 Beta 2](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.2)
Once the features and stability meet our release standards, we will publish the official Gopeed 2.0.0 release. Beta users will be able to upgrade directly to the final release, while existing stable users will not be automatically moved onto the beta channel. Once the features and stability meet our release standards, we will publish the official Gopeed 2.0.0 release. Beta users will be able to upgrade directly to the final release, while existing stable users will not be automatically moved onto the beta channel.
+1 -1
View File
@@ -63,7 +63,7 @@ Gopeed を AI Agent と連携すると、自然言語でダウンロードを管
Gopeed 2.0.0 は現在パブリックベータ版です。刷新されたインターフェース、デスクトップおよびモバイルから FFI で Go コアへ直接接続するネイティブ通信アーキテクチャ、より統一されたクロスプラットフォーム体験、強化されたタスク管理、より柔軟な API、MCP による AI Agent 連携機能を導入しています。一部の機能はまだ不完全または不安定な場合がありますので、ぜひお試しいただき、問題があればフィードバックをお寄せください。 Gopeed 2.0.0 は現在パブリックベータ版です。刷新されたインターフェース、デスクトップおよびモバイルから FFI で Go コアへ直接接続するネイティブ通信アーキテクチャ、より統一されたクロスプラットフォーム体験、強化されたタスク管理、より柔軟な API、MCP による AI Agent 連携機能を導入しています。一部の機能はまだ不完全または不安定な場合がありますので、ぜひお試しいただき、問題があればフィードバックをお寄せください。
- [Gopeed 2.0.0 Beta 1 をダウンロード](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.1) - [Gopeed 2.0.0 Beta 2 をダウンロード](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.2)
機能と安定性が正式リリースの基準に達した時点で、Gopeed 2.0.0 正式版を公開します。ベータ版のユーザーは正式版へ直接アップデートできます。既存の安定版ユーザーが自動的にベータチャンネルへ移行することはありません。 機能と安定性が正式リリースの基準に達した時点で、Gopeed 2.0.0 正式版を公開します。ベータ版のユーザーは正式版へ直接アップデートできます。既存の安定版ユーザーが自動的にベータチャンネルへ移行することはありません。
+1 -1
View File
@@ -63,7 +63,7 @@ Sau khi kết nối Gopeed với AI Agent, bạn có thể quản lý tải xu
Gopeed 2.0.0 hiện đang trong giai đoạn beta công khai, với giao diện được thiết kế lại, kiến trúc giao tiếp native kết nối trực tiếp ứng dụng desktop và di động với lõi Go qua FFI, trải nghiệm đa nền tảng nhất quán hơn, khả năng quản lý tác vụ được cải thiện, API linh hoạt hơn và khả năng tích hợp AI Agent qua MCP. Một số tính năng có thể vẫn chưa hoàn thiện hoặc chưa ổn định, vì vậy hãy dùng thử và gửi phản hồi nếu bạn gặp vấn đề. Gopeed 2.0.0 hiện đang trong giai đoạn beta công khai, với giao diện được thiết kế lại, kiến trúc giao tiếp native kết nối trực tiếp ứng dụng desktop và di động với lõi Go qua FFI, trải nghiệm đa nền tảng nhất quán hơn, khả năng quản lý tác vụ được cải thiện, API linh hoạt hơn và khả năng tích hợp AI Agent qua MCP. Một số tính năng có thể vẫn chưa hoàn thiện hoặc chưa ổn định, vì vậy hãy dùng thử và gửi phản hồi nếu bạn gặp vấn đề.
- [Tải Gopeed 2.0.0 Beta 1](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.1) - [Tải Gopeed 2.0.0 Beta 2](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.2)
Khi các tính năng và độ ổn định đáp ứng tiêu chuẩn phát hành, chúng tôi sẽ phát hành Gopeed 2.0.0 chính thức. Người dùng bản beta có thể nâng cấp trực tiếp lên bản chính thức, trong khi người dùng bản ổn định hiện tại sẽ không tự động được chuyển sang kênh beta. Khi các tính năng và độ ổn định đáp ứng tiêu chuẩn phát hành, chúng tôi sẽ phát hành Gopeed 2.0.0 chính thức. Người dùng bản beta có thể nâng cấp trực tiếp lên bản chính thức, trong khi người dùng bản ổn định hiện tại sẽ không tự động được chuyển sang kênh beta.
+1 -1
View File
@@ -63,7 +63,7 @@ Gopeed(全称 **Go Speed**,也叫“够快下载器”)是一款使用 Go
Gopeed 2.0.0 目前处于公开 Beta 测试阶段,引入了全新界面、通过 FFI 直连 Go 核心的原生通信架构、更一致的跨平台体验、更完善的任务管理、更灵活的 API,以及用于 AI Agent 接入的 MCP 能力。部分功能仍可能不够完善或稳定,欢迎提前体验并向我们反馈问题。 Gopeed 2.0.0 目前处于公开 Beta 测试阶段,引入了全新界面、通过 FFI 直连 Go 核心的原生通信架构、更一致的跨平台体验、更完善的任务管理、更灵活的 API,以及用于 AI Agent 接入的 MCP 能力。部分功能仍可能不够完善或稳定,欢迎提前体验并向我们反馈问题。
- [下载 Gopeed 2.0.0 Beta 1](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.1) - [下载 Gopeed 2.0.0 Beta 2](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.2)
当功能完整度和稳定性达到正式发布标准后,我们会发布 Gopeed 2.0.0 正式版。已安装 Beta 版本的用户可以直接升级到最终正式版,现有稳定版用户则不会被自动切换到 Beta 渠道。 当功能完整度和稳定性达到正式发布标准后,我们会发布 Gopeed 2.0.0 正式版。已安装 Beta 版本的用户可以直接升级到最终正式版,现有稳定版用户则不会被自动切换到 Beta 渠道。
+1 -1
View File
@@ -63,7 +63,7 @@ Gopeed(**Go Speed** 的縮寫)是一款以 Go 與 Flutter 開發的高速、
Gopeed 2.0.0 目前處於公開 Beta 測試階段,引入了全新介面、透過 FFI 直連 Go 核心的原生通訊架構、更一致的跨平台體驗、更完善的任務管理、更靈活的 API,以及透過 MCP 串接 AI Agent 的能力。部分功能仍可能不夠完善或穩定,歡迎搶先體驗並向我們回報問題。 Gopeed 2.0.0 目前處於公開 Beta 測試階段,引入了全新介面、透過 FFI 直連 Go 核心的原生通訊架構、更一致的跨平台體驗、更完善的任務管理、更靈活的 API,以及透過 MCP 串接 AI Agent 的能力。部分功能仍可能不夠完善或穩定,歡迎搶先體驗並向我們回報問題。
- [下載 Gopeed 2.0.0 Beta 1](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.1) - [下載 Gopeed 2.0.0 Beta 2](https://github.com/GopeedLab/gopeed/releases/tag/v2.0.0-beta.2)
當功能完整度與穩定性達到正式發布標準後,我們會發布 Gopeed 2.0.0 正式版。已安裝 Beta 版本的使用者可以直接升級至最終正式版,現有穩定版使用者則不會被自動切換至 Beta 頻道。 當功能完整度與穩定性達到正式發布標準後,我們會發布 Gopeed 2.0.0 正式版。已安裝 Beta 版本的使用者可以直接升級至最終正式版,現有穩定版使用者則不會被自動切換至 Beta 頻道。
@@ -136,3 +136,52 @@ func TestUnescapeHTMLEntities(t *testing.T) {
}) })
} }
} }
func TestAppendFilenameExtension(t *testing.T) {
tests := []struct {
name string
filename string
contentType string
want string
}{
{
name: "adds extension from content type",
filename: "download",
contentType: "image/png",
want: "download.png",
},
{
name: "parses MIME parameters",
filename: "download",
contentType: "image/png; charset=binary",
want: "download.png",
},
{
name: "preserves existing extension",
filename: "download.zip",
contentType: "application/zip",
want: "download.zip",
},
{
name: "ignores invalid content type",
filename: "download",
contentType: "not a content type",
want: "download",
},
{
name: "ignores unknown content type",
filename: "download",
contentType: "application/x-gopeed-unknown",
want: "download",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := appendFilenameExtension(tt.filename, tt.contentType)
if got != tt.want {
t.Errorf("appendFilenameExtension() = %q, want %q", got, tt.want)
}
})
}
}
@@ -7,7 +7,7 @@ description: Design or revise Gopeed file-classification icons as one cohesive S
Maintain Gopeed's file-classification visual language and its deterministic SVG → TTF → Flutter `IconData` pipeline. Maintain Gopeed's file-classification visual language and its deterministic SVG → TTF → Flutter `IconData` pipeline.
The canonical editable materials live in `design/file-category-icons/`, outside the Flutter project. Read its `README.md` before changing any source. Do not add that directory to Flutter assets. The canonical editable materials live in `design/file-category-icons/` as tooling-only sources inside the Flutter project. Read its `README.md` before changing any source. Do not add that directory to Flutter assets.
## Classification grammar ## Classification grammar
@@ -49,7 +49,7 @@ Use [assets/manifest.example.json](assets/manifest.example.json) and [assets/fol
## Invariants ## Invariants
- Existing codepoints are API: never renumber or reuse one unless the user explicitly approves a breaking migration. - Existing codepoints are API: never renumber or reuse one unless the user explicitly approves a breaking migration.
- `design/file-category-icons/` is the sole editable source of truth. Flutter keeps only the generated runtime TTF and Dart constants. - `design/file-category-icons/` is the sole editable source of truth. The packaged Flutter runtime uses only the generated TTF and Dart constants.
- Never add the design-material directory to `pubspec.yaml`; it must remain outside the packaged Flutter asset graph. - Never add the design-material directory to `pubspec.yaml`; it must remain outside the packaged Flutter asset graph.
- The manifest is the source of truth. Do not hand-edit generated Dart constants or patch the binary font. - The manifest is the source of truth. Do not hand-edit generated Dart constants or patch the binary font.
- Keep icon names lowercase `snake_case`; the generator emits lowerCamelCase Dart fields. - Keep icon names lowercase `snake_case`; the generator emits lowerCamelCase Dart fields.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 818 B

After

Width:  |  Height:  |  Size: 818 B

@@ -1,6 +1,6 @@
# 文件分类图标源物料 # 文件分类图标源物料
此目录是 Gopeed 文件分类图标的唯一源物料目录,位于 Flutter 工程之外,不得加入 `ui/flutter/pubspec.yaml` 的 `assets` 配置。 此目录是 Gopeed 文件分类图标的唯一源物料目录。它位于 Flutter 工程内,但只用于设计和生成流程,不得加入 `pubspec.yaml` 的 `assets` 配置。
## 维护限制 ## 维护限制
@@ -17,8 +17,8 @@
## 生成产物 ## 生成产物
- Flutter 字体:`ui/flutter/assets/fonts/GopeedIcons.ttf` - Flutter 字体:`assets/fonts/GopeedIcons.ttf`
- Flutter 常量:`ui/flutter/lib/core/icons/gopeed_icons.dart` - Flutter 常量:`lib/core/icons/gopeed_icons.dart`
所有修改都应遵循: 所有修改都应遵循:
@@ -1,7 +1,7 @@
{ {
"fontFamily": "GopeedIcons", "fontFamily": "GopeedIcons",
"fontOutput": "../../ui/flutter/assets/fonts/GopeedIcons.ttf", "fontOutput": "../../assets/fonts/GopeedIcons.ttf",
"dartOutput": "../../ui/flutter/lib/core/icons/gopeed_icons.dart", "dartOutput": "../../lib/core/icons/gopeed_icons.dart",
"previewOutput": "preview/gopeed_icons_preview.png", "previewOutput": "preview/gopeed_icons_preview.png",
"dartClass": "GopeedIcons", "dartClass": "GopeedIcons",
"codepointStart": "0xE900", "codepointStart": "0xE900",
File renamed without changes.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 342 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 597 B

After

Width:  |  Height:  |  Size: 597 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 495 B

After

Width:  |  Height:  |  Size: 495 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 395 B

After

Width:  |  Height:  |  Size: 395 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 256 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 262 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 479 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 357 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 315 B

After

Width:  |  Height:  |  Size: 315 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 231 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 467 B

After

Width:  |  Height:  |  Size: 467 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 472 B

After

Width:  |  Height:  |  Size: 472 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 257 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 386 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

@@ -75,7 +75,7 @@ class AppWindowBootstrap {
static String subWindowTitle(AppWindowType type, AppLocalizations l10n) { static String subWindowTitle(AppWindowType type, AppLocalizations l10n) {
return switch (type) { return switch (type) {
AppWindowType.createTask => 'Gopeed-${l10n.create}', AppWindowType.createTask => 'Gopeed - ${l10n.create}',
_ => 'Gopeed', _ => 'Gopeed',
}; };
} }
@@ -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,
),
),
),
),
);
}
}
@@ -29,7 +29,6 @@ import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/theme/app_palette.dart'; import '../../../../shared/theme/app_palette.dart';
import '../../../../shared/widgets/app_choice_segmented_control.dart'; import '../../../../shared/widgets/app_choice_segmented_control.dart';
import '../../../../shared/widgets/app_http_headers_editor.dart'; import '../../../../shared/widgets/app_http_headers_editor.dart';
import '../../../../shared/widgets/app_loading_button.dart';
import '../../../../shared/widgets/app_number_input.dart'; import '../../../../shared/widgets/app_number_input.dart';
import '../../../../shared/widgets/app_path_picker_field.dart'; import '../../../../shared/widgets/app_path_picker_field.dart';
import '../../../../shared/widgets/app_text_field.dart'; import '../../../../shared/widgets/app_text_field.dart';
@@ -38,8 +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 '../widgets/create_task_action_buttons.dart';
import '../widgets/resolve_file_tree.dart'; import '../widgets/resolve_file_tree.dart';
import '../widgets/resolve_task_actions.dart';
class CreateTaskWindowPage extends ConsumerStatefulWidget { class CreateTaskWindowPage extends ConsumerStatefulWidget {
const CreateTaskWindowPage({super.key, this.windowController, this.initialTask}); const CreateTaskWindowPage({super.key, this.windowController, this.initialTask});
@@ -688,27 +687,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(
SecondaryButton( mainAxisAlignment: MainAxisAlignment.center,
onPressed: _creating ? null : _closeWindow, children: [
child: SizedBox(width: 68, child: Center(child: Text(context.l10n.cancel))), CreateTaskActionButtons(
), submitting: _creating,
const SizedBox(width: 12), onCancel: _closeWindow,
AppLoadingButton( onSubmit: _confirm,
key: const ValueKey('create-task-confirm-button'), cancelLabel: context.l10n.cancel,
onPressed: _confirm, submitLabel: context.l10n.confirm,
loading: _creating, cancelButtonKey: const ValueKey('create-task-cancel-button'),
variant: AppLoadingButtonVariant.primary, submitButtonKey: const ValueKey('create-task-confirm-button'),
child: SizedBox(width: 68, child: Center(child: Text(context.l10n.confirm))), ),
), ],
], ),
), ),
), ),
], ],
@@ -1159,10 +1158,14 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
), ),
actions: [ actions: [
flutter.Flexible( flutter.Flexible(
child: ResolveTaskActions( child: CreateTaskActionButtons(
submitting: submitting, submitting: submitting,
onCancel: () => closeOverlay(dialogContext, false), onCancel: () => closeOverlay(dialogContext, false),
onCreate: submit, onSubmit: submit,
cancelLabel: dialogContext.l10n.cancel,
submitLabel: dialogContext.l10n.createAction,
cancelButtonKey: const ValueKey('resolve-cancel-button'),
submitButtonKey: const ValueKey('resolve-create-button'),
), ),
), ),
], ],
@@ -1205,7 +1208,7 @@ class _CreateTaskWindowPageState extends ConsumerState<CreateTaskWindowPage> {
width: contentWidth, width: contentWidth,
child: Row( child: Row(
children: [ children: [
Expanded(child: Text(dialogContext.l10n.createHistory)), Expanded(child: Text(dialogContext.l10n.historyLinks)),
AppTooltip( AppTooltip(
message: dialogContext.l10n.clearHistory, message: dialogContext.l10n.clearHistory,
child: GhostButton( child: GhostButton(
@@ -0,0 +1,56 @@
import 'package:flutter/widgets.dart' as flutter;
import 'package:shadcn_flutter/shadcn_flutter.dart';
import '../../../../shared/theme/app_design_tokens.dart';
import '../../../../shared/widgets/app_loading_button.dart';
class CreateTaskActionButtons extends StatelessWidget {
const CreateTaskActionButtons({
super.key,
required this.submitting,
required this.onCancel,
required this.onSubmit,
required this.cancelLabel,
required this.submitLabel,
this.cancelButtonKey,
this.submitButtonKey,
});
final bool submitting;
final VoidCallback onCancel;
final VoidCallback onSubmit;
final String cancelLabel;
final String submitLabel;
final Key? cancelButtonKey;
final Key? submitButtonKey;
@override
Widget build(BuildContext context) {
return flutter.Row(
mainAxisSize: MainAxisSize.min,
children: [
SecondaryButton(
key: cancelButtonKey,
onPressed: submitting ? null : onCancel,
child: SizedBox(
width: _actionContentWidth,
child: Center(child: Text(cancelLabel)),
),
),
const SizedBox(width: AppDesignTokens.space12),
AppLoadingButton(
key: submitButtonKey,
onPressed: onSubmit,
loading: submitting,
variant: AppLoadingButtonVariant.primary,
child: SizedBox(
width: _actionContentWidth,
child: Center(child: Text(submitLabel)),
),
),
],
);
}
}
const _actionContentWidth = 68.0;
@@ -189,42 +189,48 @@ class _TreeFooter extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final palette = AppPalette.of(context); final palette = AppPalette.of(context);
final filters = _FileTypeFilterGroup( final filters = KeyedSubtree(
videoActive: activeTypeFilters.contains(_FileTypeFilter.video), key: const ValueKey('resolve-tree-filters'),
audioActive: activeTypeFilters.contains(_FileTypeFilter.audio), child: _FileTypeFilterGroup(
imageActive: activeTypeFilters.contains(_FileTypeFilter.image), videoActive: activeTypeFilters.contains(_FileTypeFilter.video),
onSelectVideo: onSelectVideo, audioActive: activeTypeFilters.contains(_FileTypeFilter.audio),
onSelectAudio: onSelectAudio, imageActive: activeTypeFilters.contains(_FileTypeFilter.image),
onSelectImage: onSelectImage, onSelectVideo: onSelectVideo,
onSelectAudio: onSelectAudio,
onSelectImage: onSelectImage,
),
); );
final stats = Row( final statsStyle = TextStyle(color: palette.textSecondary, fontSize: 12, fontWeight: FontWeight.w600);
mainAxisSize: MainAxisSize.min, final selectedLabel = context.l10n.selectedCount(selectedCount, totalCount);
final sizeLabel = unknownSize ? context.l10n.unknownSize : Util.fmtByte(selectedSize);
final baseline = MediaQuery.textScalerOf(context).scale(statsStyle.fontSize!);
final stats = Wrap(
key: const ValueKey('resolve-tree-selection-stats'),
alignment: WrapAlignment.end,
spacing: AppDesignTokens.space8,
runSpacing: AppDesignTokens.space4,
crossAxisAlignment: WrapCrossAlignment.start,
children: [ children: [
Text( Baseline(
context.l10n.selectedCount(selectedCount, totalCount), baseline: baseline,
style: TextStyle(color: palette.textSecondary, fontSize: 12, fontWeight: FontWeight.w600), baselineType: TextBaseline.alphabetic,
child: Text(key: const ValueKey('resolve-tree-selected-count'), selectedLabel, style: statsStyle),
), ),
const SizedBox(width: 8), Baseline(
Text( baseline: baseline,
unknownSize ? context.l10n.unknownSize : Util.fmtByte(selectedSize), baselineType: TextBaseline.alphabetic,
style: TextStyle(color: palette.textSecondary, fontSize: 12, fontWeight: FontWeight.w600), child: Text(key: const ValueKey('resolve-tree-selected-size'), sizeLabel, style: statsStyle),
), ),
], ],
); );
return LayoutBuilder(
builder: (context, constraints) { return OverflowBar(
if (constraints.maxWidth < 360) { key: const ValueKey('resolve-tree-footer'),
return Column( spacing: AppDesignTokens.space8,
crossAxisAlignment: CrossAxisAlignment.stretch, alignment: MainAxisAlignment.spaceBetween,
children: [ overflowAlignment: OverflowBarAlignment.end,
Align(alignment: Alignment.centerLeft, child: filters), overflowSpacing: AppDesignTokens.space4,
const SizedBox(height: 4), children: [filters, stats],
Align(alignment: Alignment.centerRight, child: stats),
],
);
}
return Row(crossAxisAlignment: CrossAxisAlignment.center, children: [filters, const Spacer(), stats]);
},
); );
} }
} }
@@ -290,7 +296,11 @@ class _FilterDivider extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox(width: 1, height: 18, child: ColoredBox(color: color)); return SizedBox(
width: _fileTypeFilterDividerWidth,
height: 18,
child: ColoredBox(color: color),
);
} }
} }
@@ -305,7 +315,7 @@ class _FilterButton extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final palette = AppPalette.of(context); final palette = AppPalette.of(context);
return SizedBox( return SizedBox(
width: 40, width: _fileTypeFilterButtonWidth,
height: 28, height: 28,
child: DecoratedBox( child: DecoratedBox(
decoration: BoxDecoration(color: active ? palette.filterActiveBg : null), decoration: BoxDecoration(color: active ? palette.filterActiveBg : null),
@@ -340,3 +350,5 @@ const _audioExts = <String>{'mp3', 'flac', 'wav', 'aac', 'm4a', 'ogg', 'ape'};
const _imageExts = <String>{'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'}; const _imageExts = <String>{'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'};
const _resolveTreeRowHeight = 36.0; const _resolveTreeRowHeight = 36.0;
const _resolveFileNameStyle = TextStyle(fontSize: 14, height: 1.25); const _resolveFileNameStyle = TextStyle(fontSize: 14, height: 1.25);
const _fileTypeFilterButtonWidth = 40.0;
const _fileTypeFilterDividerWidth = 1.0;
+1 -1
View File
@@ -353,7 +353,7 @@
"resolvedFileCount": "{count}", "resolvedFileCount": "{count}",
"resourceHasNoFiles": "ولا توجد في هذا المورد قائمة ملف قابلة للاختيار", "resourceHasNoFiles": "ولا توجد في هذا المورد قائمة ملف قابلة للاختيار",
"noFiles": "لا توجد ملفات", "noFiles": "لا توجد ملفات",
"createHistory": "تاريخ الخلق", "historyLinks": "روابط السجل",
"noHistory": "لا تاريخ", "noHistory": "لا تاريخ",
"directDownloadDescription": "حل المشاكل وخلق المهام على الفور", "directDownloadDescription": "حل المشاكل وخلق المهام على الفور",
"taskProgress": "التقدم المحرز", "taskProgress": "التقدم المحرز",
+1 -1
View File
@@ -367,7 +367,7 @@
"resolvedFileCount": "{count} fayl tapıldı", "resolvedFileCount": "{count} fayl tapıldı",
"resourceHasNoFiles": "Bu resursda seçilə bilən fayl siyahısı yoxdur", "resourceHasNoFiles": "Bu resursda seçilə bilən fayl siyahısı yoxdur",
"noFiles": "Fayl yoxdur", "noFiles": "Fayl yoxdur",
"createHistory": "Tarixçə Yarat", "historyLinks": "Tarixçə keçidləri",
"noHistory": "Tarixçə yoxdur", "noHistory": "Tarixçə yoxdur",
"directDownloadDescription": "Təhlili keç və tapşırıqları dərhal yarat", "directDownloadDescription": "Təhlili keç və tapşırıqları dərhal yarat",
"taskProgress": "Tapşırığın irəliləyişi", "taskProgress": "Tapşırığın irəliləyişi",
+1 -1
View File
@@ -353,7 +353,7 @@
"resolvedFileCount": "{count}", "resolvedFileCount": "{count}",
"resourceHasNoFiles": "El recurs no té cap llista de fitxers per seleccionar", "resourceHasNoFiles": "El recurs no té cap llista de fitxers per seleccionar",
"noFiles": "Sense fitxers", "noFiles": "Sense fitxers",
"createHistory": "Crea un historial", "historyLinks": "Enllaços de l'historial",
"noHistory": "Sense historial", "noHistory": "Sense historial",
"directDownloadDescription": "Omet la resolució i crea les tasques immediatament", "directDownloadDescription": "Omet la resolució i crea les tasques immediatament",
"taskProgress": "Progrés de la tasca", "taskProgress": "Progrés de la tasca",
Loaded 50 of 74 files, more files were not shown because too many files have changed in this diff. Show more