Files
skalthoff cb068da8bf enhance player queue management with Zustand store integration. (#574)
What is the change

    Implement persistent player queue state with a dedicated Zustand store (MMKV-backed): queue, currentTrack, currentIndex, shuffled, unShuffledQueue, and queueRef.
    Restore the queue on app start: new initialization reads persisted state and rebuilds the TrackPlayer queue and active index.
    Unify queue mutations to keep React Native Track Player and the persisted store in sync:
        Loading a new queue sets queueRef, honors shuffle, computes start index, and writes to both RNTP and store.
        "Play Next" and "Add to Queue" update RNTP, the live queue, and unShuffledQueue consistently.
        Active track/index changes now propagate to the store and query cache.
    Tighten/refine player query/invalidations so UI reflects the latest RNTP state.
    Minor housekeeping in config/scripts to support the above (ESLint flat config, metro/jest/script updates).

What does this address

    Fixes queue not restoring after relaunch or crash; playback position and the current track persist correctly.
    Preserves shuffle state and the original unshuffled ordering for reliable shuffle toggle behavior.
    Ensures "Play Next"/"Add to Queue" behave consistently with what the user sees, avoiding duplication or desyncs.
    Reduces UI state drift by syncing RNTP events to both React Query and persistent store.


Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com>
2025-10-24 05:41:22 -05:00
..
2025-10-21 14:28:53 -05:00
2025-10-21 14:28:53 -05:00
2025-10-21 14:28:53 -05:00