fix(ui): place cleanup opt-out below dialog actions
Extract the cleanup confirmation into a reusable production component, align its action group to the right, and place the opt-out directly below the buttons. Add an isolated visual fixture so the exact dialog can be reviewed without touching real queue data.
This commit is contained in:
@@ -35,6 +35,16 @@ describe("desktop shell", () => {
|
||||
expect(removal).toContain('title: "Ausgewählte Links löschen"');
|
||||
});
|
||||
|
||||
it("places the delete confirmation opt-out below the right-aligned actions", () => {
|
||||
const source = readFileSync(new URL("../src/renderer/views/downloads/DeleteConfirmationDialog.tsx", import.meta.url), "utf8");
|
||||
const css = readFileSync(new URL("../src/renderer/styles.css", import.meta.url), "utf8");
|
||||
|
||||
expect(source).toContain('className="delete-confirm-footer"');
|
||||
expect(source.indexOf('className="modal-actions"')).toBeLessThan(source.indexOf("Nicht mehr anzeigen"));
|
||||
expect(source).toContain('className="toggle-line delete-confirm-dont-ask"');
|
||||
expect(css).toMatch(/\.delete-confirm-footer\s*{[^}]*display:\s*grid;[^}]*justify-items:\s*end;/s);
|
||||
});
|
||||
|
||||
it("does not stack renderer latency on the manager cadence for large active queues", () => {
|
||||
expect(getSnapshotRenderDelay(2_470, true, "downloads")).toBe(0);
|
||||
expect(getSnapshotRenderDelay(2_470, true, "statistics")).toBe(800);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { ReactElement } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "../../src/renderer/App";
|
||||
import { DeleteConfirmationDialog } from "../../src/renderer/views/downloads/DeleteConfirmationDialog";
|
||||
import type { ElectronApi } from "../../src/shared/preload-api";
|
||||
import "../../src/renderer/theme.css";
|
||||
import "../../src/renderer/styles.css";
|
||||
@@ -75,6 +76,19 @@ export function renderVisualApp(render: (element: ReactElement) => void): void {
|
||||
render(<App />);
|
||||
}
|
||||
|
||||
export function renderDeleteConfirmationDialog(render: (element: ReactElement) => void): void {
|
||||
render(
|
||||
<DeleteConfirmationDialog
|
||||
dontAsk
|
||||
parts={["2 Paket(e)"]}
|
||||
totalRemaining={0}
|
||||
onCancel={() => {}}
|
||||
onConfirm={() => {}}
|
||||
onDontAskChange={() => {}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function markVisualReady(
|
||||
scenario: VisualScenario,
|
||||
rootElement: VisualHarnessRoot,
|
||||
@@ -154,6 +168,12 @@ export async function startVisualHarness(
|
||||
runtime.marker.visualScenario = scenario;
|
||||
|
||||
const root = runtime.createRoot(rootElement);
|
||||
if (new URLSearchParams(runtime.search).get("dialog") === "delete-confirmation") {
|
||||
renderDeleteConfirmationDialog((element) => root.render(element));
|
||||
await waitForVisualFrames(runtime.requestFrame);
|
||||
runtime.marker.visualReady = "true";
|
||||
return;
|
||||
}
|
||||
renderVisualApp((element) => root.render(element));
|
||||
|
||||
const readyOptions = {
|
||||
|
||||
Reference in New Issue
Block a user