Fix queue bottom sheet reorder behavior#621
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| itemsIndexed(items, key = { _, s -> s.id }) { index, song -> | ||
| ReorderableItem( | ||
| state = reorderableState, | ||
| key = "${song.id}_$index", | ||
| key = song.id, | ||
| enabled = index != 0 |
There was a problem hiding this comment.
Duplicate song keys collapse reorder identity
Queue rows are now keyed only by song.id and the drag mapping resolves positions by the first matching id. If the queue contains the same track more than once, the keys are no longer unique: dragging the later copy will be mapped to the first occurrence, so the wrong item gets removed/inserted and the resulting reorder callback targets the wrong song. Compose also expects stable unique keys per row, so duplicates will misbehave under drag.
Useful? React with 👍 / 👎.
Summary
Testing
Codex Task