diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index c8ea7a8..36787e2 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -64,7 +64,7 @@ export function ScriptTerminalModal({ const [isWaitingNextInteraction, setIsWaitingNextInteraction] = useState(false) const waitingTimeoutRef = useRef(null) - const [modalHeight, setModalHeight] = useState(60) // Reducido de 80vh a 60vh para que sea visible el header y footer + const [modalHeight, setModalHeight] = useState(600) // Restaurado a píxeles como en la versión que funciona const [isResizing, setIsResizing] = useState(false) const resizeHandlersRef = useRef<{ handleMouseMove: ((e: MouseEvent) => void) | null @@ -416,15 +416,14 @@ export function ScriptTerminalModal({ e.preventDefault() e.stopPropagation() - setIsResizing(true) const startY = "touches" in e ? e.touches[0].clientY : e.clientY const startHeight = modalHeight const handleMove = (moveEvent: MouseEvent | TouchEvent) => { + moveEvent.preventDefault() // Añadido preventDefault en cada move para mejor soporte táctil const currentY = "touches" in moveEvent ? moveEvent.touches[0].clientY : moveEvent.clientY const deltaY = currentY - startY - const deltaPercent = (deltaY / window.innerHeight) * 100 - const newHeight = Math.max(30, Math.min(85, startHeight + deltaPercent)) // Cambiado límites a 30vh mínimo y 85vh máximo + const newHeight = Math.max(300, Math.min(2400, startHeight + deltaY)) // Restaurado a píxeles con límites razonables setModalHeight(newHeight) @@ -445,26 +444,9 @@ export function ScriptTerminalModal({ } const handleEnd = () => { - setIsResizing(false) - - if (fitAddonRef.current && termRef.current && wsRef.current?.readyState === WebSocket.OPEN) { - setTimeout(() => { - if (fitAddonRef.current && termRef.current) { - fitAddonRef.current.fit() - wsRef.current?.send( - JSON.stringify({ - type: "resize", - cols: termRef.current.cols, - rows: termRef.current.rows, - }), - ) - } - }, 50) - } - document.removeEventListener("mousemove", handleMove as any) document.removeEventListener("mouseup", handleEnd) - document.removeEventListener("touchmove", handleMove as any, { passive: false } as any) + document.removeEventListener("touchmove", handleMove as any) document.removeEventListener("touchend", handleEnd) localStorage.setItem("scriptModalHeight", modalHeight.toString()) @@ -487,7 +469,7 @@ export function ScriptTerminalModal({ e.preventDefault()} onEscapeKeyDown={(e) => e.preventDefault()} hideClose @@ -514,18 +496,14 @@ export function ScriptTerminalModal({ )} - {!isMobile && ( + {(isTablet || (!isMobile && !isTablet)) && ( // Barra visible en tablet y escritorio
- +
)}