refactor(fullscreenPlayer): co-locate fullscreen player feature into features/fullscreenPlayer

This commit is contained in:
Psychotoxical
2026-06-29 23:17:14 +02:00
parent 896fe3f407
commit 6dd0d4a130
9 changed files with 50 additions and 41 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ import DevNetworkModeToggle from '../components/DevNetworkModeToggle';
import NowPlayingDropdown from '../components/NowPlayingDropdown';
import QueuePanel from '../components/QueuePanel';
import AppRoutes from './AppRoutes';
import FullscreenPlayer from '../components/fullscreenPlayer/FullscreenPlayerStatic';
import FullscreenPlayer from '@/features/fullscreenPlayer';
import ContextMenu from '../components/ContextMenu';
import SongInfoModal from '../components/SongInfoModal';
import DownloadFolderModal from '../components/DownloadFolderModal';
@@ -1,9 +1,9 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { screen } from '@testing-library/react';
import { renderWithProviders } from '../../test/helpers/renderWithProviders';
import { resetAuthStore } from '../../test/helpers/storeReset';
import { useAuthStore } from '../../store/authStore';
import { FsClock } from './FsClock';
import { renderWithProviders } from '@/test/helpers/renderWithProviders';
import { resetAuthStore } from '@/test/helpers/storeReset';
import { useAuthStore } from '@/store/authStore';
import { FsClock } from '@/features/fullscreenPlayer/components/FsClock';
describe('FsClock', () => {
beforeEach(() => {
@@ -1,7 +1,7 @@
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useAuthStore } from '../../store/authStore';
import { formatClockTime } from '../../utils/format/formatClockTime';
import { useAuthStore } from '@/store/authStore';
import { formatClockTime } from '@/utils/format/formatClockTime';
/**
* Standalone wall-clock for the fullscreen player. Owns its own state so the
@@ -1,12 +1,12 @@
import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
import { usePlayerStore } from '../../store/playerStore';
import { useAuthStore } from '../../store/authStore';
import { useLyrics, type WordLyricsLine } from '../../hooks/useLyrics';
import { useWordLyricsSync } from '../../hooks/useWordLyricsSync';
import { getPlaybackProgressSnapshot, subscribePlaybackProgress } from '../../store/playbackProgress';
import type { LrcLine } from '../../api/lrclib';
import type { Track } from '../../store/playerStoreTypes';
import { EaseScroller, targetForFraction } from '../../utils/ui/easeScroll';
import { usePlayerStore } from '@/store/playerStore';
import { useAuthStore } from '@/store/authStore';
import { useLyrics, type WordLyricsLine } from '@/hooks/useLyrics';
import { useWordLyricsSync } from '@/hooks/useWordLyricsSync';
import { getPlaybackProgressSnapshot, subscribePlaybackProgress } from '@/store/playbackProgress';
import type { LrcLine } from '@/api/lrclib';
import type { Track } from '@/store/playerStoreTypes';
import { EaseScroller, targetForFraction } from '@/utils/ui/easeScroll';
// Fullscreen synced lyrics.
// Full-screen scrollable list. The active line auto-scrolls following the
@@ -1,11 +1,11 @@
import React, { memo, useRef } from 'react';
import { Moon, Pause, Play, Sunrise } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { usePlayerStore } from '../../store/playerStore';
import { usePlaybackDelayPress } from '../../hooks/usePlaybackDelayPress';
import { usePlaybackScheduleRemaining } from '../../utils/format/playbackScheduleFormat';
import PlaybackDelayModal from '../PlaybackDelayModal';
import PlaybackScheduleBadge from '../PlaybackScheduleBadge';
import { usePlayerStore } from '@/store/playerStore';
import { usePlaybackDelayPress } from '@/hooks/usePlaybackDelayPress';
import { usePlaybackScheduleRemaining } from '@/utils/format/playbackScheduleFormat';
import PlaybackDelayModal from '@/components/PlaybackDelayModal';
import PlaybackScheduleBadge from '@/components/PlaybackScheduleBadge';
// Play/Pause button (isolated — subscribes to isPlaying only).
export const FsPlayBtn = memo(function FsPlayBtn({
@@ -1,14 +1,14 @@
import { memo, useMemo, useSyncExternalStore } from 'react';
import { useTranslation } from 'react-i18next';
import { X } from 'lucide-react';
import { usePlayerStore } from '../../store/playerStore';
import type { Track } from '../../store/playerStoreTypes';
import { resolveQueueTrack } from '../../utils/library/queueTrackView';
import { usePlayerStore } from '@/store/playerStore';
import type { Track } from '@/store/playerStoreTypes';
import { resolveQueueTrack } from '@/utils/library/queueTrackView';
import {
getQueueResolverVersion,
subscribeQueueResolver,
} from '../../utils/library/queueTrackResolver';
import { formatTrackTime } from '../../utils/format/formatDuration';
} from '@/utils/library/queueTrackResolver';
import { formatTrackTime } from '@/utils/format/formatDuration';
interface Props {
onClose: () => void;
@@ -1,6 +1,6 @@
import { memo, useEffect, useRef } from 'react';
import { getPlaybackProgressSnapshot, subscribePlaybackProgress } from '../../store/playbackProgress';
import { formatTrackTime } from '../../utils/format/formatDuration';
import { getPlaybackProgressSnapshot, subscribePlaybackProgress } from '@/store/playbackProgress';
import { formatTrackTime } from '@/utils/format/formatDuration';
/**
* Centered "current / total" readout for the control bar. Updates the current
@@ -4,22 +4,22 @@ import {
Shuffle, ListMusic, ChevronDown, Star, MicVocal,
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { usePlayerStore } from '../../store/playerStore';
import { queueSongStar, queueSongRating } from '../../store/pendingStarSync';
import { useAlbumCoverRef, useArtistCoverRef } from '../../cover/useLibraryCoverRef';
import { usePlaybackCoverArt } from '../../hooks/usePlaybackCoverArt';
import { usePlayerStore } from '@/store/playerStore';
import { queueSongStar, queueSongRating } from '@/store/pendingStarSync';
import { useAlbumCoverRef, useArtistCoverRef } from '@/cover/useLibraryCoverRef';
import { usePlaybackCoverArt } from '@/hooks/usePlaybackCoverArt';
import { useCachedUrl } from '@/ui/CachedImage';
import { useArtistFanart } from '../../cover/useArtistFanart';
import { backdropFromConfig } from '../../cover/artistBackdrop';
import { useThemeStore } from '../../store/themeStore';
import { useFsIdleFade } from '../../hooks/useFsIdleFade';
import { useQueueTrackAt } from '../../hooks/useQueueTracks';
import { useArtistFanart } from '@/cover/useArtistFanart';
import { backdropFromConfig } from '@/cover/artistBackdrop';
import { useThemeStore } from '@/store/themeStore';
import { useFsIdleFade } from '@/hooks/useFsIdleFade';
import { useQueueTrackAt } from '@/hooks/useQueueTracks';
import { WaveformSeek } from '@/features/waveform';
import { FsQueueModal } from './FsQueueModal';
import { FsLyricsApple } from './FsLyricsApple';
import { FsPlayBtn } from './FsPlayBtn';
import { FsClock } from './FsClock';
import { FsTimeReadout } from './FsTimeReadout';
import { FsQueueModal } from '@/features/fullscreenPlayer/components/FsQueueModal';
import { FsLyricsApple } from '@/features/fullscreenPlayer/components/FsLyricsApple';
import { FsPlayBtn } from '@/features/fullscreenPlayer/components/FsPlayBtn';
import { FsClock } from '@/features/fullscreenPlayer/components/FsClock';
import { FsTimeReadout } from '@/features/fullscreenPlayer/components/FsTimeReadout';
interface Props {
onClose: () => void;
+9
View File
@@ -0,0 +1,9 @@
/**
* Fullscreen player feature — the immersive full-window now-playing view
* (artwork, Apple-style synced lyrics, clock, transport, queue modal) rendered
* by the app shell. Its sub-components (Fs*) are internal.
*
* Note: `hooks/useWindowFullscreenState` is NOT part of this feature — it tracks
* the OS window's fullscreen state (app-shell concern), not this player view.
*/
export { default } from './components/FullscreenPlayerStatic';