From 2d7374de9e4b4b2ce075d1c8a639181b2c1c011a Mon Sep 17 00:00:00 2001 From: Neraste Date: Sun, 26 Jul 2026 20:13:35 +0200 Subject: [PATCH 1/3] Remove expanded and reorder when leaving page with paginator --- src/components/generics/Navigator.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/generics/Navigator.jsx b/src/components/generics/Navigator.jsx index 6051f264..afc88ef6 100644 --- a/src/components/generics/Navigator.jsx +++ b/src/components/generics/Navigator.jsx @@ -15,6 +15,10 @@ function PaginatorLink({ page, icon, disabled }) { const [searchParams, _] = useSearchParams() searchParams.set('page', page) + // delete any known unwanted parameter when changing page + searchParams.delete('expanded') + searchParams.delete('reorder') + return ( Date: Sun, 26 Jul 2026 20:19:19 +0200 Subject: [PATCH 2/3] Make the fix more generic Fixes #274. --- src/components/generics/Navigator.jsx | 20 +++++++++++++------ src/components/library/song/List.jsx | 1 + src/components/playlist/played/List.jsx | 1 + src/components/playlist/playerErrors/List.jsx | 1 + src/components/playlist/queuing/List.jsx | 1 + 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/components/generics/Navigator.jsx b/src/components/generics/Navigator.jsx index afc88ef6..fb020bd8 100644 --- a/src/components/generics/Navigator.jsx +++ b/src/components/generics/Navigator.jsx @@ -11,13 +11,16 @@ const paginationType = PropTypes.shape({ last: PropTypes.number.isRequired, }) -function PaginatorLink({ page, icon, disabled }) { +function PaginatorLink({ page, icon, disabled, cleanupParams }) { const [searchParams, _] = useSearchParams() searchParams.set('page', page) // delete any known unwanted parameter when changing page - searchParams.delete('expanded') - searchParams.delete('reorder') + if (cleanupParams) { + cleanupParams.forEach((param) => { + searchParams.delete(param) + }) + } return ( ) @@ -91,10 +99,10 @@ Counter.propTypes = { count: PropTypes.number.isRequired, } -export default function Navigator({ count, names, pagination }) { +export default function Navigator({ count, names, pagination, ...rest }) { return (
- {pagination && } + {pagination && } {names && count >= 0 && }
) diff --git a/src/components/library/song/List.jsx b/src/components/library/song/List.jsx index 6cf97758..c41df7b6 100644 --- a/src/components/library/song/List.jsx +++ b/src/components/library/song/List.jsx @@ -79,6 +79,7 @@ export default function SongList() { singular: 'song', plural: 'songs', }} + cleanupParams={['expanded']} /> ) diff --git a/src/components/playlist/played/List.jsx b/src/components/playlist/played/List.jsx index 1abfeb57..582ccb65 100644 --- a/src/components/playlist/played/List.jsx +++ b/src/components/playlist/played/List.jsx @@ -67,6 +67,7 @@ export default function PlayedList() { singular: 'entry', plural: 'entries', }} + cleanupParams={['expanded']} /> ) diff --git a/src/components/playlist/playerErrors/List.jsx b/src/components/playlist/playerErrors/List.jsx index 94006b42..5c22be92 100644 --- a/src/components/playlist/playerErrors/List.jsx +++ b/src/components/playlist/playerErrors/List.jsx @@ -67,6 +67,7 @@ export default function PlayerErrorsList() { singular: 'error', plural: 'errors', }} + cleanupParams={['expanded']} /> ) diff --git a/src/components/playlist/queuing/List.jsx b/src/components/playlist/queuing/List.jsx index 267cc1c6..64643d18 100644 --- a/src/components/playlist/queuing/List.jsx +++ b/src/components/playlist/queuing/List.jsx @@ -95,6 +95,7 @@ export default function QueuingList() { singular: 'entry', plural: 'entries', }} + cleanupParams={['expanded', 'reorder']} /> ) From a2b9f23eacfef2433b21d141f72ebc92dc32ed1a Mon Sep 17 00:00:00 2001 From: Neraste Date: Sat, 1 Aug 2026 18:21:33 +0200 Subject: [PATCH 3/3] Rename cleanupParams to paramsToCleanup --- src/components/generics/Navigator.jsx | 8 ++++---- src/components/library/song/List.jsx | 2 +- src/components/playlist/played/List.jsx | 2 +- src/components/playlist/playerErrors/List.jsx | 2 +- src/components/playlist/queuing/List.jsx | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/generics/Navigator.jsx b/src/components/generics/Navigator.jsx index fb020bd8..2c629c09 100644 --- a/src/components/generics/Navigator.jsx +++ b/src/components/generics/Navigator.jsx @@ -11,13 +11,13 @@ const paginationType = PropTypes.shape({ last: PropTypes.number.isRequired, }) -function PaginatorLink({ page, icon, disabled, cleanupParams }) { +function PaginatorLink({ page, icon, disabled, paramsToCleanup }) { const [searchParams, _] = useSearchParams() searchParams.set('page', page) // delete any known unwanted parameter when changing page - if (cleanupParams) { - cleanupParams.forEach((param) => { + if (paramsToCleanup) { + paramsToCleanup.forEach((param) => { searchParams.delete(param) }) } @@ -40,7 +40,7 @@ PaginatorLink.propTypes = { page: PropTypes.number.isRequired, icon: PropTypes.string.isRequired, disabled: PropTypes.bool, - cleanupParams: PropTypes.arrayOf(PropTypes.string), + paramsToCleanup: PropTypes.arrayOf(PropTypes.string), } function Paginator({ pagination, ...rest }) { diff --git a/src/components/library/song/List.jsx b/src/components/library/song/List.jsx index c41df7b6..497a4f29 100644 --- a/src/components/library/song/List.jsx +++ b/src/components/library/song/List.jsx @@ -79,7 +79,7 @@ export default function SongList() { singular: 'song', plural: 'songs', }} - cleanupParams={['expanded']} + paramsToCleanup={['expanded']} /> ) diff --git a/src/components/playlist/played/List.jsx b/src/components/playlist/played/List.jsx index 582ccb65..466374b6 100644 --- a/src/components/playlist/played/List.jsx +++ b/src/components/playlist/played/List.jsx @@ -67,7 +67,7 @@ export default function PlayedList() { singular: 'entry', plural: 'entries', }} - cleanupParams={['expanded']} + paramsToCleanup={['expanded']} /> ) diff --git a/src/components/playlist/playerErrors/List.jsx b/src/components/playlist/playerErrors/List.jsx index 5c22be92..45dd925a 100644 --- a/src/components/playlist/playerErrors/List.jsx +++ b/src/components/playlist/playerErrors/List.jsx @@ -67,7 +67,7 @@ export default function PlayerErrorsList() { singular: 'error', plural: 'errors', }} - cleanupParams={['expanded']} + paramsToCleanup={['expanded']} /> ) diff --git a/src/components/playlist/queuing/List.jsx b/src/components/playlist/queuing/List.jsx index 64643d18..13a46bdd 100644 --- a/src/components/playlist/queuing/List.jsx +++ b/src/components/playlist/queuing/List.jsx @@ -95,7 +95,7 @@ export default function QueuingList() { singular: 'entry', plural: 'entries', }} - cleanupParams={['expanded', 'reorder']} + paramsToCleanup={['expanded', 'reorder']} /> )