From 5cbf4cf352048761527c717caf9addc946bb4e2a Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Fri, 28 Jun 2024 14:24:34 +0100 Subject: [PATCH 01/12] style fix: padding and radius of question bubble --- frontend/src/conversation/ConversationBubble.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 3a3842b2..3e515bf6 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -42,7 +42,7 @@ const ConversationBubble = forwardRef< bubble = (
-
+
{message} From d4375217109f4eea74e907ac99ef37268c9a043d Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Fri, 28 Jun 2024 14:45:14 +0100 Subject: [PATCH 02/12] style fix: response bubble padding and radius --- frontend/src/conversation/ConversationBubble.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 3e515bf6..c82b5e69 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -68,7 +68,7 @@ const ConversationBubble = forwardRef< />
Date: Fri, 28 Jun 2024 15:16:55 +0100 Subject: [PATCH 03/12] style fix: gap between conversations wrapper and prompts input wrapper --- frontend/src/conversation/Conversation.tsx | 6 +++--- frontend/src/conversation/ConversationBubble.tsx | 2 +- frontend/src/index.css | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 4fb34186..d9088153 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -191,11 +191,11 @@ export default function Conversation() { }; return ( -
+
{queries.length > 0 && !hasScrolledToLast && (
-
+
Date: Fri, 28 Jun 2024 20:19:01 +0100 Subject: [PATCH 04/12] style: spacings... --- frontend/src/Hero.tsx | 2 +- frontend/src/conversation/Conversation.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/Hero.tsx b/frontend/src/Hero.tsx index 904dd279..b74d22f2 100644 --- a/frontend/src/Hero.tsx +++ b/frontend/src/Hero.tsx @@ -19,7 +19,7 @@ export default function Hero({ }>; return (
diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index d9088153..964c5c8f 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -191,7 +191,7 @@ export default function Conversation() { }; return ( -
+
Date: Tue, 2 Jul 2024 22:11:21 +0530 Subject: [PATCH 05/12] conversation bubble width fix --- frontend/src/conversation/ConversationBubble.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 3a3842b2..29e51890 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -53,7 +53,7 @@ const ConversationBubble = forwardRef< bubble = (
Date: Tue, 2 Jul 2024 19:48:19 +0100 Subject: [PATCH 06/12] gap between y-borders and prompts input + border-radius reduction as prompts input grows --- frontend/src/conversation/Conversation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index 964c5c8f..487e8ea7 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -235,7 +235,7 @@ export default function Conversation() {
-
+
Date: Wed, 3 Jul 2024 13:10:18 +0000 Subject: [PATCH 07/12] chore(deps): bump braces from 3.0.2 to 3.0.3 in /docs Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- docs/package-lock.json | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/package-lock.json b/docs/package-lock.json index 448e181a..164e0f15 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -3971,11 +3971,11 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==" }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5182,9 +5182,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -11712,6 +11712,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/typescript": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", + "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/unified": { "version": "10.1.2", "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", From 90c367842f64f435ac51d162a60b5543ae106e4b Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Thu, 4 Jul 2024 09:00:14 +0100 Subject: [PATCH 08/12] chore: added browser lang detector package by i18next --- frontend/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/package.json b/frontend/package.json index ebcbb3fe..3bc85d67 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,6 +22,7 @@ "@reduxjs/toolkit": "^1.9.2", "@vercel/analytics": "^0.1.10", "i18next": "^23.11.5", + "i18next-browser-languagedetector": "^8.0.0", "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.2.0", From 6727c42f1895c2534acb060d560ee6d1032d8e4c Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Thu, 4 Jul 2024 10:05:54 +0100 Subject: [PATCH 09/12] feat: auto browser lang detection on first visit --- frontend/src/locale/i18n.ts | 42 +++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/frontend/src/locale/i18n.ts b/frontend/src/locale/i18n.ts index 32b25db7..02c55938 100644 --- a/frontend/src/locale/i18n.ts +++ b/frontend/src/locale/i18n.ts @@ -1,29 +1,39 @@ import i18n from 'i18next'; import { initReactI18next } from 'react-i18next'; +import LanguageDetector from 'i18next-browser-languagedetector'; import en from './en.json'; //English import es from './es.json'; //Spanish import jp from './jp.json'; //Japanese import zh from './zh.json'; //Mandarin -i18n.use(initReactI18next).init({ - resources: { - en: { - translation: en, +i18n + .use(LanguageDetector) + .use(initReactI18next) + .init({ + resources: { + en: { + translation: en, + }, + es: { + translation: es, + }, + jp: { + translation: jp, + }, + zh: { + translation: zh, + }, }, - es: { - translation: es, + fallbackLng: 'en', + detection: { + order: ['localStorage', 'navigator'], // checks localStorage for existing lang before browser's + caches: ['localStorage'], //stores detected lang to localStorage with i18nextLng key + lookupLocalStorage: 'docsgpt-locale', //using docsgpt-locale as the custom key for storing and retrieving the lang rather than the default `i18nextLng` }, - jp: { - translation: jp, - }, - zh: { - translation: zh, - }, - }, -}); + }); -const locale = localStorage.getItem('docsgpt-locale') ?? 'en'; -i18n.changeLanguage(locale); +const savedLocale = localStorage.getItem('docsgpt-locale') ?? i18n.language; +i18n.changeLanguage(savedLocale); export default i18n; From 16ae0725e644e08832c8846a40c16662996be042 Mon Sep 17 00:00:00 2001 From: utin-francis-peter Date: Sat, 6 Jul 2024 20:41:21 +0100 Subject: [PATCH 10/12] chore: took off the option of looking-up docsgpt-locale lang key in localStorage on first load --- frontend/src/locale/i18n.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/src/locale/i18n.ts b/frontend/src/locale/i18n.ts index 02c55938..dbf5ae1b 100644 --- a/frontend/src/locale/i18n.ts +++ b/frontend/src/locale/i18n.ts @@ -27,13 +27,12 @@ i18n }, fallbackLng: 'en', detection: { - order: ['localStorage', 'navigator'], // checks localStorage for existing lang before browser's - caches: ['localStorage'], //stores detected lang to localStorage with i18nextLng key - lookupLocalStorage: 'docsgpt-locale', //using docsgpt-locale as the custom key for storing and retrieving the lang rather than the default `i18nextLng` + order: ['localStorage', 'navigator'], + caches: ['localStorage'], + lookupLocalStorage: 'docsgpt-locale', }, }); -const savedLocale = localStorage.getItem('docsgpt-locale') ?? i18n.language; -i18n.changeLanguage(savedLocale); +i18n.changeLanguage(i18n.language); export default i18n; From 7175bc059558aae8c750ad4c6f360ae28a6c5197 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 13:20:00 +0000 Subject: [PATCH 11/12] chore(deps-dev): bump braces in /extensions/web-widget Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] --- extensions/web-widget/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/extensions/web-widget/package-lock.json b/extensions/web-widget/package-lock.json index addedafe..05466a04 100644 --- a/extensions/web-widget/package-lock.json +++ b/extensions/web-widget/package-lock.json @@ -152,12 +152,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -294,9 +294,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" From 1224f94879cbb05b4bc587aa40b8407801bd327c Mon Sep 17 00:00:00 2001 From: FIRST_NAME LAST_NAME Date: Sun, 7 Jul 2024 21:52:20 +0530 Subject: [PATCH 12/12] moved the three icons to the bottom of conversation bubble --- .../src/conversation/ConversationBubble.tsx | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 415de9b3..fc5d469e 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -208,82 +208,82 @@ const ConversationBubble = forwardRef< )}
-
-
+
+
-
- -
+ > +
+
-
-
-
- +
+
+
+ { - handleFeedback?.('LIKE'); - setIsLikeClicked(true); - setIsDislikeClicked(false); - }} - onMouseEnter={() => setIsLikeHovered(true)} - onMouseLeave={() => setIsLikeHovered(false)} - > -
+ onClick={() => { + handleFeedback?.('LIKE'); + setIsLikeClicked(true); + setIsDislikeClicked(false); + }} + onMouseEnter={() => setIsLikeHovered(true)} + onMouseLeave={() => setIsLikeHovered(false)} + >
-
-
-
+
+
+
+ - { - handleFeedback?.('DISLIKE'); - setIsDislikeClicked(true); - setIsLikeClicked(false); - }} - onMouseEnter={() => setIsDislikeHovered(true)} - onMouseLeave={() => setIsDislikeHovered(false)} - > -
+ onClick={() => { + handleFeedback?.('DISLIKE'); + setIsDislikeClicked(true); + setIsLikeClicked(false); + }} + onMouseEnter={() => setIsDislikeHovered(true)} + onMouseLeave={() => setIsDislikeHovered(false)} + >