diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index ad3cc23..ec8b575 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -6,16 +6,7 @@ import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" -import { - Loader2, - Activity, - GripHorizontal, - ArrowUp, - ArrowDown, - ArrowLeft, - ArrowRight, - CornerDownLeft, -} from "lucide-react" +import { Loader2, Activity, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, CornerDownLeft } from "lucide-react" import "xterm/css/xterm.css" import { API_PORT } from "@/lib/api-config" @@ -64,7 +55,7 @@ export function ScriptTerminalModal({ const [isWaitingNextInteraction, setIsWaitingNextInteraction] = useState(false) const waitingTimeoutRef = useRef(null) - const [modalHeight, setModalHeight] = useState(600) // Restaurado a píxeles como en la versión que funciona + const [modalHeight, setModalHeight] = useState(60) // vh en lugar de píxeles const [isResizing, setIsResizing] = useState(false) const resizeHandlersRef = useRef<{ handleMouseMove: ((e: MouseEvent) => void) | null @@ -424,7 +415,10 @@ export function ScriptTerminalModal({ moveEvent.stopPropagation() const currentY = "touches" in moveEvent ? moveEvent.touches[0].clientY : moveEvent.clientY const deltaY = currentY - startY - const newHeight = Math.max(300, Math.min(2400, startHeight + deltaY)) + + const viewportHeight = window.innerHeight + const deltaVh = (deltaY / viewportHeight) * 100 + const newHeight = Math.max(30, Math.min(85, startHeight + deltaVh)) setModalHeight(newHeight) @@ -470,7 +464,10 @@ export function ScriptTerminalModal({ e.preventDefault()} onEscapeKeyDown={(e) => e.preventDefault()} hideClose @@ -497,18 +494,7 @@ export function ScriptTerminalModal({ )} - {(isTablet || (!isMobile && !isTablet)) && ( -
- -
- )} - - {isMobile && ( + {(isMobile || isTablet) && (