From e010c9237ff691a1c311abcb787b786fd381c223 Mon Sep 17 00:00:00 2001 From: osa Date: Mon, 1 Jun 2026 16:26:51 +0100 Subject: [PATCH 01/12] =?UTF-8?q?Gallery:=20componentize=20grid=20tiles=20?= =?UTF-8?q?(4=20desktop=20/=202=20mobile)=20=E2=80=94=20rounded=20chrome?= =?UTF-8?q?=20for=20all=20media=20(#473)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(gallery): componentize grid tiles with rounded media chrome * feat(gallery): add hover overlay prompting detail view * give tiles consistent hit areas * galleryNoMedia i18n --------- Co-authored-by: Cursor --- components/GalleryView.vue | 52 +++---- components/gallery/GalleryGrid.vue | 7 + components/gallery/GalleryTile.vue | 70 +++++++++ components/shared/MediaFile.vue | 100 ++++++++++-- i18n/locales/en.json | 1 + i18n/locales/es.json | 1 + i18n/locales/nl.json | 1 + i18n/locales/pt.json | 1 + i18n/locales/sw.json | 1 + i18n/locales/th.json | 1 + tests/unit/components/GalleryView.test.ts | 39 ++++- .../components/gallery/GalleryGrid.test.ts | 19 +++ .../components/gallery/GalleryTile.test.ts | 144 ++++++++++++++++++ .../gallery/MediaFile.gallery.test.ts | 82 ++++++++++ 14 files changed, 467 insertions(+), 52 deletions(-) create mode 100644 components/gallery/GalleryGrid.vue create mode 100644 components/gallery/GalleryTile.vue create mode 100644 tests/unit/components/gallery/GalleryGrid.test.ts create mode 100644 tests/unit/components/gallery/GalleryTile.test.ts create mode 100644 tests/unit/components/gallery/MediaFile.gallery.test.ts diff --git a/components/GalleryView.vue b/components/GalleryView.vue index 7872424a..564ae541 100644 --- a/components/GalleryView.vue +++ b/components/GalleryView.vue @@ -5,13 +5,12 @@ import { normalizeFilterValues, useTimestampFilter, } from "@/composables/useDateAndCategoryFilter"; -import { prepareCoordinatesForSelectedFeature } from "@/utils/mapGLHelpers"; import { useRecordCache } from "@/composables/useRecordCache"; -import { transformSurveyEntry } from "@/utils/dataTransformers"; import DataFilter from "@/components/shared/DataFilter.vue"; import TimestampFilter from "@/components/shared/TimestampFilter.vue"; -import DataFeature from "@/components/shared/DataFeature.vue"; +import GalleryGrid from "@/components/gallery/GalleryGrid.vue"; +import GalleryTile from "@/components/gallery/GalleryTile.vue"; import EmptyStateIllustration from "@/components/shared/EmptyStateIllustration.vue"; import { useI18n } from "vue-i18n"; @@ -143,15 +142,12 @@ const getFullRecord = (minimalItem: DataEntry): DataEntry => { return getCachedRecord(props.table, id) ?? minimalItem; }; -/** Transform raw record for display and prepare coordinates for selected feature */ -const prepareForDisplay = (feature: DataEntry): DataEntry => { - const transformed = transformSurveyEntry(feature); - if (transformed.geocoordinates) { - transformed.geocoordinates = prepareCoordinatesForSelectedFeature( - transformed.geocoordinates, - ); - } - return transformed; +const getRecordFilePaths = (feature: DataEntry): string[] => { + return getFilePathsWithExtension( + feature, + props.allowedFileExtensions, + props.mediaColumn, + ); }; @@ -159,11 +155,11 @@ const prepareForDisplay = (feature: DataEntry): DataEntry => {