refactor: action buttons and scroll to bottom ui/ux

This commit is contained in:
cogwheel0
2025-09-02 20:43:57 +05:30
parent ad4a0cc340
commit 3c082ffc9e
11 changed files with 241 additions and 137 deletions

View File

@@ -115,7 +115,19 @@ abstract class OutboundTask with _$OutboundTask {
factory OutboundTask.fromJson(Map<String, dynamic> json) =>
_$OutboundTaskFromJson(json);
String get threadKey => (conversationId == null || conversationId!.isEmpty)
? 'new'
: conversationId!;
// Provide a unified nullable conversationId across variants
String? get maybeConversationId => map(
sendTextMessage: (t) => t.conversationId,
uploadMedia: (t) => t.conversationId,
executeToolCall: (t) => t.conversationId,
generateImage: (t) => t.conversationId,
saveConversation: (t) => t.conversationId,
generateTitle: (t) => t.conversationId,
imageToDataUrl: (t) => t.conversationId,
);
String get threadKey =>
(maybeConversationId == null || maybeConversationId!.isEmpty)
? 'new'
: maybeConversationId!;
}