]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ui: media attachments before text (#23467)
authorSaba Fallah <redacted>
Mon, 25 May 2026 06:50:41 +0000 (08:50 +0200)
committerGitHub <redacted>
Mon, 25 May 2026 06:50:41 +0000 (08:50 +0200)
* ui: media attachments before text

* fix prettier formatting

tools/ui/src/lib/constants/image-size.ts
tools/ui/src/lib/services/chat.service.ts
tools/ui/src/lib/utils/cap-img-size.ts

index 0d0c4e48434e3024a0d4bb090ff6ec83b3625c5d..bcc1da08b1936719c9e3dd34cd495a410d486fcc 100644 (file)
@@ -1 +1 @@
-export const MEGAPIXELS_TO_PIXELS = 1_000_000;
\ No newline at end of file
+export const MEGAPIXELS_TO_PIXELS = 1_000_000;
index 5b7b7e8229d68469928b058d9e6ebb31ae3834b3..3c9ca74796d401b972cc4bba60f592b8e256e870 100644 (file)
@@ -879,14 +879,6 @@ export class ChatService {
                        });
                }
 
-               if (message.content) {
-                       contentParts.push({
-                               type: ContentPartType.TEXT,
-                               text: message.content
-                       });
-               }
-
-               // Include images from all messages
                const imageFiles = message.extra.filter(
                        (extra: DatabaseMessageExtra): extra is DatabaseMessageExtraImageFile =>
                                extra.type === AttachmentType.IMAGE
@@ -919,6 +911,13 @@ export class ChatService {
                        });
                }
 
+               if (message.content) {
+                       contentParts.push({
+                               type: ContentPartType.TEXT,
+                               text: message.content
+                       });
+               }
+
                const videoFiles = message.extra.filter(
                        (extra: DatabaseMessageExtra): extra is DatabaseMessageExtraVideoFile =>
                                extra.type === AttachmentType.VIDEO
index fa2af53f6fd77b42b800d732d76e516c11c46e0b..1ba218316b7af676df811c3ec4c71114b0f09b3b 100644 (file)
@@ -14,9 +14,8 @@ export function capImageDataURLSize(
 ): Promise<string> {
        return new Promise((resolve, reject) => {
                try {
-                       
                        const mimeMatch = base64UrlImage.match(BASE64_IMAGE_URI_REGEX);
-                       
+
                        if (!mimeMatch) {
                                return reject(new Error('Invalid data URL format.'));
                        }