Refactor GalleryPanel and GalleryBrowser for improved layout and functionality
ci / build-backend (push) Successful in 2m54s
ci / build-frontend (push) Failing after 24s
ci / tests (push) Skipped
ci / sonar (push) Skipped

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.
This commit is contained in:
Leonid Pershin
2026-07-27 11:48:19 +03:00
parent 61f934d19f
commit 860cde19a3
4 changed files with 35 additions and 10 deletions
@@ -44,6 +44,7 @@ export function ShowPicker({
const [query, setQuery] = useState('')
const [active, setActive] = useState(0)
const listRef = useRef<HTMLDivElement>(null)
const searchRef = useRef<HTMLInputElement>(null)
const trimmed = query.trim()
const matches = useMemo(() => {
@@ -133,9 +134,15 @@ export function ShowPicker({
<PopoverContent
className="w-[var(--radix-popover-trigger-width)] min-w-64 p-1"
onKeyDown={onKeyDown}
onOpenAutoFocus={(event) => {
// Фокус наводим сами: внутри диалога за него борются две фокус-ловушки, и по умолчанию
// он оседает на самом поповере — строка поиска остаётся мёртвой.
event.preventDefault()
requestAnimationFrame(() => searchRef.current?.focus())
}}
>
<Input
autoFocus
ref={searchRef}
className="h-8"
placeholder={t('admin.shows.pickerSearch')}
value={query}