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}
|
searchQuery={searchQuery}
|
||||||
isSwitchingPlaylist={isSwitchingPlaylist}
|
isSwitchingPlaylist={isSwitchingPlaylist}
|
||||||
onPlaySong={handlePlaySong}
|
onPlaySong={handlePlaySong}
|
||||||
onReorder={async (orderedIds: string[]) => {
|
onReorder={async (_orderedIds: string[]) => {
|
||||||
if (!currentPlaylist || currentPlaylist === 'All Songs') return;
|
if (!currentPlaylist || currentPlaylist === 'All Songs') return;
|
||||||
// Persist order in backend
|
// Do not overwrite server's move result with stale order; just refresh
|
||||||
await api.reorderPlaylist(currentPlaylist, orderedIds);
|
refresh();
|
||||||
// Refresh the current playlist view
|
}}
|
||||||
refresh();
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|||||||
@ -309,6 +309,9 @@ export const PaginatedSongList: React.FC<PaginatedSongListProps> = memo(({
|
|||||||
if (!currentPlaylist || selectedSongs.size > 0) return;
|
if (!currentPlaylist || selectedSongs.size > 0) return;
|
||||||
e.dataTransfer.setData('text/song-id', song.id);
|
e.dataTransfer.setData('text/song-id', song.id);
|
||||||
console.debug('[Reorder] drag start', { id: song.id, index });
|
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