Skip to content

Conversation

@martpie
Copy link
Owner

@martpie martpie commented Oct 16, 2025

Big refactoring done using Claude. Will take some time to review later, but the nature of the change is great.

@martpie martpie force-pushed the various-architecture-improvements branch from 9c2193c to f894138 Compare October 16, 2025 21:36
@martpie martpie force-pushed the various-architecture-improvements branch from f894138 to 2e790c5 Compare October 16, 2025 22:47
@martpie martpie force-pushed the various-architecture-improvements branch from 810a512 to 58d4ed1 Compare October 17, 2025 17:01
@martpie martpie force-pushed the various-architecture-improvements branch from 889bdc4 to c7603ce Compare October 18, 2025 09:52
@martpie martpie requested a review from Copilot October 24, 2025 15:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR performs a significant architectural refactoring that consolidates player state management by moving queue and playback state from Zustand store into the Player class itself, and replacing the MediaSessionEvents component with integrated MediaSession logic directly in the player.

Key changes:

  • Merged player state management into a single Player class using EventEmitter for React integration
  • Removed usePlayerStore Zustand store and PlayerStatus enum in favor of direct player instance usage
  • Consolidated MediaSession event handling into the Player class constructor

Reviewed Changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/player.ts Significantly expanded to include queue management, state emission via EventEmitter, and MediaSession integration
src/stores/usePlayerStore.ts Completely removed - all functionality moved to player.ts
src/hooks/usePlayer.ts New hook file providing usePlayerState and related hooks using useSyncExternalStore
src/components/MediaSessionEvents.tsx Removed - MediaSession logic moved into Player class
src/types/museeks.ts Removed PlayerStatus enum (replaced with isPaused boolean)
src/components/*.tsx Updated to use player instance and usePlayerState hook instead of Zustand store
src/routes/*.tsx Updated to use player.getQueueOrigin() instead of accessing store state
package.json Replaced lefthook with simple-git-hooks, added eventemitter3 dependency
src/translations/*.po Updated line number references due to code reorganization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@martpie martpie merged commit 4417853 into master Oct 27, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants