feat(chat): files upload over HTTP before the prompt, up to 100 MiB each

This commit is contained in:
2026-10-23 21:25:41 +01:00
parent 39a68a00b3
commit e507f554c3
17 changed files with 634 additions and 74 deletions
@@ -50,7 +50,11 @@ ChatPickedFile _file(
String name,
List<int> bytes, {
String mime = 'text/plain',
}) => ChatPickedFile(name: name, mime: mime, bytes: Uint8List.fromList(bytes));
}) => ChatPickedFile(
name: name,
mime: mime,
bytes: bytes is Uint8List ? bytes : Uint8List.fromList(bytes),
);
Finder get _field => find.byKey(const Key('chat-composer-field'));
@@ -159,7 +163,7 @@ void main() {
fake.paste([
_file(
'huge.bin',
List<int>.filled(ChatAttachmentDraft.maxTotalBytes + 1, 0),
Uint8List(ChatAttachmentDraft.maxTotalBytes + 1),
mime: 'application/octet-stream',
),
]);
@@ -184,7 +188,7 @@ void main() {
_file('kept.txt', [1]),
_file(
'huge.bin',
List<int>.filled(ChatAttachmentDraft.maxTotalBytes, 0),
Uint8List(ChatAttachmentDraft.maxTotalBytes),
mime: 'application/octet-stream',
),
]);