fix(web): missing files show greyed in track lists and never enter the queue (#5418)
release / web (push) Failing after 1m23s
release / govulncheck (push) Successful in 25s
release / go (push) Successful in 1m35s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / integration (push) Canceled after 4m34s
release / android (push) Canceled after 4m39s
release / Build signed APK (releases and dev) (push) Canceled after 3m21s
release / web (push) Failing after 1m23s
release / govulncheck (push) Successful in 25s
release / go (push) Successful in 1m35s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / integration (push) Canceled after 4m34s
release / android (push) Canceled after 4m39s
release / Build signed APK (releases and dev) (push) Canceled after 3m21s
TrackRef gains the unavailable flag the server already sends on album detail and search. TrackRow greys such a row with '· File missing' and hides like, radio, add and the menu, as playlist rows already do. Every player-store entry point (playQueue, enqueue, play next, and a refetched mix) drops missing files; playQueue keeps the chosen track as the start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -89,6 +89,20 @@ describe('TrackRow', () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
// #5418: a missing file stays in the list, greyed, with nothing to act on.
|
||||
test('a missing file is marked, does not play, and offers no actions', async () => {
|
||||
const withMissing = [{ ...tracks[0], unavailable: true }, tracks[1]];
|
||||
render(TrackRow, { props: { tracks: withMissing, index: 0 } });
|
||||
const row = screen.getByRole('button', { name: 'So What' });
|
||||
expect(row).toHaveAttribute('aria-disabled', 'true');
|
||||
expect(screen.getByText(/file missing/i)).toBeInTheDocument();
|
||||
await fireEvent.click(row);
|
||||
expect(playQueue).not.toHaveBeenCalled();
|
||||
expect(screen.queryByRole('button', { name: /add .* to queue/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: /play radio/i })).not.toBeInTheDocument();
|
||||
expect(screen.queryByRole('button', { name: /track actions for/i })).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
describe('selection mode', () => {
|
||||
test('clicking the checkbox toggles selection without playing', async () => {
|
||||
render(TrackRow, { props: { tracks, index: 0 } });
|
||||
|
||||
Reference in New Issue
Block a user