From 5abd94fc95a7c2ab9342fc1f61b64e669ae76eb7 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Fri, 7 Oct 2022 17:44:47 +0900 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EA=B8=80=EC=9E=90=20=EC=9E=98=EB=A6=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/sidePanel/testcaseList/SelectTestcaseItem.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/sidePanel/testcaseList/SelectTestcaseItem.tsx b/src/components/sidePanel/testcaseList/SelectTestcaseItem.tsx index fb795c2..3b83d02 100644 --- a/src/components/sidePanel/testcaseList/SelectTestcaseItem.tsx +++ b/src/components/sidePanel/testcaseList/SelectTestcaseItem.tsx @@ -36,10 +36,13 @@ const StyledItem = styled.div<{ selected: boolean }>` grid-template-columns: 10px minmax(16px, 1fr) max-content; align-items: center; + height: 40px; + line-height: 40px; + cursor: pointer; border-radius: 6px; margin: 0 10px; - padding: 10px 15px; + padding: 0 15px; ${(props) => props.selected && From aa8c5857a6aeb816373d5335b1f4162af67ba5d0 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Sat, 8 Oct 2022 03:13:27 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat:=20=EC=A0=9C=EB=AA=A9=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/testcase/TestcaseInfo.tsx | 42 +++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/components/testcase/TestcaseInfo.tsx b/src/components/testcase/TestcaseInfo.tsx index c7d075a..ef9d5d0 100644 --- a/src/components/testcase/TestcaseInfo.tsx +++ b/src/components/testcase/TestcaseInfo.tsx @@ -1,6 +1,7 @@ -import { Button, Editable, EditableInput, EditablePreview } from "@chakra-ui/react"; +import { Button, Editable, EditableInput, EditablePreview, useEditableControls } from "@chakra-ui/react"; import styled from "@emotion/styled"; -import { FC } from "react"; +import { FC, ReactNode } from "react"; +import { MdEdit } from "react-icons/md"; import { useRecoilValue } from "recoil"; import useTestcaseCommand from "@/commands/useTestcaseCommand"; @@ -18,8 +19,20 @@ const TestcaseInfo: FC = ({ testcaseId }) => { return ( - command.changeValue(testcaseId, { name })} fontSize={20}> - + command.changeValue(testcaseId, { name })} + fontSize={20}> + + + @@ -41,3 +54,24 @@ const Name = styled(Editable)` align-self: center; margin: 0 10px; `; + +const WithEditButton = ({ children }: { children: ReactNode }) => { + const { isEditing, getEditButtonProps } = useEditableControls(); + + return isEditing ? ( + <> + ) : ( + + {children} + + + ); +}; + +const StyledWithEditButton = styled.div` + display: grid; + grid-template-columns: minmax(16px, 1fr) 20px; + align-items: center; +`; From 2e52caa6fbd3e22909274e5202476d83ed71a530 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Tue, 11 Oct 2022 03:57:13 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20=EB=B2=84=EC=A0=84=20=ED=91=9C?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/index.ts | 4 +++- index.html | 1 - package.json | 1 + tsconfig.json | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 79b7e25..21b1207 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -5,6 +5,8 @@ import { autoUpdater } from "electron-updater"; import { release } from "os"; import { join } from "path"; +import { version } from "../../package.json"; + // Disable GPU Acceleration for Windows 7 if (release().startsWith("6.1")) app.disableHardwareAcceleration(); @@ -39,7 +41,7 @@ const indexHtml = join(ROOT_PATH.dist, "index.html"); async function createWindow() { win = new BrowserWindow({ - title: "RunTC", + title: "RunTC - " + version, icon: join(ROOT_PATH.public, "favicon.svg"), autoHideMenuBar: true, webPreferences: { diff --git a/index.html b/index.html index 40a3632..cc3a7d4 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ - RunTC
diff --git a/package.json b/package.json index f3ae467..4751c23 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@vitejs/plugin-react": "^2.0.1", "allotment": "^1.17.0", "await-to-js": "^3.0.0", + "compare-versions": "^5.0.1", "electron": "^20.0.2", "electron-builder": "^23.3.3", "electron-log": "^4.4.8", diff --git a/tsconfig.json b/tsconfig.json index 19a99be..e83dda8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,7 @@ "noEmit": true, "jsx": "react-jsx" }, + "include": ["src"], "exclude": ["src/**/*.test.ts"], "references": [{ "path": "./tsconfig.node.json" }], From 0a17332974d48e0f72dfe0d96e819f22f5d26d8f Mon Sep 17 00:00:00 2001 From: Tekiter Date: Tue, 11 Oct 2022 04:11:22 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat:=20=EC=95=A1=EC=85=98=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/testcase/TestcaseInfo.tsx | 70 ++++++++++++++++-------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/src/components/testcase/TestcaseInfo.tsx b/src/components/testcase/TestcaseInfo.tsx index ef9d5d0..3e75570 100644 --- a/src/components/testcase/TestcaseInfo.tsx +++ b/src/components/testcase/TestcaseInfo.tsx @@ -1,7 +1,7 @@ import { Button, Editable, EditableInput, EditablePreview, useEditableControls } from "@chakra-ui/react"; import styled from "@emotion/styled"; import { FC, ReactNode } from "react"; -import { MdEdit } from "react-icons/md"; +import { MdDelete, MdEdit, MdPlayArrow } from "react-icons/md"; import { useRecoilValue } from "recoil"; import useTestcaseCommand from "@/commands/useTestcaseCommand"; @@ -19,37 +19,61 @@ const TestcaseInfo: FC = ({ testcaseId }) => { return ( - command.changeValue(testcaseId, { name })} - fontSize={20}> - - - - - - - + + command.changeValue(testcaseId, { name })} + fontSize={20}> + + + + + + + + + + + ); }; export default TestcaseInfo; -const StyledTestcaseInfo = styled.div` +const StyledTestcaseInfo = styled.div``; + +const NameBox = styled.div` + margin-top: 10px; + height: 40px; +`; + +const ActionBox = styled.div` display: flex; - height: 3.5rem; + margin: 0 5px; `; -const Name = styled(Editable)` +const Spacer = styled.div` flex-grow: 1; +`; + +const Name = styled(Editable)` font-weight: 500; align-self: center; margin: 0 10px; @@ -72,6 +96,6 @@ const WithEditButton = ({ children }: { children: ReactNode }) => { const StyledWithEditButton = styled.div` display: grid; - grid-template-columns: minmax(16px, 1fr) 20px; + grid-template-columns: max-content 20px 1fr; align-items: center; `; From 0f40a4e6355ab6aac4e346e9b5deae21d440c0a4 Mon Sep 17 00:00:00 2001 From: Tekiter Date: Tue, 11 Oct 2022 10:23:41 +0900 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=ED=84=B0=EB=AF=B8=EB=84=90=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/testcase/TerminalOutput.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/testcase/TerminalOutput.tsx b/src/components/testcase/TerminalOutput.tsx index 28e5d85..03bbaa0 100644 --- a/src/components/testcase/TerminalOutput.tsx +++ b/src/components/testcase/TerminalOutput.tsx @@ -26,6 +26,8 @@ const TerminalOutput: FC = ({ content }) => { const term = new Terminal({ fontFamily: "consolas", + convertEol: true, + disableStdin: true, }); const fitAddon = new FitAddon(); From aa5c41ec90429ba8c78c52a9e9cf0a169cb7593a Mon Sep 17 00:00:00 2001 From: Tekiter Date: Tue, 11 Oct 2022 10:38:45 +0900 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20=EA=B2=B0=EA=B3=BC=20=EB=AF=B8?= =?UTF-8?q?=EB=A6=AC=EB=B3=B4=EA=B8=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/testcase/TestcaseInfo.tsx | 40 ++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/components/testcase/TestcaseInfo.tsx b/src/components/testcase/TestcaseInfo.tsx index 3e75570..0069915 100644 --- a/src/components/testcase/TestcaseInfo.tsx +++ b/src/components/testcase/TestcaseInfo.tsx @@ -1,4 +1,5 @@ import { Button, Editable, EditableInput, EditablePreview, useEditableControls } from "@chakra-ui/react"; +import { css } from "@emotion/react"; import styled from "@emotion/styled"; import { FC, ReactNode } from "react"; import { MdDelete, MdEdit, MdPlayArrow } from "react-icons/md"; @@ -7,6 +8,9 @@ import { useRecoilValue } from "recoil"; import useTestcaseCommand from "@/commands/useTestcaseCommand"; import useTestcaseRunner from "@/commands/useTestcaseRunner"; import { testcaseFamily } from "@/states/testcase"; +import { TestcaseResult, testcaseResultFamily } from "@/states/testcaseResult"; + +import { getResultColor, getResultDescription } from "../common/renderResultUtil"; interface TestcaseInfoProps { testcaseId: string; @@ -16,6 +20,7 @@ const TestcaseInfo: FC = ({ testcaseId }) => { const command = useTestcaseCommand(); const runner = useTestcaseRunner(); const testcase = useRecoilValue(testcaseFamily(testcaseId)); + const result = useRecoilValue(testcaseResultFamily(testcaseId)); return ( @@ -38,16 +43,25 @@ const TestcaseInfo: FC = ({ testcaseId }) => {
- + + + {getResultDescription(result)} + @@ -66,7 +80,21 @@ const NameBox = styled.div` const ActionBox = styled.div` display: flex; - margin: 0 5px; + margin: 0 8px; +`; + +const ActionBoxLeft = styled.div` + display: flex; + align-items: center; +`; + +const Result = styled.div<{ status: TestcaseResult }>` + margin-left: 0.8rem; + font-size: 0.85rem; + + ${(props) => css` + color: ${getResultColor(props.status)}; + `} `; const Spacer = styled.div` From b2180b23283af2539915ebad2b89990c5aaf783b Mon Sep 17 00:00:00 2001 From: Tekiter Date: Tue, 11 Oct 2022 10:57:29 +0900 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20=EB=A7=A5=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/states/executableTarget.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/states/executableTarget.ts b/src/states/executableTarget.ts index c82d86b..33576aa 100644 --- a/src/states/executableTarget.ts +++ b/src/states/executableTarget.ts @@ -13,6 +13,8 @@ export const executableTargetFilenameSelector = selector({ return null; } - return path.split("\\").at(-1) ?? null; + const matches = path.match(/.+[\\/\\]([^\\/\\]+)/); + + return matches?.[1] ?? null; }, });