refactor(player): E.42 — migrate playerStore re-exports to direct imports (#607)

Migrates ~74 call sites away from the playerStore re-export shims that
were kept during M0–E.41 to avoid touching 30+ imports per PR. Now
that the bigger refactor work is done, each helper goes back to its
real home:

- `initAudioListeners`, `installQueueUndoHotkey`, `flushPlayQueuePosition`
  → from their own store modules
- `getPlaybackProgressSnapshot`, `subscribePlaybackProgress`,
  `PlaybackProgressSnapshot` → from `playbackProgress`
- `resolveReplayGainDb`, `shuffleArray`, `songToTrack`
  → from `utils/*`
- `_resetQueueUndoStacksForTest`, `consumePendingQueueListScrollTop`,
  `registerQueueListScrollTopReader` → from `queueUndo`
- `PlayerState`, `Track` types → from `playerStoreTypes`

Drops the corresponding 13 re-export stubs from `playerStore.ts` and
the now-unused imports. Also drops dead section banners + per-wrapper
comments above one-line action delegates. Trims one stale "(separate
PR)" note in `transportLightActions.ts` since that follow-up landed
in E.39.

`playerStore.ts`: 180 → 112 LOC (−68). Down from Phase E's starting
3732 LOC.

`bootstrap.test.ts` mock target updated from `../store/playerStore`
to `../store/queueUndoHotkey` to keep the spy reachable after the
import change.
This commit is contained in:
Frank Stellmacher
2026-05-12 22:46:13 +02:00
committed by GitHub
parent e92535a5f5
commit 9fac6eb490
81 changed files with 155 additions and 236 deletions
+6 -12
View File
@@ -15,18 +15,12 @@ type SetState = (
type GetState = () => PlayerState;
/**
* Light transport actions factored out of the playerStore `create()`
* body — everything except `resume` (~165 LOC, separate PR) and the
* scheduled pause/resume timer setters.
*
* - `stop` — full reset: stops audio/radio, clears timers + seek + visual
* state, blanks playback metadata.
* - `pause` — pauses audio (or radio), flushes queue position so other
* devices can pick up the resume point.
* - `resetAudioPause` — flips the engine-paused flag without touching
* the UI `isPlaying` state. Used by `audio:ended` paths.
* - `togglePlay` — guarded toggle so a double media-key tap can't race
* pause + resume into a stuck state.
* Light transport actions — everything except `resume` (own module,
* see `resumeAction.ts`) and scheduled timers (`scheduleActions.ts`).
* `togglePlay` is guarded so a double media-key tap can't race
* pause + resume into a stuck state. `resetAudioPause` flips the
* engine-paused flag without touching the UI `isPlaying`, used by
* `audio:ended` paths.
*/
export function createTransportLightActions(set: SetState, get: GetState): Pick<
PlayerState,