diff --git a/src/renderer/features/artists/components/album-artist-list-content.tsx b/src/renderer/features/artists/components/album-artist-list-content.tsx index eb2a9a5a..dd2d24c9 100644 --- a/src/renderer/features/artists/components/album-artist-list-content.tsx +++ b/src/renderer/features/artists/components/album-artist-list-content.tsx @@ -214,6 +214,12 @@ export const AlbumArtistListContent = ({ gridRef, tableRef }: AlbumArtistListCon [page, setPage], ); + const handleGridSizeChange = () => { + if (page.table.autoFit) { + tableRef?.current?.api.sizeColumnsToFit(); + } + }; + const cardRows = useMemo(() => { const rows: CardRow[] = [ALBUMARTIST_CARD_ROWS.name]; @@ -296,6 +302,7 @@ export const AlbumArtistListContent = ({ gridRef, tableRef }: AlbumArtistListCon key={`table-${page.display}-${page.table.rowHeight}-${server?.id}`} ref={tableRef} alwaysShowHorizontalScroll + suppressRowDrag autoFitColumns={page.table.autoFit} columnDefs={columnDefs} getRowId={(data) => data.data.id} @@ -310,6 +317,7 @@ export const AlbumArtistListContent = ({ gridRef, tableRef }: AlbumArtistListCon onColumnMoved={handleTableColumnChange} onColumnResized={debouncedTableColumnChange} onGridReady={onTableReady} + onGridSizeChanged={handleGridSizeChange} onPaginationChanged={onTablePaginationChanged} onRowDoubleClicked={handleRowDoubleClick} /> diff --git a/src/renderer/features/artists/components/album-artist-list-header.tsx b/src/renderer/features/artists/components/album-artist-list-header.tsx index b8c21d0c..f65bd022 100644 --- a/src/renderer/features/artists/components/album-artist-list-header.tsx +++ b/src/renderer/features/artists/components/album-artist-list-header.tsx @@ -5,14 +5,7 @@ import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/li import { Flex, Group, Stack } from '@mantine/core'; import { useQueryClient } from '@tanstack/react-query'; import debounce from 'lodash/debounce'; -import { - RiArrowDownSLine, - RiFilter3Line, - RiFolder2Line, - RiMoreFill, - RiSortAsc, - RiSortDesc, -} from 'react-icons/ri'; +import { RiArrowDownSLine, RiFolder2Line, RiMoreFill, RiSortAsc, RiSortDesc } from 'react-icons/ri'; import styled from 'styled-components'; import { api } from '/@/renderer/api'; import { queryKeys } from '/@/renderer/api/query-keys'; @@ -23,7 +16,6 @@ import { DropdownMenu, MultiSelect, PageHeader, - Popover, SearchInput, Slider, Switch, @@ -294,6 +286,11 @@ export const AlbumArtistListHeader = ({ gridRef, tableRef }: AlbumArtistListHead } }; + const handleRefresh = useCallback(() => { + queryClient.invalidateQueries(queryKeys.albumArtists.list(server?.id || '')); + handleFilterChange(filters); + }, [filters, handleFilterChange, queryClient, server?.id]); + return ( @@ -460,24 +457,6 @@ export const AlbumArtistListHeader = ({ gridRef, tableRef }: AlbumArtistListHead )} - - - - - - {/* {server?.type === ServerType.NAVIDROME ? ( - - ) : ( - - )} */} - -