1661 Commits

Author SHA1 Message Date
Psychotoxical 47f2883ca2 test(arch): layering + cycle guard (dependency-cruiser) with current-violation allowlist
Encode the feature-folder layering contract as a CI gate: lib is the floor,
store/ui must not import features/app, cross-feature only via the barrel, no
cycles. dependency-cruiser resolves the @/ alias via tsconfig; tests excluded.

Land as a ratchet: the 738 current violations are seeded into
.dependency-cruiser-known-violations.json and ignored via --ignore-known, so
HEAD is green and any NEW violation fails CI. Regenerate the baseline as the
drain removes an exception; the count is the tracked residual debt.

Wired via `npm run dep:check` into a new dependency-cruiser job in eslint.yml
and the ci-ok required-check aggregate.
2026-07-01 11:14:48 +02:00
Psychotoxical 57811f2b3f Merge remote-tracking branch 'origin/main' into refactor/frontend-restructure 2026-07-01 02:18:43 +02:00
Psychotoxical a323212d0d refactor(cover): relocate imageCache into the cover layer (barrel-only external access) 2026-07-01 00:57:07 +02:00
Psychotoxical 7f48071ec4 refactor(search): extract advanced-search runner into a hook 2026-07-01 00:13:31 +02:00
Psychotoxical 87c3c588d9 refactor(search): extract advanced-search results area into a component 2026-07-01 00:03:26 +02:00
Psychotoxical 386742e2f2 refactor(search): extract advanced-search filter panel into a component 2026-06-30 23:59:42 +02:00
Psychotoxical 97bd7afed1 refactor(search): extract LiveSearch query effect into a hook 2026-06-30 23:53:23 +02:00
Psychotoxical 0c1a9e249e refactor(search): extract LiveSearch results dropdown into a component 2026-06-30 23:41:07 +02:00
Psychotoxical 16e014ca28 refactor(search): extract LiveSearch header-collapse logic into a hook 2026-06-30 23:32:41 +02:00
Psychotoxical ece4ae651c refactor(search): extract LiveSearch result thumbnails into a sibling module 2026-06-30 23:21:17 +02:00
Psychotoxical e021796f16 refactor(lib): split api/library god-module into concern modules behind a barrel
The 945-LOC lib/api/library.ts (cucadmuh's deliberate 'one thin file' library_*
command surface) exceeded the ~500 LOC ceiling. Split by its own PR-5 section
comments into library/{dto,reads,sync,stats,events}.ts + a private library/internal.ts
(the shared serverId↔indexKey helpers). lib/api/library.ts is now a barrel that
re-exports all of them, so @/lib/api/library stays the single import point — every
consumer (incl. the Settings LibraryTab) and all 11 vi.mock('@/lib/api/library')
test factories are unchanged. Pure reorganization, no logic change; tests pass
unmodified. Largest module is now dto.ts (466, pure types).
2026-06-30 22:43:10 +02:00
Psychotoxical 92635381ea refactor(share): split share cluster into lib/share + features/share
a11y-branch hold lifted. Pure share machinery (no @/features runtime imports) →
lib/share: shareLink, shareSearch, shareServerOriginLabel, copyEntityShareLink
(+tests). The two orchestrators that runtime-import offline/playback/orbit →
new features/share: applySharePaste, enqueueShareSearchPayload (+test); doc-only
barrel, consumers use deep paths. No low-layer consumes the orchestrators, so no
seam is needed — pure move, tests pass unmodified. Drains utils/share.

Only import lines changed in the PasteClipboardHandler consumer (logic untouched).
2026-06-30 22:21:57 +02:00
Psychotoxical 6590bd15ef refactor(settings,lib): home licensesData + userMgmtHelpers to owners
a11y-branch hold lifted (Frank: modals get re-refactored separately, no rebase to
protect). Both were only blocked by their modal consumers:
- licensesData (pure licenses.json lazy-loader) → features/settings/utils; main
  consumer is the settings LicensesPanel. JSON dynamic import absolutized to
  @/data/licenses.json.
- userMgmtHelpers (pure formatLastSeen, lib/format only) → lib/format; multi-feature
  consumer set, same class as playlistDetailHelpers.
Drains utils/componentHelpers (dir removed). Only import lines changed in the
LicenseTextModal/SongInfoModal consumers (logic untouched); tests pass unmodified.
2026-06-30 22:15:46 +02:00
Psychotoxical ccaecdddd8 refactor(lib): move uploadArtistImage to subsonicArtists (M5 misplacement)
uploadArtistImage lived in lib/api/subsonicPlaylists but is artist-domain and
consumed only by features/artist/runArtistDetailActions. Relocated to
lib/api/subsonicArtists (its rightful API module); consumer repointed. Also fixes
a stale doc comment in features/randomMix/index.ts (mixRatingFilter now lives in
features/playback). No behavior change; tests pass unmodified.
2026-06-30 21:33:38 +02:00
Psychotoxical 10d948db61 refactor(lib): relocate cardGridLayout → lib/util (store-free)
cardGridLayout's only store dep was three grid-column constants it imported from
authStoreDefaults. Flipped ownership: the constants now live in lib/util/cardGridLayout
(pure layout config) and authStoreDefaults re-exports them (store→lib), so the auth
settings clamp/default and every existing consumer are unchanged. cardGridLayout is now
store-free and homes in lib/util alongside the other pure helpers — consumed cleanly by
ui/VirtualCardGrid + cover/layoutSizes. Resolves the documented store-free-lib block for
the card-grid layout helper. Pure move + constant relocation; tests pass unmodified.
2026-06-30 21:28:03 +02:00
Psychotoxical c37d5f7389 refactor(network): decouple network-reachability layer from features → lib/network
The connection-reachability + Subsonic network-guard helpers were pinned low by
four lib/api consumers (subsonicLibrary/Playlists/Ratings/Scrobble) yet ran two
lower-layer→feature inversions. Both removed without a registry:

- devOfflineBrowseStore is a self-contained DEV-only toggle with zero offline-
  feature coupling — it was only colocated there. Relocated features/offline/store
  → store/ (global). The @/features/offline barrel re-exports it so feature/UI
  consumers are unchanged; the three lower-layer readers (subsonicNetworkGuard,
  activeServerReachability, useConnectionStatus) now import it from @/store directly.

- subsonicNetworkGuard's only other feature dep was playback's resolvePlaybackUrl,
  used solely for the psysonic-local:// skip check. Added hasLocalPlaybackUrl to the
  existing M4 substrate store/localPlaybackResolve — it mirrors resolvePlaybackUrl's
  local-source branch exactly (same profile resolution; the empty-serverId playback
  fallback never applies in the guard), so the skip stays bit-identical.

network/ (subsonicNetworkGuard + activeServerReachability + tests) → lib/network,
now @/features-free. useConnectionStatus is now iron-rule-clean and stays in hooks/
(cross-cutting). Test mocks retargeted to the new seam modules.

Behavior-adjacent (covered by suite; default paths identical): the local-bytes skip
helper — flag for offline-playback runtime QA alongside the M4 media-resolver seam.
2026-06-30 21:23:44 +02:00
Psychotoxical d4ab56f5a6 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.
2026-06-30 21:17:01 +02:00
Psychotoxical fbca1831a1 refactor(utils): split componentHelpers grab-bag to owning layers
Per-file routing of the 9-file utils/componentHelpers grab-bag, each driven by
its verified consumer set:
- contextMenu{Actions,Helpers} → features/contextMenu/utils (sole consumer)
- queuePanelHelpers → features/queue/utils (sole consumer)
- nowPlayingHelpers → features/nowPlaying/utils; isRealArtistImage split out to
  cover/ (consumed by cover/artistHero, a lower layer)
- appUpdaterHelpers(+test) + listReorder(+test) → lib/util (config/ + lib/hooks
  consume them; pure)
- playlistDetailHelpers → lib/format (consumed by 3 features; pure)
- appShellHelpers → app/ (app-shell consumers only)
- userMgmtHelpers left in place: consumed by the a11y-HELD SongInfoModal, so a
  move would rewrite a do-not-touch file (same block as licensesData).

Pure moves; tests pass unmodified.
2026-06-30 21:05:16 +02:00
Psychotoxical f43dcc0e76 refactor(app): relocate utils/migrations → app/migrations
Both one-time boot migrations are consumed only by app/MainApp; advancedModeMigration runtime-imports @/features/artist + @/features/playlist, so it is app-level orchestration (an inversion if kept in utils/ infra). Pure move.
2026-06-30 21:05:08 +02:00
Psychotoxical 13142e6ae3 refactor(lib): extract clean server + navigation infra to lib/ (decouple-knot files stay in utils/ pending seam) 2026-06-30 20:44:34 +02:00
Psychotoxical 7d98e649da refactor(hooks): relocate misplaced useTracklistColumns hook from utils/ to hooks/ (cross-cutting) 2026-06-30 20:39:22 +02:00
Psychotoxical 390fdfbcca refactor(lib): fold utils/perf into lib/perf + utils/ui (DOM utilities) into lib/dom 2026-06-30 20:36:23 +02:00
Psychotoxical 6becd57798 refactor(lib,playback): fold utils/cache+themes into lib; playbackScheduleFormat→playback (drains utils/format) 2026-06-30 20:33:25 +02:00
Psychotoxical 31d4a87401 refactor(lib): fold utils/audio + autodj-overlap into lib/audio (audio-transition infra; drains utils/playback) 2026-06-30 20:30:07 +02:00
Psychotoxical aea8b7750b refactor(lib,playback,whatsNew): home waveform→lib, timeline utils→playback, releaseNotes+changelog→whatsNew 2026-06-30 20:26:34 +02:00
Psychotoxical 695462ed87 refactor(cover,lib): fold utils/cover into cover/ + utils/media into lib/media (generic infra) 2026-06-30 20:21:15 +02:00
Psychotoxical 982499d32b refactor(orbit,playback): move feature-owned stores (helpModal→orbit; libraryPlaybackHint+playerBarLayout→playback) 2026-06-30 20:16:55 +02:00
Psychotoxical 03ce57feff refactor(app): co-locate shell-only lifecycle hooks in app/hooks; hooks/ now holds only cross-cutting hooks 2026-06-30 20:09:22 +02:00
Psychotoxical 79c02a93cf refactor(app): move Tauri IPC bridge hooks (tauriBridge/) into app/ where the shell composes them 2026-06-30 20:06:05 +02:00
Psychotoxical 7ae259cacf refactor(updater,settings): move feature-owned updater + theme-update hooks into their features 2026-06-30 20:03:25 +02:00
Psychotoxical 312fa78240 refactor(playback,playlist): move player-bar overflow/popover/delay + bulk-picker hooks into their features 2026-06-30 19:59:38 +02:00
Psychotoxical c2461c88d5 refactor(playback): co-locate floating-player-bar + fs-idle-fade hooks (and orphaned playback tests) with their features 2026-06-30 19:55:20 +02:00
Psychotoxical f03a5f13e8 refactor(cover): move cover-coupled hooks into cover/; drop deprecated usePlaybackCoverArt shim 2026-06-30 19:52:29 +02:00
Psychotoxical 28e049425e refactor(music-network): move enrichment-primary icon/label hooks into music-network/ui 2026-06-30 19:48:54 +02:00
Psychotoxical 777c72adf7 refactor(lib): move library-index hooks into lib/library/hooks 2026-06-30 19:48:49 +02:00
Psychotoxical 1f93984482 refactor(hooks): move generic scroll/pagination/dnd UI hooks into lib/hooks 2026-06-30 19:34:28 +02:00
Psychotoxical 31bc24a178 refactor(hooks): co-locate feature-coupled hooks (playback server/navigate/timeline/audio-devices->playback, smart-collage/pending-polling->playlist, contextmenu rating/keyboard->contextMenu) 2026-06-30 19:30:41 +02:00
Psychotoxical e0d6623bf1 refactor(lyrics): co-locate lyrics feature into features/lyrics (LyricsPane + hooks + cache + lrclib/lyricsplus/netease providers; lyricsStore stays global) 2026-06-30 19:21:21 +02:00
Psychotoxical d9dfdf66e9 refactor(music-network): co-locate MusicNetworkIndicator + presetIcon into music-network/ui (barrel-exported) 2026-06-30 19:15:56 +02:00
Psychotoxical 15a6590e77 refactor(updater+contextMenu): co-locate updater feature (AppUpdater+Changelog) and the context-menu subsystem into features/ 2026-06-30 19:12:26 +02:00
Psychotoxical 7d2645171b refactor(components): co-locate remaining UI/feature components (TracklistColumnPicker+LosslessModeBanner->ui, fixedThemes->utils/themes, ThemeUpdateBanner/WindowButtonPreview/AboutPsysonicLol->settings, BottomNav/MobileMoreOverlay->sidebar, MobilePlayerView->nowPlaying, WhatsNewBanner->whatsNew) 2026-06-30 19:07:46 +02:00
Psychotoxical ba9e0d6541 refactor(app): move app-shell chrome into app/ (TitleBar, ConnectionIndicator, ErrorBoundary, AppShellQueueResizerSeam, dev overlays + PerfOverlaySparkline) 2026-06-30 19:04:37 +02:00
Psychotoxical d876781fcb refactor(components): co-locate feature-specific components (HostApprovalQueue->orbit, Playback{Delay,Schedule}->playback, LicensesPanel->settings) 2026-06-30 18:55:48 +02:00
Psychotoxical 9eee4eed5b refactor(components): GenreFilterBar -> ui/ (shared), SongCard -> features/home (sole consumer) 2026-06-30 18:50:46 +02:00
Psychotoxical 0a8d82fe2a refactor(ui): move GenreFilterBar (shared genre filter) into ui/ 2026-06-30 18:50:36 +02:00
Psychotoxical afa8999d37 refactor(search): co-locate tracks song-browse cluster (SongRow/PagedSongList/SongBrowseSection/TracksPageChrome/useSongBrowseList) into features/search 2026-06-30 18:41:31 +02:00
Psychotoxical 5c3a135040 refactor(playback): co-locate player bar UI (PlayerBar + playerBar/* + PlaybackBufferingOverlay) into features/playback/components 2026-06-30 18:37:06 +02:00
Psychotoxical 5cb5cf1d24 refactor(equalizer): co-locate equalizer UI into features/equalizer (eqStore/eqCurve stay audio-core) 2026-06-30 18:34:11 +02:00
Psychotoxical 41877d10d8 refactor(ui): move generic presentational primitives into ui/ (CoverLightbox, StarRating, LongPressWaveOverlay, icons, VirtualCardGrid) 2026-06-30 18:28:54 +02:00
Psychotoxical 8cd23e86db refactor(ui): move generic filter/list primitives into ui/ (filter buttons, SortDropdown, MarqueeText, SelectionToggleButton, InpageScrollSentinel) 2026-06-30 18:25:20 +02:00