From fa34201bc07e5312ff0c6825933cd02ce7900254 Mon Sep 17 00:00:00 2001
From: Matthias Nott <mnott@mnsoft.org>
Date: Sat, 21 Mar 2026 20:55:10 +0100
Subject: [PATCH] fix: voice caption ordering, background audio, image persistence

---
 lib/models/message.dart |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/lib/models/message.dart b/lib/models/message.dart
index 002788b..6ea436b 100644
--- a/lib/models/message.dart
+++ b/lib/models/message.dart
@@ -114,7 +114,7 @@
     };
   }
 
-  /// Lightweight JSON for persistence (strips heavy binary fields).
+  /// Lightweight JSON for persistence (strips temp audio paths, keeps images).
   Map<String, dynamic> toJsonLight() {
     return {
       'id': id,
@@ -124,6 +124,9 @@
       'timestamp': timestamp,
       if (status != null) 'status': status!.name,
       if (duration != null) 'duration': duration,
+      // Keep imageBase64 — images are typically 50-200 KB and must survive restart.
+      // audioUri is intentionally omitted: it is a temp file path that won't survive restart.
+      if (imageBase64 != null) 'imageBase64': imageBase64,
     };
   }
 

--
Gitblit v1.3.1