Show message delivery state and keep unsent messages across reloads
A sent message is stored on the device until the server accepts it, so a reload mid-request no longer loses it: on reopening, a stored intent the history records is cleared as sent, otherwise it shows as Not sent with Retry (same operation id) and Edit. The operator's bubble shows Sending, Sent (newest only), Queued or Not sent. A live refusal keeps the old contract (exact draft and chips back in the composer, unchanged re-send reuses the id) and marks the bubble Not sent with Retry. On web, leaving or reloading the page while a prompt is in flight asks first.
This commit is contained in:
@@ -1104,8 +1104,11 @@ class _ChatThreadViewState extends State<ChatThreadView> {
|
||||
: null,
|
||||
// Attachment bytes cannot go back into the composer's chips, so an
|
||||
// intent with files is discarded rather than silently trimmed.
|
||||
// Its text already back in the composer needs no Edit.
|
||||
editLabel: send.attachments.isEmpty ? 'Edit' : 'Discard',
|
||||
onEdit: send.attachments.isEmpty
|
||||
onEdit: composer.isInComposer(send.operationId)
|
||||
? null
|
||||
: send.attachments.isEmpty
|
||||
? () => unawaited(composer.edit(send.operationId))
|
||||
: () => composer.discard(send.operationId),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user