Matthias Nott
2026-03-24 780b013d20135df02c744c90cb9b0fc903c1a6c6
lib/screens/chat_screen.dart
....@@ -1017,34 +1017,25 @@
10171017 <String, dynamic>{'data': b64, 'mimeType': 'image/jpeg'}
10181018 ).toList();
10191019
1020
- // Create voice bubble first to get messageId for transcript reflection
1021
- String? voiceMessageId;
1022
- if (voiceB64 != null) {
1023
- final voiceMsg = Message.voice(
1024
- role: MessageRole.user,
1025
- audioUri: caption.substring('__voice__:'.length),
1026
- status: MessageStatus.sent,
1027
- );
1028
- voiceMessageId = voiceMsg.id;
1029
- ref.read(messagesProvider.notifier).addMessage(voiceMsg);
1030
- }
1031
-
10321020 // Send everything as a single atomic bundle
10331021 _ws?.send({
10341022 'type': 'bundle',
10351023 'caption': textCaption,
10361024 if (voiceB64 != null) 'audioBase64': voiceB64,
1037
- if (voiceMessageId != null) 'voiceMessageId': voiceMessageId,
10381025 'attachments': attachments,
10391026 'sessionId': targetSessionId,
10401027 });
10411028
1042
- // Show images in chat locally
1029
+ // Show as combined image+caption bubbles (voice caption shows as text under image)
1030
+ final voiceLabel = voiceB64 != null ? '🎤 Voice caption' : '';
10431031 for (var i = 0; i < encodedImages.length; i++) {
1032
+ final captionText = i == 0
1033
+ ? (textCaption.isNotEmpty ? textCaption : voiceLabel)
1034
+ : '';
10441035 final message = Message.image(
10451036 role: MessageRole.user,
10461037 imageBase64: encodedImages[i],
1047
- content: i == 0 ? textCaption : '',
1038
+ content: captionText,
10481039 status: MessageStatus.sent,
10491040 );
10501041 ref.read(messagesProvider.notifier).addMessage(message);