mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(search): co-locate tracks song-browse cluster (SongRow/PagedSongList/SongBrowseSection/TracksPageChrome/useSongBrowseList) into features/search
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
|
||||
import React, { useRef } from 'react';
|
||||
import SongRow, { SongListHeader } from './SongRow';
|
||||
import { useInpageScrollSentinel } from '../hooks/useInpageScrollSentinel';
|
||||
import SongRow, { SongListHeader } from '@/features/search/components/SongRow';
|
||||
import { useInpageScrollSentinel } from '@/hooks/useInpageScrollSentinel';
|
||||
import InpageScrollSentinel from '@/ui/InpageScrollSentinel';
|
||||
|
||||
interface Props {
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import PagedSongList from '../PagedSongList';
|
||||
import PagedSongList from '@/features/search/components/PagedSongList';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
+3
-3
@@ -1,16 +1,16 @@
|
||||
import { AlbumCoverArtImage } from '../../cover/AlbumCoverArtImage';
|
||||
import { AlbumCoverArtImage } from '@/cover/AlbumCoverArtImage';
|
||||
import { getRandomSongs } from '@/lib/api/subsonicLibrary';
|
||||
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
|
||||
import { songToTrack } from '@/lib/media/songToTrack';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Play, ListPlus, RefreshCw, Sparkles } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { usePlayerStore } from '@/features/playback/store/playerStore';
|
||||
import { SongRail } from '@/features/home';
|
||||
import { playSongNow } from '@/features/playback/utils/playback/playSong';
|
||||
import { ndListSongs, ndInvalidateSongsCache } from '@/lib/api/navidromeBrowse';
|
||||
import { usePerfProbeFlags } from '../../utils/perf/perfFlags';
|
||||
import { usePerfProbeFlags } from '@/utils/perf/perfFlags';
|
||||
import { useNavigateToAlbum } from '@/features/album';
|
||||
import { useNavigateToArtist } from '@/features/artist';
|
||||
import { OpenArtistRefInline } from '@/features/artist';
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { useSongBrowseList } from '../hooks/useSongBrowseList';
|
||||
import SongBrowseSection from './tracks/SongBrowseSection';
|
||||
import { useSongBrowseList } from '@/features/search/hooks/useSongBrowseList';
|
||||
import SongBrowseSection from '@/features/search/components/SongBrowseSection';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
+3
-3
@@ -2,9 +2,9 @@
|
||||
import { renderHook, waitFor } from '@testing-library/react';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { SubsonicSong } from '@/lib/api/subsonicTypes';
|
||||
import { useSongBrowseList } from './useSongBrowseList';
|
||||
import { useAuthStore } from '../store/authStore';
|
||||
import { useLibraryIndexStore } from '../store/libraryIndexStore';
|
||||
import { useSongBrowseList } from '@/features/search/hooks/useSongBrowseList';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useLibraryIndexStore } from '@/store/libraryIndexStore';
|
||||
|
||||
vi.mock('@/lib/api/subsonicSearch', () => ({
|
||||
searchSongsPaged: vi.fn(async () => []),
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
runLocalBrowseSongPage,
|
||||
runNetworkBrowseSongPage,
|
||||
} from '@/lib/library/browseTextSearch';
|
||||
import { useAuthStore } from '../store/authStore';
|
||||
import { useLibraryIndexStore } from '../store/libraryIndexStore';
|
||||
import { useAuthStore } from '@/store/authStore';
|
||||
import { useLibraryIndexStore } from '@/store/libraryIndexStore';
|
||||
import { useOfflineBrowseContext } from '@/features/offline';
|
||||
import { useOfflineBrowseReloadToken } from '@/features/offline';
|
||||
import {
|
||||
@@ -8,7 +8,7 @@ import { SlidersVertical, Search, X } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AlbumRow } from '@/features/album';
|
||||
import { ArtistRow } from '@/features/artist';
|
||||
import PagedSongList from '@/components/PagedSongList';
|
||||
import PagedSongList from '@/features/search/components/PagedSongList';
|
||||
import CustomSelect from '@/ui/CustomSelect';
|
||||
import StarFilterButton from '@/ui/StarFilterButton';
|
||||
import { tooltipAttrs } from '@/ui/tooltipAttrs';
|
||||
@@ -58,9 +58,9 @@ import {
|
||||
import { useLibraryIndexStore } from '@/store/libraryIndexStore';
|
||||
import { MOOD_GROUP_IDS } from '@/config/moodGroups';
|
||||
import { usePerfProbeFlags } from '@/utils/perf/perfFlags';
|
||||
import { useSongBrowseList, type SongBrowseListRestore } from '@/hooks/useSongBrowseList';
|
||||
import TracksPageChrome from '@/components/tracks/TracksPageChrome';
|
||||
import SongBrowseSection from '@/components/tracks/SongBrowseSection';
|
||||
import { useSongBrowseList, type SongBrowseListRestore } from '@/features/search/hooks/useSongBrowseList';
|
||||
import TracksPageChrome from '@/features/search/components/TracksPageChrome';
|
||||
import SongBrowseSection from '@/features/search/components/SongBrowseSection';
|
||||
import {
|
||||
useLiveSearchScopeStore,
|
||||
useScopedBrowseSearchQuery,
|
||||
|
||||
Reference in New Issue
Block a user