feat(ui): Add Ctrl+Alt+Del to the action bar (#498)

Since this is the sort of thing we do all the time, make it one-click away
This commit is contained in:
Marc Brooks
2025-05-25 07:19:42 -05:00
committed by GitHub
parent 55d7f22c47
commit 1f7c5c94d8
4 changed files with 87 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import { MdOutlineContentPasteGo } from "react-icons/md";
import { LuCable, LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu";
import { FaKeyboard } from "react-icons/fa6";
import { FaKeyboard, FaLock} from "react-icons/fa6";
import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
import { Fragment, useCallback, useRef } from "react";
import { CommandLineIcon } from "@heroicons/react/20/solid";
@@ -19,6 +19,8 @@ import WakeOnLanModal from "@/components/popovers/WakeOnLan/Index";
import MountPopopover from "@/components/popovers/MountPopover";
import ExtensionPopover from "@/components/popovers/ExtensionPopover";
import { useDeviceUiNavigation } from "@/hooks/useAppNavigation";
import useKeyboard from "@/hooks/useKeyboard";
import { keys, modifiers } from "@/keyboardMappings";
export default function Actionbar({
requestFullscreen,
@@ -56,6 +58,8 @@ export default function Actionbar({
[setDisableFocusTrap],
);
const { sendKeyboardEvent, resetKeyboardState } = useKeyboard();
return (
<Container className="border-b border-b-slate-800/20 bg-white dark:border-b-slate-300/20 dark:bg-slate-900">
<div
@@ -262,7 +266,23 @@ export default function Actionbar({
}}
/>
</div>
{useSettingsStore().actionBarCtrlAltDel && (
<div className="hidden lg:block">
<Button
size="XS"
theme="light"
text="Ctrl + Alt + Del"
LeadingIcon={FaLock}
onClick={() => {
sendKeyboardEvent(
[keys["Delete"]],
[modifiers["ControlLeft"], modifiers["AltLeft"]],
);
setTimeout(resetKeyboardState, 100);
}}
/>
</div>
)}
<div>
<Button
size="XS"