diff --git a/src/routes/(app)/automations/+page.svelte b/src/routes/(app)/automations/+page.svelte index 0d596091a4..6dd7267eac 100644 --- a/src/routes/(app)/automations/+page.svelte +++ b/src/routes/(app)/automations/+page.svelte @@ -33,6 +33,7 @@ import Search from '$lib/components/icons/Search.svelte'; import XMark from '$lib/components/icons/XMark.svelte'; import EllipsisHorizontal from '$lib/components/icons/EllipsisHorizontal.svelte'; + import GarbageBin from '$lib/components/icons/GarbageBin.svelte'; import Select from '$lib/components/common/Select.svelte'; import Dropdown from '$lib/components/common/Dropdown.svelte'; import DropdownMenu from '$lib/components/common/DropdownMenu.svelte'; @@ -57,6 +58,7 @@ let cloneFrom: AutomationResponse | null = null; let showDeleteConfirm = false; + let shiftKey = false; let deleteTarget: AutomationResponse | null = null; let openAutomationMenuId: string | null = null; @@ -367,8 +369,33 @@ syncHeader(); ensureChannels(); + const onKeyDown = (event: KeyboardEvent) => { + if (event.key === 'Shift') { + shiftKey = true; + openAutomationMenuId = null; + } + }; + + const onKeyUp = (event: KeyboardEvent) => { + if (event.key === 'Shift') { + shiftKey = false; + } + }; + + const onBlur = () => { + shiftKey = false; + }; + + window.addEventListener('keydown', onKeyDown); + window.addEventListener('keyup', onKeyUp); + window.addEventListener('blur', onBlur); + return () => { clearTimeout(searchDebounceTimer); + + window.removeEventListener('keydown', onKeyDown); + window.removeEventListener('keyup', onKeyUp); + window.removeEventListener('blur', onBlur); }; }); @@ -617,60 +644,79 @@ -
- { - goto(`/automations/${automation.id}`); - }} - cloneHandler={() => { - cloneHandler(automation); - }} - runHandler={() => { - runNowHandler(automation); - }} - deleteHandler={() => { - deleteTarget = automation; - showDeleteConfirm = true; - }} - onClose={() => { - openAutomationMenuId = null; - }} - > - - - - - + {:else} +
+ { + goto(`/automations/${automation.id}`); + }} + cloneHandler={() => { + cloneHandler(automation); + }} + runHandler={() => { + runNowHandler(automation); + }} + deleteHandler={() => { + deleteTarget = automation; + showDeleteConfirm = true; + }} + onClose={() => { + openAutomationMenuId = null; + }} + > + + + + +
+ {/if}
{/each}