SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.
JavaScript a2aagentic-aiai-agentsdevtoolsmcp-clientn8n-alternativeno-codeopen-sourceorchestrationsmythosvisual-builder
Refactor hotkey selection logic to handle textarea elements. Simplified import statements for selection actions. Enhanced user experience by ensuring textareas are selected correctly when hotkeys are triggered.
Muhammad Hamza Khanf303e42e9898
diff --git a/packages/app/src/builder-ui/workspace/hotkeys.ts b/packages/app/src/builder-ui/workspace/hotkeys.tsindex 93613b3d..aa23dd9b 100644--- a/packages/app/src/builder-ui/workspace/hotkeys.ts+++ b/packages/app/src/builder-ui/workspace/hotkeys.ts@@ -2,12 +2,7 @@ import hotkeys from 'hotkeys-js';import { CanvasSearchHelper } from '../helpers/canvasSearch.helper';import { runUIEnterKey } from '../ui/dialogs';import { sortAgent } from './ComponentSort';-import {- canCopy,- canPaste,- copySelection,- deleteSelectionWithConfirm,-} from './SelectionActions';+import { canCopy, canPaste, copySelection, deleteSelectionWithConfirm } from './SelectionActions';import { Workspace } from './Workspace.class';export function registerHotkeys(workspace: Workspace) {@@ -108,7 +103,30 @@ export function registerHotkeys(workspace: Workspace) {const dbgElement = workspace.hoveredElement.classList.contains('dbg')? workspace.hoveredElement: workspace.hoveredElement.closest('.dbg');- window.getSelection().selectAllChildren(dbgElement);++ // Handle textarea elements specially+ if (+ dbgElement &&+ (dbgElement.tagName === 'TEXTAREA' || dbgElement.classList.contains('dbg-textarea'))+ ) {+ // If it's a textarea, use the select() method+ if (dbgElement.tagName === 'TEXTAREA') {+ (dbgElement as HTMLTextAreaElement).select();+ } else {+ // If it's a div with dbg-textarea class, find the textarea inside it+ const textarea = dbgElement.querySelector('textarea');+ if (textarea) {+ textarea.select();+ } else {+ // Fallback to selecting all children+ window.getSelection().selectAllChildren(dbgElement);+ }+ }+ } else {+ // For other elements, use the original method+ window.getSelection().selectAllChildren(dbgElement);+ }+event.preventDefault();event.stopPropagation();event.stopImmediatePropagation();