From cc5460ea55ad8018a126ab368c3d8fae790e213a Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 25 Oct 2025 23:40:54 +0800 Subject: [PATCH] :bug: Fix thought seq id didn't update --- lib/screens/thought/think.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/screens/thought/think.dart b/lib/screens/thought/think.dart index 9c1c9b4a..3d907508 100644 --- a/lib/screens/thought/think.dart +++ b/lib/screens/thought/think.dart @@ -194,8 +194,19 @@ class ThoughtScreen extends HookConsumerWidget { // Update current topic currentTopic.value = topic; + + // Update selected sequence ID to provide context for AI + if (selectedSequenceId.value != aiThought.sequenceId) { + selectedSequenceId.value = aiThought.sequenceId; + } } else { localThoughts.value = [aiThought, ...localThoughts.value]; + + // Update selected sequence ID if it was null (new conversation) + if (selectedSequenceId.value == null && + aiThought.sequenceId.isNotEmpty) { + selectedSequenceId.value = aiThought.sequenceId; + } } } catch (e) { showErrorAlert('Failed to parse AI response'); @@ -248,9 +259,7 @@ class ThoughtScreen extends HookConsumerWidget { ), const Gap(8), Text( - thought.role == ThinkingThoughtRole.assistant - ? 'AI Assistant' - : 'You', + thought.role == ThinkingThoughtRole.assistant ? 'SN 酱' : '您', style: Theme.of(context).textTheme.titleSmall, ), ],