Update AppImage

This commit is contained in:
MacRimi
2025-11-24 11:01:48 +01:00
parent da793856ce
commit 1ba45200ee

View File

@@ -171,6 +171,10 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
resizeStartY.current = e.clientY resizeStartY.current = e.clientY
resizeStartHeight.current = terminalHeight resizeStartHeight.current = terminalHeight
e.preventDefault() e.preventDefault()
e.stopPropagation()
// Deshabilitar selección de texto durante el resize
document.body.style.userSelect = "none"
document.body.style.cursor = "ns-resize"
}, },
[isMobile, terminalHeight], [isMobile, terminalHeight],
) )
@@ -179,6 +183,9 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
(e: MouseEvent) => { (e: MouseEvent) => {
if (!isResizing) return if (!isResizing) return
e.preventDefault()
e.stopPropagation()
const deltaY = e.clientY - resizeStartY.current const deltaY = e.clientY - resizeStartY.current
const newHeight = Math.max(200, Math.min(1200, resizeStartHeight.current + deltaY)) const newHeight = Math.max(200, Math.min(1200, resizeStartHeight.current + deltaY))
setTerminalHeight(newHeight) setTerminalHeight(newHeight)
@@ -190,15 +197,19 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
if (!isResizing) return if (!isResizing) return
setIsResizing(false) setIsResizing(false)
localStorage.setItem("terminalHeight", terminalHeight.toString()) localStorage.setItem("terminalHeight", terminalHeight.toString())
// Restaurar selección de texto y cursor
document.body.style.userSelect = ""
document.body.style.cursor = ""
}, [isResizing, terminalHeight]) }, [isResizing, terminalHeight])
useEffect(() => { useEffect(() => {
if (isResizing) { if (isResizing) {
document.addEventListener("mousemove", handleMouseMove) // Agregar capture: true para mejor compatibilidad
document.addEventListener("mouseup", handleResizeEnd) document.addEventListener("mousemove", handleMouseMove, { capture: true })
document.addEventListener("mouseup", handleResizeEnd, { capture: true })
return () => { return () => {
document.removeEventListener("mousemove", handleMouseMove) document.removeEventListener("mousemove", handleMouseMove, { capture: true })
document.removeEventListener("mouseup", handleResizeEnd) document.removeEventListener("mouseup", handleResizeEnd, { capture: true })
} }
} }
}, [isResizing, handleMouseMove, handleResizeEnd]) }, [isResizing, handleMouseMove, handleResizeEnd])
@@ -359,10 +370,12 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
import("xterm/css/xterm.css"), import("xterm/css/xterm.css"),
]).then(([Terminal, FitAddon]) => [Terminal, FitAddon]) ]).then(([Terminal, FitAddon]) => [Terminal, FitAddon])
const fontSize = window.innerWidth < 768 ? 12 : 16
const term = new TerminalClass({ const term = new TerminalClass({
rendererType: "dom", rendererType: "dom",
fontFamily: '"Courier", "Courier New", "Liberation Mono", "DejaVu Sans Mono", monospace', fontFamily: '"Courier", "Courier New", "Liberation Mono", "DejaVu Sans Mono", monospace',
fontSize: isMobile ? 12 : 16, fontSize: fontSize,
lineHeight: 1, lineHeight: 1,
cursorBlink: true, cursorBlink: true,
scrollback: 2000, scrollback: 2000,