diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index c864c1be0..806b5f399 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -77,6 +77,16 @@ interface IProps { const useStyles = makeStyles((theme: Theme) => createStyles({ + title: { + "&.is-minimized + *": { + border: "none", + margin: 0, + "max-height": 0, + padding: 0, + "pointer-events": "none", + visibility: "hidden" + }, + }, logs: { overflowY: "scroll", overflowX: "hidden", @@ -107,6 +117,7 @@ function LogWindow(props: IProps): React.ReactElement { const classes = useStyles(); const container = useRef(null); const setRerender = useState(false)[1]; + const [minimized, setMinimized] = useState(false); function rerender(): void { setRerender((old) => !old); } @@ -140,15 +151,19 @@ function LogWindow(props: IProps): React.ReactElement { rerender(); } - function title(): string { + function title(full = false): string { const maxLength = 30; const t = `${script.filename} ${script.args.map((x: any): string => `${x}`).join(" ")}`; - if (t.length <= maxLength) { + if (full || t.length <= maxLength) { return t; } return t.slice(0, maxLength - 3) + "..."; } + function minimize(): void { + setMinimized(!minimized); + } + function lineClass(s: string): string { if (s.match(/(^\[[^\]]+\] )?ERROR/) || s.match(/(^\[[^\]]+\] )?FAIL/)) { return classes.error; @@ -180,18 +195,20 @@ function LogWindow(props: IProps): React.ReactElement { >
- + {title()} {!workerScripts.has(script.pid) && } {workerScripts.has(script.pid) && } +