feat(workspace): refresh desktop editing experience and prepare 0.1.2
Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s

This commit is contained in:
lingjhf committed 2026-10-09 01:56:01 +08:00
1 parent aa5255d1e4
commit 2e0033ce2d
260 files changed
+43963 -5591

No files matched your search

+36 -20
View File
@@ -7,6 +7,7 @@ import '../../integrations/agent/agent_settings.dart';
import '../../integrations/agent/agent_models.dart';
import '../../l10n/l10n.dart';
import 'package:cutdex_ui/icons.dart';
import 'package:cutdex_ui/theme.dart';
import 'package:cutdex_ui/widgets.dart';
@@ -115,7 +116,10 @@ class _AgentSettingsPanelState extends ConsumerState<AgentSettingsPanel>
);
Widget _buildContent(BuildContext context) {
ref.watch(settingsOperationProvider('agent-save'));
ref.watch(
settingsOperationProvider('agent-save')
.select((value) => value.isLoading),
);
final settings = ref.watch(agentSettingsProvider);
return ScrollConfiguration(
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
@@ -144,12 +148,12 @@ class _AgentSettingsPanelState extends ConsumerState<AgentSettingsPanel>
: SettingsPageSection(
key: const Key('agent-provider-list'),
title: context.l10n.agentSettings,
icon: Icons.auto_awesome_outlined,
icon: AppIcons.assistant,
action: OutlinedButton.icon(
onPressed: settings.asData == null
? null
: () => _showProviderForm(true),
icon: const Icon(Icons.add),
icon: const Icon(AppIcons.add),
label: Text(context.l10n.agentAddProvider),
),
children: [
@@ -191,9 +195,9 @@ class _ProviderCard extends StatelessWidget {
final theme = Theme.of(context);
final colors = theme.colorScheme;
final icon = switch (provider.apiType) {
'anthropicMessages' => Icons.auto_awesome_outlined,
'openAiResponses' => Icons.bolt_outlined,
_ => Icons.forum_outlined,
'anthropicMessages' => AppIcons.assistant,
'openAiResponses' => AppIcons.lightning,
_ => AppIcons.conversations,
};
return Container(
padding: EdgeInsets.zero,
@@ -231,7 +235,7 @@ class _ProviderCard extends StatelessWidget {
key: ValueKey('agent-provider-edit-${provider.id}'),
tooltip: context.l10n.agentEditProvider,
onPressed: onEdit,
icon: const Icon(Icons.edit_outlined, size: AppIconSize.header),
icon: const Icon(AppIcons.edit, size: AppIconSize.header),
),
const SizedBox(width: 8),
AppSwitch(
@@ -247,7 +251,7 @@ class _ProviderCard extends StatelessWidget {
}
TextStyle _providerInputStyle(BuildContext context) =>
Theme.of(context).textTheme.bodyMedium!;
AppTheme.inputTextStyle(context);
InputDecoration _providerInputDecoration(
BuildContext context, {
@@ -341,7 +345,7 @@ class _ProviderEditorState extends State<_ProviderEditor> {
TextButton.icon(
key: const Key('agent-provider-back'),
onPressed: widget.saving ? null : widget.onBack,
icon: const Icon(Icons.arrow_back, size: 16),
icon: const Icon(AppIcons.arrowBack, size: 16),
label: Text(context.l10n.agentBackToProviders),
),
],
@@ -363,10 +367,11 @@ class _ProviderEditorState extends State<_ProviderEditor> {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: const Key('agent-provider-name'),
controller: _name,
@@ -403,10 +408,11 @@ class _ProviderEditorState extends State<_ProviderEditor> {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: const Key('agent-provider-base-url'),
controller: _baseUrl,
@@ -434,10 +440,11 @@ class _ProviderEditorState extends State<_ProviderEditor> {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: const Key('agent-provider-api-key'),
controller: _apiKey,
@@ -495,7 +502,7 @@ class _ProviderEditorState extends State<_ProviderEditor> {
onPressed: () => setState(
() => _models = [..._models, _ModelControllers()],
),
icon: const Icon(Icons.add, size: AppIconSize.header),
icon: const Icon(AppIcons.add, size: AppIconSize.header),
label: Text(context.l10n.agentAddModel),
),
),
@@ -610,9 +617,12 @@ class _ModelFields extends StatelessWidget {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)),
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: Key('agent-model-id-$index'),
controller: controllers.id,
decoration: _providerInputDecoration(
@@ -627,9 +637,12 @@ class _ModelFields extends StatelessWidget {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)),
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: Key('agent-model-context-$index'),
controller: controllers.contextWindow,
keyboardType: TextInputType.number,
@@ -642,9 +655,12 @@ class _ModelFields extends StatelessWidget {
child: TextFormField(
style: _providerInputStyle(context),
textAlignVertical: TextAlignVertical.center,
cursorHeight: 18,
cursorHeight: AppTheme.inputCursorHeight(context),
cursorWidth: 1.5,
strutStyle: StrutStyle.fromTextStyle(_providerInputStyle(context)),
strutStyle: StrutStyle.fromTextStyle(
_providerInputStyle(context),
forceStrutHeight: true,
),
key: Key('agent-model-output-$index'),
controller: controllers.maxOutputTokens,
keyboardType: TextInputType.number,
@@ -678,7 +694,7 @@ class _ModelFields extends StatelessWidget {
),
tooltip: context.l10n.agentDeleteModel,
onPressed: canDelete ? onDelete : null,
icon: const Icon(Icons.delete_outline, size: AppIconSize.header),
icon: const Icon(AppIcons.delete, size: AppIconSize.header),
),
);
return LayoutBuilder(