diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index c9f0294..e559044 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -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, diff --git a/tests/app-shell.test.tsx b/tests/app-shell.test.tsx index 9c7ed46..e763867 100644 --- a/tests/app-shell.test.tsx +++ b/tests/app-shell.test.tsx @@ -83,6 +83,16 @@ describe("desktop shell", () => { expect(pointerUp).toContain("snapshot.settings.animatePackageDisclosure"); }); + it("resets the download columns immediately and persists the default order", () => { + const source = readFileSync(new URL("../src/renderer/App.tsx", import.meta.url), "utf8"); + const actions = source.slice(source.indexOf("const downloadsActions"), source.indexOf("const statisticsActions")); + + expect(actions).toContain("onResetColumnLayout"); + expect(actions).toContain("setColumnOrder(DEFAULT_COLUMN_ORDER)"); + expect(actions).toContain("persistColumnOrder(DEFAULT_COLUMN_ORDER)"); + expect(actions).toContain('showToast("Spaltenlayout zurückgesetzt"'); + }); + it("keeps application menus mounted for animated opening and closing", () => { const source = readFileSync(new URL("../src/renderer/App.tsx", import.meta.url), "utf8"); const css = readFileSync(new URL("../src/renderer/styles.css", import.meta.url), "utf8");