feat(downloads): reset the saved column layout

Wire the download header reset action to cancel active column motion, restore the default order immediately, persist it through the serialized settings path, and confirm the result in the UI.
This commit is contained in:
Sucukdeluxe
2026-08-20 23:58:22 +02:00
parent 9942b2275e
commit 06a9b82f64
2 changed files with 24 additions and 0 deletions
+14
View File
@@ -4805,6 +4805,20 @@ export function App(): ReactElement {
}), [actionBusy, columnOrder, downloadDisclosureRevision, downloadPackageSpeeds, downloadQueueTotalBytes, downloadRemaining, downloadsSortColumn, downloadsSortDescending, downloadsViewCore, editingName, editingPackageId, gridTemplate, liveDownloadSpeedBps, providerStats.length, scheduleCountdown, schedulePickerOpen, scheduleTimeInput, snapshot.canPause, snapshot.canStart, snapshot.canStop, snapshot.clipboardActive, snapshot.etaText, snapshot.reconnectSeconds, snapshot.session.items, snapshot.session.paused, snapshot.session.reconnectReason, snapshot.session.running, snapshot.settings.animatePackageDisclosure, snapshot.settings.scheduledStartEpochMs, snapshot.stats.totalDownloaded, snapshot.stats.totalPackages]);
const downloadsActions: DownloadsViewActions = {
onResetColumnLayout: () => {
if (columnDragSettleTimerRef.current !== null) {
window.clearTimeout(columnDragSettleTimerRef.current);
columnDragSettleTimerRef.current = null;
}
cancelColumnDragAnimations();
if (columnDragSessionRef.current) {
clearDownloadColumnDrag(columnDragSessionRef.current);
columnDragSessionRef.current = null;
}
setColumnOrder(DEFAULT_COLUMN_ORDER);
persistColumnOrder(DEFAULT_COLUMN_ORDER);
showToast("Spaltenlayout zurückgesetzt", 1800);
},
onDisplayModeChange: setDownloadDisplayMode,
onFilterChange: setDownloadFilter,
onProviderFilterChange: setDownloadProviderFilter,