fix(history): remove selections atomically

This commit is contained in:
Sucukdeluxe
2026-08-21 00:59:45 +02:00
parent 3a95136ef1
commit 869dbc25be
11 changed files with 107 additions and 20 deletions
+11
View File
@@ -639,6 +639,17 @@ describe("visual history states", () => {
expect(listener).toContain("mergeLiveHistoryEntry");
expect(listener).not.toContain("getHistory()");
});
it("removes the selected history ids through one backend call", () => {
const source = readFileSync(new URL("../src/renderer/App.tsx", import.meta.url), "utf8").replaceAll("\r\n", "\n");
const removalStart = source.indexOf("const removeHistoryEntries = useCallback");
const removalEnd = source.indexOf("const clearHistoryEntries", removalStart);
const removal = source.slice(removalStart, removalEnd);
expect(removal).toContain("window.rd.removeHistoryEntries(ids)");
expect(removal).not.toContain("Promise.allSettled");
expect(removal).not.toContain("window.rd.removeHistoryEntry(");
});
it("keeps bootstrap deterministic before exposing loading and error responses to the opened history view", async () => {
const loadingApi = createVisualElectronApi(createVisualFixture("dense"), "?history-state=loading");