diff --git a/packages/frontend/src/components/MkDriveFileThumbnail.vue b/packages/frontend/src/components/MkDriveFileThumbnail.vue
index 2f1fef4ea6..a2bf68691d 100644
--- a/packages/frontend/src/components/MkDriveFileThumbnail.vue
+++ b/packages/frontend/src/components/MkDriveFileThumbnail.vue
@@ -5,17 +5,25 @@ SPDX-License-Identifier: AGPL-3.0-only
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -56,6 +64,20 @@ const isThumbnailAvailable = computed(() => {
? (is.value === 'image' as const || is.value === 'video')
: false;
});
+
+const getTrimmedAltText = () => {
+ if (props.file.comment == null) {
+ return '';
+ }
+ const maxCharacters = 40;
+
+ const alt = props.file.comment as unknown as string;
+ if (alt.length > maxCharacters) {
+ return alt.substring(0, maxCharacters) + '...';
+ }
+
+ return alt;
+};