mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(utils): group utils/ files into topic folders (Phase L, part 1) (#689)
111 of 122 top-level src/utils/ files move into 16 topic folders (audio, cache, cover, share, server, playback, playlist, deviceSync, waveform, mix, format, export, changelog, ui, perf, componentHelpers). True singletons with no cluster stay at the utils/ root. Pure file-move: a path-aware codemod rewrote 539 relative-import specifiers across 275 files; no logic touched. The hot-path coverage gate list (.github/frontend-hot-path-files.txt) is updated to the new paths for the 11 gated utils files — a mechanical consequence of the move, not a CI change. tsc is green.
This commit is contained in:
committed by
GitHub
parent
2409a1fec8
commit
7a7a9f5e6b
@@ -2,14 +2,14 @@ import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Eye, EyeOff } from 'lucide-react';
|
||||
import type { ServerProfile } from '../../store/authStoreTypes';
|
||||
import { showToast } from '../../utils/toast';
|
||||
import { showToast } from '../../utils/ui/toast';
|
||||
import {
|
||||
decodeServerMagicString,
|
||||
encodeServerMagicString,
|
||||
DECODED_PASSWORD_VISUAL_MASK,
|
||||
type ServerMagicPayload,
|
||||
} from '../../utils/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../utils/serverDisplayName';
|
||||
} from '../../utils/server/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../utils/server/serverDisplayName';
|
||||
|
||||
export function AddServerForm({
|
||||
onSave,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Music2, Sliders, Waves } from 'lucide-react';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import Equalizer from '../Equalizer';
|
||||
import SettingsSubSection from '../SettingsSubSection';
|
||||
import { effectiveLoudnessPreAnalysisAttenuationDb } from '../../utils/loudnessPreAnalysisSlider';
|
||||
import { effectiveLoudnessPreAnalysisAttenuationDb } from '../../utils/audio/loudnessPreAnalysisSlider';
|
||||
import { useAudioDevicesProbe } from '../../hooks/useAudioDevicesProbe';
|
||||
import { AudioOutputDeviceSection } from './audio/AudioOutputDeviceSection';
|
||||
import { NormalizationBlock } from './audio/NormalizationBlock';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Download, HardDrive, Upload } from 'lucide-react';
|
||||
import { exportBackup, importBackup } from '../../utils/backup';
|
||||
import { showToast } from '../../utils/toast';
|
||||
import { exportBackup, importBackup } from '../../utils/export/backup';
|
||||
import { showToast } from '../../utils/ui/toast';
|
||||
|
||||
export function BackupSection() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -7,10 +7,10 @@ import { useAuthStore } from '../../store/authStore';
|
||||
import type { ServerProfile } from '../../store/authStoreTypes';
|
||||
import { pingWithCredentials, scheduleInstantMixProbeForServer } from '../../api/subsonic';
|
||||
import { useDragDrop } from '../../contexts/DragDropContext';
|
||||
import { type ServerMagicPayload } from '../../utils/serverMagicString';
|
||||
import { showAudiomuseNavidromeServerSetting } from '../../utils/subsonicServerIdentity';
|
||||
import { serverListDisplayLabel } from '../../utils/serverDisplayName';
|
||||
import { switchActiveServer } from '../../utils/switchActiveServer';
|
||||
import { type ServerMagicPayload } from '../../utils/server/serverMagicString';
|
||||
import { showAudiomuseNavidromeServerSetting } from '../../utils/server/subsonicServerIdentity';
|
||||
import { serverListDisplayLabel } from '../../utils/server/serverDisplayName';
|
||||
import { switchActiveServer } from '../../utils/server/switchActiveServer';
|
||||
import { AddServerForm } from './AddServerForm';
|
||||
import { ServerGripHandle } from './ServerGripHandle';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useAuthStore } from '../../store/authStore';
|
||||
import { useSidebarStore, SidebarItemConfig } from '../../store/sidebarStore';
|
||||
import { useLuckyMixAvailable } from '../../hooks/useLuckyMixAvailable';
|
||||
import { ALL_NAV_ITEMS } from '../../config/navItems';
|
||||
import { applySidebarDropReorder } from '../../utils/sidebarNavReorder';
|
||||
import { applySidebarDropReorder } from '../../utils/componentHelpers/sidebarNavReorder';
|
||||
|
||||
type DropTarget = { idx: number; before: boolean; section: 'library' | 'system' } | null;
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { useHotCacheStore } from '../../store/hotCacheStore';
|
||||
import { useOfflineStore } from '../../store/offlineStore';
|
||||
import { usePlayerStore } from '../../store/playerStore';
|
||||
import { clearImageCache, getImageCacheSize } from '../../utils/imageCache';
|
||||
import { formatBytes, snapHotCacheMb } from '../../utils/formatBytes';
|
||||
import { showToast } from '../../utils/toast';
|
||||
import { formatBytes, snapHotCacheMb } from '../../utils/format/formatBytes';
|
||||
import { showToast } from '../../utils/ui/toast';
|
||||
import SettingsSubSection from '../SettingsSubSection';
|
||||
|
||||
export function StorageTab() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import i18n from '../../i18n';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
import type { LoggingMode } from '../../store/authStoreTypes';
|
||||
import { IS_LINUX } from '../../utils/platform';
|
||||
import { showToast } from '../../utils/toast';
|
||||
import { showToast } from '../../utils/ui/toast';
|
||||
import { AboutPsysonicBrandHeader } from '../AboutPsysonicLol';
|
||||
import CustomSelect from '../CustomSelect';
|
||||
import LicensesPanel from '../LicensesPanel';
|
||||
|
||||
@@ -2,12 +2,12 @@ import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Eye, EyeOff, Shield, Wand2 } from 'lucide-react';
|
||||
import { ndUpdateUser, type NdLibrary, type NdUser } from '../../api/navidromeAdmin';
|
||||
import { showToast } from '../../utils/toast';
|
||||
import { showToast } from '../../utils/ui/toast';
|
||||
import {
|
||||
copyTextToClipboard,
|
||||
encodeServerMagicString,
|
||||
} from '../../utils/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../utils/serverDisplayName';
|
||||
} from '../../utils/server/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../utils/server/serverDisplayName';
|
||||
|
||||
export interface UserFormState {
|
||||
userName: string;
|
||||
|
||||
@@ -6,7 +6,7 @@ import CustomSelect from '../../CustomSelect';
|
||||
import SettingsSubSection from '../../SettingsSubSection';
|
||||
import { useAuthStore } from '../../../store/authStore';
|
||||
import { IS_MACOS } from '../../../utils/platform';
|
||||
import { buildAudioDeviceSelectOptions } from '../../../utils/audioDeviceLabels';
|
||||
import { buildAudioDeviceSelectOptions } from '../../../utils/audio/audioDeviceLabels';
|
||||
|
||||
interface Props {
|
||||
audioDevices: string[];
|
||||
|
||||
@@ -3,12 +3,12 @@ import { createPortal } from 'react-dom';
|
||||
import { X } from 'lucide-react';
|
||||
import type { TFunction } from 'i18next';
|
||||
import { ndUpdateUser, type NdUser } from '../../../api/navidromeAdmin';
|
||||
import { showToast } from '../../../utils/toast';
|
||||
import { showToast } from '../../../utils/ui/toast';
|
||||
import {
|
||||
copyTextToClipboard,
|
||||
encodeServerMagicString,
|
||||
} from '../../../utils/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../../utils/serverDisplayName';
|
||||
} from '../../../utils/server/serverMagicString';
|
||||
import { shortHostFromServerUrl } from '../../../utils/server/serverDisplayName';
|
||||
|
||||
interface Props {
|
||||
user: NdUser;
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { Shield, Trash2, User, Wand2 } from 'lucide-react';
|
||||
import type { i18n as I18nType, TFunction } from 'i18next';
|
||||
import type { NdLibrary, NdUser } from '../../../api/navidromeAdmin';
|
||||
import { formatLastSeen } from '../../../utils/userMgmtHelpers';
|
||||
import { formatLastSeen } from '../../../utils/componentHelpers/userMgmtHelpers';
|
||||
|
||||
interface Props {
|
||||
user: NdUser;
|
||||
|
||||
Reference in New Issue
Block a user