From d7b1310ba3681ed9b2975cccf1c4362ec4418517 Mon Sep 17 00:00:00 2001 From: FIRST_NAME LAST_NAME Date: Tue, 2 Jul 2024 22:11:21 +0530 Subject: [PATCH 1/6] 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: Thu, 4 Jul 2024 09:00:14 +0100 Subject: [PATCH 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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)} + >