Skip to content

Conversation

@rivaldi8
Copy link
Contributor

@rivaldi8 rivaldi8 commented Dec 20, 2025

While implementing the song selection stuff I've detected some issues and inconsistencies with other Android applications. As they're not related to the migration (the already existed), I'll rather fix them in a separate pull request when this one is closed.

Unrelated to this tab, also fix genre context menu having no playlists on "Add to playlist" submenu. This happened only from time to time, after switching to other tabs or pages. The menu would appear only with the "New playlist" entry. It would fix itself after switching to other tabs (not always).

The issue was the playlist list passed to the genre list composable wasn't using a reactive type, so it wouldn't trigger a recomposition if it changed. I guess there's some race condition that make it work most of the time.

They are useful. From Kotlin coding conventions (*):

  Using trailing commas has several benefits:
    - It makes version-control diffs cleaner – as all the focus is on
      the changed value.
    - It makes it easy to add and reorder elements – there is no need to
      add or delete the comma if you manipulate elements.
    - It simplifies code generation, for example, for object
      initializers. The last element can also have a comma.

  Trailing commas are entirely optional – your code will still work
  without them. The Kotlin style guide encourages the use of trailing
  commas at the declaration site and leaves it at your discretion for
  the call site.

(*) https://kotlinlang .org/docs/coding-conventions.html#trailing-commas
This happened only from time to time, after switching to other tabs or
pages. The menu would appear only with the "New playlist" entry. It
would fix itself after switching to other tabs (not always).

The issue was the playlist list passed to the genre list composable
wasn't using a reactive type, so it wouldn't trigger a recomposition if
it changed. I guess there's some race condition that make it work most
of the time.
}

viewModelScope.launch {
playbackManager.shuffle(songs) { result ->
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why the type completion parameter in PlaybackManager.shuffle is Result<Any?> instead of Result<Boolean> (from PlaybackManager.load)?

@rivaldi8 rivaldi8 force-pushed the migrate-songs-list-to-compose branch from f62b78d to 9985bf6 Compare December 20, 2025 12:15
As it was before the migration, no popup was shown for 'Last modified'
and Duration sort orders.
This would happen, for example, when scrolling the song list with Year
order selected. There wasn't space at the start and end of the popup
bubble, which made it look cramped.
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.

1 participant