The first public release of Fabled Minstrel #158

Merged
bvandeusen merged 256 commits from dev into main 2026-12-03 21:41:58 -05:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit cceeaeb5c8 - Show all commits
+3
View File
@@ -14,6 +14,9 @@ describe('transport rules', () => {
expect(canSkipNext({ index: 1, queue, repeat: 'off' })).toBe(true); expect(canSkipNext({ index: 1, queue, repeat: 'off' })).toBe(true);
expect(canSkipNext({ index: 2, queue, repeat: 'off' })).toBe(false); expect(canSkipNext({ index: 2, queue, repeat: 'off' })).toBe(false);
expect(canSkipNext({ index: 2, queue, repeat: 'all' })).toBe(true); expect(canSkipNext({ index: 2, queue, repeat: 'all' })).toBe(true);
// Repeat one repeats a track as it ends; an explicit Next at the end of
// the queue stops, so the button is off as with repeat off.
expect(canSkipNext({ index: 2, queue, repeat: 'one' })).toBe(false);
}); });
test('repeat labels name each mode', () => { test('repeat labels name each mode', () => {
+3 -2
View File
@@ -16,9 +16,10 @@ export function canSkipPrev(p: { index: number; position: number }): boolean {
} }
/** Whether Next does anything: there is a track after this one, or the /** Whether Next does anything: there is a track after this one, or the
queue wraps round. */ queue wraps round (repeat all). Repeat one doesn't count: an explicit
Next at the end stops there, as with repeat off (store.skipNext). */
export function canSkipNext(p: { index: number; queue: readonly unknown[]; repeat: RepeatMode }): boolean { export function canSkipNext(p: { index: number; queue: readonly unknown[]; repeat: RepeatMode }): boolean {
return !(p.index === p.queue.length - 1 && p.repeat === 'off'); return p.index + 1 < p.queue.length || p.repeat === 'all';
} }
export function repeatLabel(mode: RepeatMode): string { export function repeatLabel(mode: RepeatMode): string {