release: harden provider rotation and download recovery

Apply account and provider changes to active conversions without restarting, isolate API and Web state, and abort the exact fallback attempt when settings change.

Bound resume recovery, make disk reservations abortable, preserve cleanup totals and history, stabilize compact UI state, and canonicalize RapidGator host aliases.

Expand bounded support diagnostics while redacting account identities, local paths, package names, and file names from current and rotated logs.

Add regression coverage for rotation, live settings, HTTP 416 recovery, disk waits, cleanup, context menus, history failures, and support bundle privacy.
This commit is contained in:
Sucukdeluxe
2026-08-13 20:44:43 +02:00
parent d287056a2a
commit 4972858c9d
34 changed files with 2103 additions and 317 deletions
+36 -8
View File
@@ -1,16 +1,21 @@
import { renderToStaticMarkup } from "react-dom/server";
import { readFileSync } from "node:fs";
import { describe, expect, it, vi } from "vitest";
import {
clampContextMenuPosition,
ContextMenu,
getContextMenuKeyboardAction,
getContextMenuSubmenuKeyboardAction,
getContextSubmenuPosition
import { afterEach, describe, expect, it, vi } from "vitest";
import {
clampContextMenuPosition,
ContextMenu,
getContextMenuKeyboardAction,
getContextMenuSubmenuKeyboardAction,
getContextSubmenuPosition,
observeContextMenuPosition
} from "../src/renderer/ui/ContextMenu";
const contextMenuSource = readFileSync(new URL("../src/renderer/ui/ContextMenu.tsx", import.meta.url), "utf8");
const stylesSource = readFileSync(new URL("../src/renderer/styles.css", import.meta.url), "utf8");
afterEach(() => {
vi.unstubAllGlobals();
});
describe("ContextMenu", () => {
it("renders menu semantics and marks buttons as menu items", () => {
@@ -40,7 +45,7 @@ describe("ContextMenu", () => {
error.mockRestore();
});
it("clamps every edge to the visible viewport", () => {
it("clamps every edge to the visible viewport", () => {
expect(clampContextMenuPosition(790, 590, 220, 180, 800, 600)).toEqual({ x: 580, y: 420 });
expect(clampContextMenuPosition(-12, -8, 220, 180, 800, 600)).toEqual({ x: 0, y: 0 });
expect(clampContextMenuPosition(40, 60, 220, 180, 800, 600)).toEqual({ x: 40, y: 60 });
@@ -104,6 +109,29 @@ describe("ContextMenu", () => {
)).toEqual({ x: 590, y: 450 });
});
it("repositions an open menu immediately when the viewport is resized", () => {
const viewport = Object.assign(new EventTarget(), { innerWidth: 800, innerHeight: 600 });
vi.stubGlobal("window", viewport);
const menu = {
getBoundingClientRect: () => ({ width: 200, height: 150 })
} as Pick<HTMLElement, "getBoundingClientRect">;
const onPosition = vi.fn();
const stop = observeContextMenuPosition(menu, () => ({ x: 700, y: 550 }), onPosition);
expect(onPosition).toHaveBeenLastCalledWith({ x: 600, y: 450 });
viewport.innerWidth = 500;
viewport.innerHeight = 350;
viewport.dispatchEvent(new Event("resize"));
expect(onPosition).toHaveBeenLastCalledWith({ x: 300, y: 200 });
expect(onPosition).toHaveBeenCalledTimes(2);
stop();
viewport.dispatchEvent(new Event("resize"));
expect(onPosition).toHaveBeenCalledTimes(2);
});
it("keeps submenus hidden until their viewport-safe position is ready", () => {
expect(contextMenuSource).toContain('position.ready && position.sourceX === x && position.sourceY === y ? "is-positioned" : ""');
expect(contextMenuSource).toContain('parts.items.classList.add("is-positioned")');