Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ui/localization/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"access_update_tls_settings": "Update TLS Settings",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the Review comments have been addressed make sure to machine translate to other languages too. See DEVELOPMENT.md for details.

"action_bar_connection_stats": "Connection Stats",
"action_bar_extension": "Extension",
"action_bar_copy_text": "Copy text",
"action_bar_fullscreen": "Fullscreen",
"action_bar_settings": "Settings",
"action_bar_virtual_keyboard": "Virtual Keyboard",
Expand Down Expand Up @@ -709,6 +710,12 @@
"not_available": "N/A",
"not_found": "Not found",
"ntp_servers": "NTP Servers",
"ocr_copied": "Copied to clipboard",
"ocr_copy_hint": "Press {shortcut} to copy the selected text",
"ocr_drag_to_select": "Drag to select text region. Press Esc to cancel.",
"ocr_failed": "OCR failed. Please try again.",
"ocr_no_text_detected": "No text detected in selection",
"ocr_recognizing": "Recognizing text...",
"oh_no": "Oh no!",
"online": "Online",
"other_session_detected": "Another Active Session Detected",
Expand Down
115 changes: 115 additions & 0 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"semver": "^7.7.3",
"recharts": "^3.5.1",
"tailwind-merge": "^3.4.0",
"tesseract.js": "^7.0.0",
"tslog": "^4.10.2",
"usehooks-ts": "^3.1.1",
"validator": "^13.15.23",
Expand Down
29 changes: 25 additions & 4 deletions ui/src/components/ActionBar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { Fragment, useCallback, useRef } from "react";
import { MdOutlineContentPasteGo } from "react-icons/md";
import { LuCable, LuHardDrive, LuMaximize, LuSettings, LuSignal } from "react-icons/lu";
import { LuCable, LuHardDrive, LuMaximize, LuScanText, LuSettings, LuSignal } from "react-icons/lu";
import { FaKeyboard } from "react-icons/fa6";
import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
import { CommandLineIcon } from "@heroicons/react/20/solid";

import { cx } from "@/cva.config";
import { useHidStore, useMountMediaStore, useSettingsStore, useUiStore } from "@hooks/stores";
import {
useHidStore,
useMountMediaStore,
useSettingsStore,
useUiStore,
useVideoStore,
} from "@hooks/stores";
import { useDeviceUiNavigation } from "@hooks/useAppNavigation";
import { Button } from "@components/Button";
import Container from "@components/Container";
Expand All @@ -23,9 +29,16 @@ export default function Actionbar({
}) {
const { navigateTo } = useDeviceUiNavigation();
const { isVirtualKeyboardEnabled, setVirtualKeyboardEnabled } = useHidStore();
const { setDisableVideoFocusTrap, terminalType, setTerminalType, toggleSidebarView } =
useUiStore();
const {
setDisableVideoFocusTrap,
terminalType,
setTerminalType,
toggleSidebarView,
isOcrMode,
setOcrMode,
} = useUiStore();
const { remoteVirtualMediaState } = useMountMediaStore();
const { width: videoWidth, height: videoHeight } = useVideoStore();
const { developerMode } = useSettingsStore();

// This is the only way to get a reliable state change for the popover
Expand Down Expand Up @@ -63,6 +76,14 @@ export default function Actionbar({
onClick={() => setTerminalType(terminalType === "kvm" ? "none" : "kvm")}
/>
)}
<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The Action bar is already too crowded. You don't need to change anything here, but once I get time I'll rethink the action bar, so. just letting you know that I'll probably move after it merges with dev.

size="XS"
theme={isOcrMode ? "primary" : "light"}
text={m.action_bar_copy_text()}
LeadingIcon={LuScanText}
disabled={videoWidth === 0 || videoHeight === 0}
onClick={() => setOcrMode(!isOcrMode)}
/>
<Popover>
<PopoverButton as={Fragment}>
<Button
Expand Down
Loading