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

@@ -0,0 +1,70 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:cutdex_ui/theme.dart';
import '../../l10n/l10n.dart';
import 'chat_controller.dart';
import 'chat_state.dart';
/// Streaming output observes its conversation independently of history/composer.
class AgentReplyRegion extends ConsumerWidget {
const AgentReplyRegion({
super.key,
required this.projectId,
this.conversationId,
this.draftKey,
});
final String? projectId;
final String? conversationId;
final String? draftKey;
@override
Widget build(BuildContext context, WidgetRef ref) {
if (projectId == null) return const SizedBox.shrink();
final provider =
chatControllerProvider(
projectId!,
conversationId: conversationId,
draftKey: draftKey,
).select(
(state) => (
state.busy,
state.partialResponse,
state.stopping,
state.activity,
),
);
final state = TickerMode.valuesOf(context).enabled
? ref.watch(provider)
: ref.read(provider);
if (!state.$1) return const SizedBox.shrink();
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (state.$2.isNotEmpty)
SelectionArea(
child: Text(
state.$2,
style: AppTheme.chatMessageTextStyle(context),
),
),
Text(
state.$3
? context.l10n.stopping
: switch (state.$4) {
AgentChatActivity.compacting => context.l10n.agentCompacting,
AgentChatActivity.editing => context.l10n.agentEditing,
AgentChatActivity.verifying => context.l10n.agentVerifying,
AgentChatActivity.replying => context.l10n.replying,
},
style: Theme.of(context).textTheme.bodySmall,
),
],
);
}
}
/// Stable chrome/history snapshot; each streamed token belongs to reply region.
ChatState chatChrome(ChatState state) =>
state.copyWith(partialResponse: '', activity: AgentChatActivity.replying);