From 860cde19a31ca63b9941cacfaa4d2f93ee845f72 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Mon, 27 Jul 2026 11:48:19 +0300 Subject: [PATCH] Refactor GalleryPanel and GalleryBrowser for improved layout and functionality Updated the GalleryPanel component to ensure it occupies the full screen height, enhancing the user experience by preventing dual scrollbars. Modified the GalleryBrowser to support a new 'fill' prop, allowing it to adapt its layout based on the context, and adjusted the internal scrolling behavior accordingly. These changes improve the overall usability and visual consistency of the image gallery interface. --- .../features/admin/images/GalleryPanel.tsx | 13 +++++++++---- .../features/admin/images/ImageGallery.tsx | 19 +++++++++++++++---- .../src/features/admin/shows/ShowPicker.tsx | 9 ++++++++- frontend/src/shared/ui/popover.tsx | 4 +++- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/frontend/src/features/admin/images/GalleryPanel.tsx b/frontend/src/features/admin/images/GalleryPanel.tsx index 50e09db..c3f8e18 100644 --- a/frontend/src/features/admin/images/GalleryPanel.tsx +++ b/frontend/src/features/admin/images/GalleryPanel.tsx @@ -1,14 +1,19 @@ import { useTranslation } from 'react-i18next' import { GalleryBrowser } from './ImageGallery' -/** Отдельная страница «Галерея»: просмотр/загрузка/удаление всех изображений приложения. */ +/** + * Отдельная страница «Галерея»: просмотр/загрузка/удаление всех изображений приложения. + * + * Страница занимает экран целиком и сама не прокручивается: списка на сотни картинок здесь нет + * пагинации, и две полосы прокрутки — внешняя и внутри сетки — мешали бы друг другу. + */ export function GalleryPanel() { const { t } = useTranslation() return ( -
+

{t('admin.gallery.title')}

-
- +
+
) diff --git a/frontend/src/features/admin/images/ImageGallery.tsx b/frontend/src/features/admin/images/ImageGallery.tsx index c472714..302776f 100644 --- a/frontend/src/features/admin/images/ImageGallery.tsx +++ b/frontend/src/features/admin/images/ImageGallery.tsx @@ -8,6 +8,7 @@ import { useApiError } from '@/shared/lib/use-api-error' import { Button } from '@/shared/ui/button' import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/shared/ui/dialog' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/shared/ui/select' +import { cn } from '@/shared/lib/cn' import { deleteImage, imageUrl, listImages, uploadImage } from './api' const CATEGORIES: ImageCategory[] = ['Library', 'ShowPoster', 'EpisodeStill', 'BumperBackground'] @@ -25,10 +26,13 @@ export function GalleryBrowser({ category = 'Library', onSelect, onClose, + fill = false, }: Readonly<{ category?: ImageCategory onSelect?: (image: ImagePick) => void onClose?: () => void + /** Занять экран целиком: на отдельной странице прокрутка должна быть одна — внутри сетки. */ + fill?: boolean }>) { const { t } = useTranslation() const queryClient = useQueryClient() @@ -86,7 +90,7 @@ export function GalleryBrowser({ }) return ( - <> +
{CATEGORIES.map((c) => (