From 0bad1a479f642c8c5183017641656d52c4b33c61 Mon Sep 17 00:00:00 2001 From: NamH Date: Thu, 25 Apr 2024 17:24:29 +0700 Subject: [PATCH 01/26] fix: remove scroll animation chat screen (#2819) Signed-off-by: James Co-authored-by: James --- web/containers/ListContainer/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/containers/ListContainer/index.tsx b/web/containers/ListContainer/index.tsx index fdf34b9ec..0d3e6de61 100644 --- a/web/containers/ListContainer/index.tsx +++ b/web/containers/ListContainer/index.tsx @@ -12,7 +12,7 @@ const ListContainer: React.FC = ({ children }) => { listRef.current?.scrollTo({ top: scrollHeight, - behavior: 'smooth', + behavior: 'instant', }) }) From ce2d8e540582a73423efed02dbe484e213cdf0fe Mon Sep 17 00:00:00 2001 From: NamH Date: Thu, 2 May 2024 21:02:05 +0700 Subject: [PATCH 02/26] chore: remove nutjs (#2860) Signed-off-by: James Co-authored-by: James --- electron/package.json | 3 +-- electron/utils/selectedText.ts | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/electron/package.json b/electron/package.json index 7f1c978e4..f012055e2 100644 --- a/electron/package.json +++ b/electron/package.json @@ -95,8 +95,7 @@ "pacote": "^17.0.4", "request": "^2.88.2", "request-progress": "^3.0.0", - "ulidx": "^2.3.0", - "@nut-tree/nut-js": "^4.0.0" + "ulidx": "^2.3.0" }, "devDependencies": { "@electron/notarize": "^2.1.0", diff --git a/electron/utils/selectedText.ts b/electron/utils/selectedText.ts index 25d31fab5..f76146d13 100644 --- a/electron/utils/selectedText.ts +++ b/electron/utils/selectedText.ts @@ -1,23 +1,24 @@ import { clipboard, globalShortcut } from 'electron' -import { keyboard, Key } from '@nut-tree/nut-js' /** * Gets selected text by synthesizing the keyboard shortcut * "CommandOrControl+c" then reading text from the clipboard */ export const getSelectedText = async () => { - const currentClipboardContent = clipboard.readText() // preserve clipboard content - clipboard.clear() - const hotkeys: Key[] = [ - process.platform === 'darwin' ? Key.LeftCmd : Key.LeftControl, - Key.C, - ] - await keyboard.pressKey(...hotkeys) - await keyboard.releaseKey(...hotkeys) - await new Promise((resolve) => setTimeout(resolve, 200)) // add a delay before checking clipboard - const selectedText = clipboard.readText() - clipboard.writeText(currentClipboardContent) - return selectedText + // TODO: Implement this function + // const currentClipboardContent = clipboard.readText() // preserve clipboard content + // clipboard.clear() + // const hotkeys: Key[] = [ + // process.platform === 'darwin' ? Key.LeftCmd : Key.LeftControl, + // Key.C, + // ] + // await keyboard.pressKey(...hotkeys) + // await keyboard.releaseKey(...hotkeys) + // await new Promise((resolve) => setTimeout(resolve, 200)) // add a delay before checking clipboard + // const selectedText = clipboard.readText() + // clipboard.writeText(currentClipboardContent) + // return selectedText + return '' } /** From c6182ab59c0bb54ce476b47a05f423fa77cc00d8 Mon Sep 17 00:00:00 2001 From: Quentin Macheda <69113642+QuentinMacheda@users.noreply.github.com> Date: Fri, 3 May 2024 04:17:05 +0100 Subject: [PATCH 03/26] Customize scroll-bar style (#2857) --- uikit/src/main.scss | 1 + uikit/src/scroll-area/styles.scss | 35 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/uikit/src/main.scss b/uikit/src/main.scss index f3294e12e..4aa044034 100644 --- a/uikit/src/main.scss +++ b/uikit/src/main.scss @@ -45,6 +45,7 @@ --border: 20 5.9% 90%; --input: 20 5.9% 90%; --ring: 20 14.3% 4.1%; + --scroll-bar: 60, 3%, 86%; .primary-blue { --primary: 221 83% 53%; diff --git a/uikit/src/scroll-area/styles.scss b/uikit/src/scroll-area/styles.scss index a6e1caf3a..3b076ffc2 100644 --- a/uikit/src/scroll-area/styles.scss +++ b/uikit/src/scroll-area/styles.scss @@ -21,3 +21,38 @@ @apply bg-border relative z-50 w-[10px] rounded-full; } } + +// Customized scroll bar +::-webkit-scrollbar { + width: 7px; +} + +::-webkit-scrollbar-thumb { + background-color: hsl(var(--scroll-bar)); + border-radius: 4px; +} + +::-webkit-scrollbar-track { + background-color: hsl(var(--background)); +} + +::-webkit-scrollbar-corner { + background-color: hsl(var(--background)); +} + +::-moz-scrollbar { + width: 7px; +} + +::-moz-scrollbar-thumb { + background-color: hsl(var(--scroll-bar)); + border-radius: 4px; +} + +::-moz-scrollbar-track { + background-color: hsl(var(--background)); +} + +::-moz-scrollbar-corner { + background-color: hsl(var(--background)); +} From 2016eae0c9e62a841df25011a86886a1b37ea572 Mon Sep 17 00:00:00 2001 From: Quentin Macheda <69113642+QuentinMacheda@users.noreply.github.com> Date: Fri, 3 May 2024 09:11:29 +0100 Subject: [PATCH 04/26] Remove hidden overflow property of tailwind + Update buttons position (under textarea) (#2856) Please be aware of the lint prettier failed --- web/screens/Chat/EditChatInput/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/screens/Chat/EditChatInput/index.tsx b/web/screens/Chat/EditChatInput/index.tsx index fba4b0b8a..e40e1effd 100644 --- a/web/screens/Chat/EditChatInput/index.tsx +++ b/web/screens/Chat/EditChatInput/index.tsx @@ -129,11 +129,11 @@ const EditChatInput: React.FC = ({ message }) => { } return ( -
+