fix(accounts): clear multi-selection globally on Escape

Route account selection clearing through the existing window-level Escape handler so it works regardless of which account surface owns focus. Preserve text editing and open overlay behavior, and remove the misleading focus-dependent workspace handler.
This commit is contained in:
Sucukdeluxe
2026-08-15 01:53:03 +02:00
parent 007235bb38
commit b5854a2227
5 changed files with 42 additions and 25 deletions
+15
View File
@@ -13,6 +13,21 @@ export function shouldClearDownloadSelectionOnEscape(tagName: string, inputType
return ["checkbox", "radio", "button"].includes(inputType.toLowerCase());
}
export function resolveEscapeSelectionScope(
view: string,
settingsSection: string,
tagName: string,
inputType = ""
): "downloads" | "history" | "accounts" | null {
if (!shouldClearDownloadSelectionOnEscape(tagName, inputType)) {
return null;
}
if (view === "downloads" || view === "history") {
return view;
}
return view === "settings" && settingsSection === "accounts" ? "accounts" : null;
}
/**
* Drop selected ids whose package OR item no longer exists in the session.
* The selection set mixes package and item ids; when entries vanish (delta