WIP: message delivery status and refresh safety; fix reconcile listener recursion
The transcript listener read the lazily built _controller while _attach was still building it (load() notifies synchronously), so it built another controller, recursively, until the test process ran out of memory.
This commit is contained in:
@@ -36,7 +36,8 @@ class ChatMessageView extends StatelessWidget {
|
||||
|
||||
static final ChatAttachmentImages _inlineImages = ChatAttachmentImages(null);
|
||||
|
||||
/// The turn's settled permissions, independent of passive activity details.
|
||||
/// Beneath the turn: an agent turn's settled permissions, or the delivery
|
||||
/// line under the operator's own message.
|
||||
final List<Widget> footer;
|
||||
|
||||
@override
|
||||
@@ -103,27 +104,40 @@ class ChatMessageView extends StatelessWidget {
|
||||
: row;
|
||||
|
||||
/// Attached images sit above the operator's bubble, as their own thumbnails;
|
||||
/// an images-only turn draws no empty bubble.
|
||||
/// an images-only turn draws no empty bubble. The footer (the delivery line)
|
||||
/// sits under the bubble's trailing corner.
|
||||
Widget _userTurn(bool cupertino, List<Widget> content, Widget body) {
|
||||
final thumbnails = [
|
||||
for (final part in _partsOf(_userMessage))
|
||||
if (_isFile(part) && chatPartIsThumbnail(part)) part,
|
||||
];
|
||||
if (thumbnails.isEmpty) {
|
||||
if (thumbnails.isEmpty && footer.isEmpty) {
|
||||
return ChatUserBubble(cupertino: cupertino, child: body);
|
||||
}
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
ChatAttachmentGallery(
|
||||
parts: thumbnails,
|
||||
images: images ?? _inlineImages,
|
||||
cupertino: cupertino,
|
||||
),
|
||||
if (content.isNotEmpty) const SizedBox(height: 6),
|
||||
if (content.isNotEmpty)
|
||||
if (thumbnails.isNotEmpty)
|
||||
ChatAttachmentGallery(
|
||||
parts: thumbnails,
|
||||
images: images ?? _inlineImages,
|
||||
cupertino: cupertino,
|
||||
),
|
||||
if (thumbnails.isNotEmpty && content.isNotEmpty)
|
||||
const SizedBox(height: 6),
|
||||
if (content.isNotEmpty || thumbnails.isEmpty)
|
||||
ChatUserBubble(cupertino: cupertino, child: body),
|
||||
if (footer.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
Wrap(
|
||||
key: const Key('chat-message-footer'),
|
||||
spacing: 8,
|
||||
alignment: WrapAlignment.end,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: footer,
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user