feat(playlist): scoped header search on Playlists browse (#1308)

This commit is contained in:
cucadmuh
2026-07-16 04:30:41 +03:00
committed by GitHub
parent fa1dc1a328
commit 16aee64d66
42 changed files with 210 additions and 22 deletions
@@ -16,6 +16,9 @@ describe('syncLiveSearchRouteScope', () => {
syncLiveSearchRouteScope('/composers');
expect(useLiveSearchScopeStore.getState().scope).toBe('composers');
syncLiveSearchRouteScope('/playlists');
expect(useLiveSearchScopeStore.getState().scope).toBe('playlists');
});
it('clears scope and query when leaving browse routes', () => {
@@ -27,6 +30,15 @@ describe('syncLiveSearchRouteScope', () => {
expect(useLiveSearchScopeStore.getState().query).toBe('');
});
it('clears scope when entering playlist detail', () => {
useLiveSearchScopeStore.setState({ query: 'road', scope: 'playlists' });
syncLiveSearchRouteScope('/playlists/abc123');
expect(useLiveSearchScopeStore.getState().scope).toBeNull();
expect(useLiveSearchScopeStore.getState().query).toBe('');
});
it('clears query when leaving browse with scope already cleared (ghost mode)', () => {
useLiveSearchScopeStore.setState({ query: 'beatles', scope: null });