diff --git a/AppImage/components/script-terminal-modal.tsx b/AppImage/components/script-terminal-modal.tsx index 89f9f5e..cdf5e34 100644 --- a/AppImage/components/script-terminal-modal.tsx +++ b/AppImage/components/script-terminal-modal.tsx @@ -68,6 +68,9 @@ export function ScriptTerminalModal({ const [isResizing, setIsResizing] = useState(false) const resizeBarRef = useRef(null) + // Debug visual para tablets + const [debugInfo, setDebugInfo] = useState([]) + const terminalContainerRef = useRef(null) const sendKey = useCallback((key: string) => { @@ -388,6 +391,10 @@ export function ScriptTerminalModal({ e.preventDefault() e.stopPropagation() + const debugMsg = `[${new Date().toLocaleTimeString()}] Resize start - Type: ${e.type}, isMobile: ${isMobile}, isTablet: ${isTablet}` + console.log(debugMsg) + setDebugInfo(prev => [...prev.slice(-4), debugMsg]) + setIsResizing(true) // Detectar si es touch o mouse @@ -395,6 +402,10 @@ export function ScriptTerminalModal({ const startY = clientY const startHeight = modalHeight + const debugMsg2 = `Start Y: ${startY}, Start height: ${startHeight}` + console.log(debugMsg2) + setDebugInfo(prev => [...prev.slice(-4), debugMsg2]) + const handleMove = (moveEvent: MouseEvent | TouchEvent) => { const currentY = "touches" in moveEvent ? moveEvent.touches[0].clientY : moveEvent.clientY const deltaY = currentY - startY @@ -419,6 +430,10 @@ export function ScriptTerminalModal({ } const handleEnd = () => { + const debugMsg3 = `Resize end - Final height: ${modalHeight}` + console.log(debugMsg3) + setDebugInfo(prev => [...prev.slice(-4), debugMsg3]) + setIsResizing(false) document.removeEventListener("mousemove", handleMove as any) @@ -463,6 +478,15 @@ export function ScriptTerminalModal({ + {/* Debug panel - solo visible en tablets */} + {isTablet && debugInfo.length > 0 && ( +
+ {debugInfo.map((info, i) => ( +
{info}
+ ))} +
+ )} +