Skip to content

Make previous/next button override Repeat::One

Reason for the change

Currently, Elisa's "Repeat current track" mode overrides the "Skip Forward" button (and other explicit next-track actions). This is odd UX to me, because I expect that clicking this button 'overrides' the repeat::one mode.

This MR makes the Previous and Next buttons ignore the Repeat::One status, by ignoring it altogether in skipPreviousTrack, and skipNextTrack has a new parameter that depends on if it is a manual or automatic track change.

skipPreviousTrack also had some odd behaviour where, when in Repeat::One mode, it always restarted the current track, UNLESS playing the first track in the playlist, in which case it looped around to the last track. After this MR, skipPreviousTrack always goes to the previous track, even in Repeat::One mode.

Test plan

I only tested these changes manually. Adding an automatic test would probably be valuable, but I'm not really sure how to do it. Regardless, here's how to do manual testing:

  1. Queue up multiple tracks
  2. Toggle "Repeat current track"
  3. Click "skip forwards" or manually toggle a track change otherwise
  4. Observe that the track changes
  5. Seek close to the end and wait for the track to change
  6. Observe that the track repeats when it ends

Screenshots or screen recordings

Bugs fixed

BUG: 475743

Merge request reports