feat(web): player bar, playable track lists and Collection (M3)
- player bar with cover, like and dislike, previous / play / next, shuffle, repeat, seek bar and volume; PlayerProvider lives with the signed-in shell and restores the last track and position paused - clicking a row (or Enter) plays the list from that track with its context (album, search, history, collection); the current track is highlighted and rows have a like button; a reaction refreshes lists - Collection: history grouped by day with clearing, likes with "play all" and dislikes, all with paging; sidebar section - events and playback state are flushed when the page is hidden; player timers survive StrictMode remounts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ec3c2810c8
commit
976ffb574b
15 files changed
+803
-49
No files matched your search
@@ -1 +1,19 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
|
||||
// jsdom не умеет играть звук: play/pause только переключают флаг и шлют события, как браузер.
|
||||
Object.defineProperty(HTMLMediaElement.prototype, 'play', {
|
||||
configurable: true,
|
||||
value(this: HTMLMediaElement) {
|
||||
Object.defineProperty(this, 'paused', { configurable: true, value: false });
|
||||
this.dispatchEvent(new Event('playing'));
|
||||
return Promise.resolve();
|
||||
},
|
||||
});
|
||||
Object.defineProperty(HTMLMediaElement.prototype, 'pause', {
|
||||
configurable: true,
|
||||
value(this: HTMLMediaElement) {
|
||||
Object.defineProperty(this, 'paused', { configurable: true, value: true });
|
||||
this.dispatchEvent(new Event('pause'));
|
||||
},
|
||||
});
|
||||
Object.defineProperty(HTMLMediaElement.prototype, 'load', { configurable: true, value() {} });
|
||||
Reference in new issue
Block a user