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
+2 -6
View File
@@ -301,7 +301,6 @@ function workspaceActions(overrides: Partial<AccountWorkspaceActions> = {}): Acc
return {
onPanelChange: () => {},
onSelect: () => {},
onClearSelection: () => {},
onToggleEnabled: () => {},
onEdit: () => {},
onContextMenu: () => {},
@@ -799,18 +798,15 @@ describe("account workspace", () => {
]);
});
it("shows the selected account count and clears the selection with Escape", () => {
let cleared = 0;
it("shows the selected account count", () => {
const model = workspaceModel();
const tree = AccountWorkspace({
actions: workspaceActions({ onClearSelection: () => { cleared += 1; } }),
actions: workspaceActions(),
model: { ...model, selectedIds: model.rows.slice(0, 3).map((row) => row.id) }
});
const html = renderToStaticMarkup(tree);
expect(html).toContain(" Entfernen (3)");
tree.props.onKeyDown({ key: "Escape", preventDefault: () => {} });
expect(cleared).toBe(1);
});
it("removes the redundant global account activation switch", () => {