From 169d3e6c77461b7653c7b375d4bd7be7d7f4d9ae Mon Sep 17 00:00:00 2001 From: theit8514 Date: Sun, 26 Dec 2021 17:33:15 -0500 Subject: [PATCH 1/2] Add title attribute to log title bar --- src/ui/React/LogBoxManager.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index c864c1be0..f30c8c4a9 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -140,10 +140,10 @@ 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) + "..."; @@ -185,7 +185,7 @@ function LogWindow(props: IProps): React.ReactElement { }} > - + {title()} From 5607561c50f8f684d1833f3a8c97985ec486ad6c Mon Sep 17 00:00:00 2001 From: theit8514 Date: Sun, 26 Dec 2021 17:38:25 -0500 Subject: [PATCH 2/2] Add minimize button to log windows --- src/ui/React/LogBoxManager.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index f30c8c4a9..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); } @@ -149,6 +160,10 @@ function LogWindow(props: IProps): React.ReactElement { 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,6 +195,7 @@ function LogWindow(props: IProps): React.ReactElement { >
{!workerScripts.has(script.pid) && } {workerScripts.has(script.pid) && } +