refactor(lib,playback): relocate albumDetailNavigation + mixRatingFilter decouple-knots

Two lower-layer→feature inversions removed:

- Detail-route predicates (isAlbumDetailPath/isArtistDetailPath/isComposerDetailPath)
  were defined in features/album's browse store but are pure URL checks. Extracted
  to lib/navigation/detailRoutePaths; the browse store re-exports them so the
  @/features/album barrel surface is unchanged. This frees albumDetailNavigation of
  its only @/features import, so it moves utils/navigation → lib/navigation (drains
  utils/navigation). Also fixes the M5 isArtistDetailPath misplacement.

- mixRatingFilter's sole feature dep is playback's userRatingOverrides and its only
  binding consumer is playback's buildInfiniteQueueCandidates, so it belongs in the
  playback feature: utils/mix → features/playback/utils (drains utils/mix). The
  earlier handoff note that lib/api/subsonicStarRating consumes it was stale — that
  is only a code comment, verified no runtime import.

Pure moves; tests pass unmodified. The share cluster + switchActiveServer stay in
utils/ — they are imported by the a11y-HELD PasteClipboardHandler, so relocating
them would rewrite a do-not-touch file.
This commit is contained in:
Psychotoxical
2026-06-30 21:17:01 +02:00
parent fbca1831a1
commit d4ab56f5a6
40 changed files with 80 additions and 60 deletions
@@ -8,7 +8,7 @@ import {
isComposersBrowsePath,
useComposerBrowseSessionStore,
} from '@/features/composers/store/composerBrowseSessionStore';
import { shouldRestoreComposerBrowseSession } from '@/utils/navigation/albumDetailNavigation';
import { shouldRestoreComposerBrowseSession } from '@/lib/navigation/albumDetailNavigation';
import { useLiveSearchScopeStore } from '@/store/liveSearchScopeStore';
export type ComposerBrowseScrollSnapshot = {
@@ -4,7 +4,7 @@ import {
peekComposerBrowseScrollRestore,
useComposerBrowseSessionStore,
} from '@/features/composers/store/composerBrowseSessionStore';
import { shouldRestoreComposerBrowseSession } from '@/utils/navigation/albumDetailNavigation';
import { shouldRestoreComposerBrowseSession } from '@/lib/navigation/albumDetailNavigation';
type PendingScroll = {
scrollTop: number;
@@ -1,6 +1,6 @@
import { useCallback } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { navigateToComposerDetail } from '@/utils/navigation/albumDetailNavigation';
import { navigateToComposerDetail } from '@/lib/navigation/albumDetailNavigation';
/** Navigate to composer detail, remembering the current page for the back button. */
export function useNavigateToComposer() {
+1 -1
View File
@@ -18,7 +18,7 @@ import { useArtistsBrowseScrollReset } from '@/features/artist';
import { useNavigateToComposer } from '@/features/composers/hooks/useNavigateToComposer';
import { peekComposerBrowseScrollRestore } from '@/features/composers/store/composerBrowseSessionStore';
import { useScopedBrowseSearchQuery } from '@/store/liveSearchScopeStore';
import { readComposerBrowseRestore } from '@/utils/navigation/albumDetailNavigation';
import { readComposerBrowseRestore } from '@/lib/navigation/albumDetailNavigation';
import { filterArtistsWithRoleAlbumCredits } from '@/lib/library/composerBrowse';
import { ALL_SENTINEL, artistLetterBucket } from '@/features/artist';
import { useLibraryIgnoredArticles } from '@/lib/library/hooks/useLibraryIgnoredArticles';