From bfa87d31ea6bf32fa313779cd3f8c5a0381d5c66 Mon Sep 17 00:00:00 2001
From: Gavin Suntop <206379+gvn@users.noreply.github.com>
Date: Mon, 6 Nov 2023 10:13:18 -0800
Subject: [PATCH 1/2] feat: Image upload improvements [MOSOWEB-25]
---
components/publish/PublishAttachment.vue | 48 ++++++++++++++++++++----
components/status/StatusAttachment.vue | 9 +++--
locales/en.json | 11 +++++-
3 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/components/publish/PublishAttachment.vue b/components/publish/PublishAttachment.vue
index bce12be173..d6e317a4eb 100644
--- a/components/publish/PublishAttachment.vue
+++ b/components/publish/PublishAttachment.vue
@@ -41,8 +41,8 @@ function toggleApply() {
-
+
{{ $t('attachment.edit_title') }}
+
+
+ {{ $t('attachment.alt-text-p-1') }}
+
+
+ {{ $t('attachment.alt-text-p-2') }}
+
+
+ - {{ $t('attachment.alt-point-1') }}
+ - {{ $t('attachment.alt-point-2') }}
+ - {{ $t('attachment.alt-point-3') }}
+ - {{ $t('attachment.alt-point-4') }}
+ - {{ $t('attachment.alt-point-5') }}
+
+
-
+
-
+
{{ $t('action.apply') }}
-
- {{ $t('action.close') }}
-
+
+
diff --git a/components/status/StatusAttachment.vue b/components/status/StatusAttachment.vue
index 39c56f4ac8..2abd74f008 100644
--- a/components/status/StatusAttachment.vue
+++ b/components/status/StatusAttachment.vue
@@ -118,7 +118,7 @@ watch(shouldLoadAttachment, () => {
-
+
{
focus:outline-none
focus:ring="2 primary inset"
rounded-lg
- h-full
w-full
aria-label="Open image preview dialog"
relative
@@ -227,9 +226,8 @@ watch(shouldLoadAttachment, () => {
}"
:should-load-image="shouldLoadAttachment"
rounded-lg
- h-full
w-full
- object-cover
+ object-contain
:draggable="shouldLoadAttachment"
:class="!shouldLoadAttachment ? 'brightness-60 hover:brightness-70 transition-filter' : ''"
/>
@@ -285,4 +283,7 @@ watch(shouldLoadAttachment, () => {
top: 50%;
translate: -50% -50%;
}
+.status-attachment-image {
+ border-radius: 16px;
+}
diff --git a/locales/en.json b/locales/en.json
index 91a891886c..a80faa99be 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -57,6 +57,7 @@
"view_other_following": "Following from other instances may not be displayed."
},
"action": {
+ "altplus": "+ Alt",
"apply": "Apply",
"bookmark": "Bookmark",
"bookmarked": "Bookmarked",
@@ -93,7 +94,15 @@
"app_logo": "Mozilla Logo",
"app_name": "Mozilla Social",
"attachment": {
- "edit_title": "Description",
+ "add_image_description": "Add image description",
+ "alt-point-1": "Capture important elements",
+ "alt-point-2": "Summarize text in images",
+ "alt-point-3": "Use regular sentence structure",
+ "alt-point-4": "Avoid redundant information",
+ "alt-point-5": "Focus on trends and key findings in complex visuals (like diagrams or maps)",
+ "alt-text-p-1": "Alt text provides image descriptions for people with vision impairments, low bandwidth connections, or those seeking extra context.",
+ "alt-text-p-2": "You can improve accessibility and understanding for everyone by writing clear, concise, and objective alt text.",
+ "edit_title": "Add alt text",
"remove_label": "Remove attachment"
},
"command": {
From 5575995992c58cff59925579020c47c68be4aecf Mon Sep 17 00:00:00 2001
From: Anthony Liddle
Date: Tue, 7 Nov 2023 15:53:57 -0800
Subject: [PATCH 2/2] fix(recs): update recommendation endpoint for images
---
server/api/[server]/recommendations.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/server/api/[server]/recommendations.ts b/server/api/[server]/recommendations.ts
index 25744a3d25..5c3ef4180b 100644
--- a/server/api/[server]/recommendations.ts
+++ b/server/api/[server]/recommendations.ts
@@ -3,7 +3,7 @@ export default defineEventHandler(async (event) => {
const { locale } = getQuery(event)
const recommendations = await fetch(
- `https://mozilla.social/content-feed/moso/v1/discover?locale=${locale}&image_sizes=268x`,
+ `https://mozilla.social/content-feed/moso/v1/discover?locale=${locale}&image_sizes[]=268x`,
)
.then(response => response.json())
.then(response => response.data)