fix(reorder): stop overwriting server move with stale client order; just refresh after move; improve dnd effectAllowed/dropEffect
This commit is contained in:
parent
e2d6d55433
commit
2d42c6da71
@ -652,13 +652,11 @@ const RekordboxReader: React.FC = () => {
|
||||
searchQuery={searchQuery}
|
||||
isSwitchingPlaylist={isSwitchingPlaylist}
|
||||
onPlaySong={handlePlaySong}
|
||||
onReorder={async (orderedIds: string[]) => {
|
||||
if (!currentPlaylist || currentPlaylist === 'All Songs') return;
|
||||
// Persist order in backend
|
||||
await api.reorderPlaylist(currentPlaylist, orderedIds);
|
||||
// Refresh the current playlist view
|
||||
refresh();
|
||||
}}
|
||||
onReorder={async (_orderedIds: string[]) => {
|
||||
if (!currentPlaylist || currentPlaylist === 'All Songs') return;
|
||||
// Do not overwrite server's move result with stale order; just refresh
|
||||
refresh();
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
|
||||
@ -309,6 +309,9 @@ export const PaginatedSongList: React.FC<PaginatedSongListProps> = memo(({
|
||||
if (!currentPlaylist || selectedSongs.size > 0) return;
|
||||
e.dataTransfer.setData('text/song-id', song.id);
|
||||
console.debug('[Reorder] drag start', { id: song.id, index });
|
||||
// Explicitly set effect to move for better UX
|
||||
try { e.dataTransfer.effectAllowed = 'move'; } catch {}
|
||||
try { e.dataTransfer.dropEffect = 'move'; } catch {}
|
||||
}}
|
||||
/>
|
||||
));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user