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:
2026-10-31 20:03:29 +00:00
parent 4bc99f490b
commit 8d147ac83b
6 changed files with 134 additions and 38 deletions
@@ -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),
),