From 61f5de966236ebb239135c6c1e82021030ecaece Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Tue, 26 Mar 2024 16:19:41 +0800 Subject: [PATCH 1/5] fix: chat scroll (#2981) --- web/app/components/base/chat/chat/index.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/web/app/components/base/chat/chat/index.tsx b/web/app/components/base/chat/chat/index.tsx index 2e46f1e869..1b8ef36d05 100644 --- a/web/app/components/base/chat/chat/index.tsx +++ b/web/app/components/base/chat/chat/index.tsx @@ -9,7 +9,6 @@ import { useRef, } from 'react' import { useTranslation } from 'react-i18next' -import { useThrottleEffect } from 'ahooks' import { debounce } from 'lodash-es' import type { ChatConfig, @@ -92,10 +91,19 @@ const Chat: FC = ({ chatFooterInnerRef.current.style.width = `${chatContainerInnerRef.current.clientWidth}px` }, []) - useThrottleEffect(() => { + useEffect(() => { handleScrolltoBottom() handleWindowResize() - }, [chatList], { wait: 500 }) + }, [handleScrolltoBottom, handleWindowResize]) + + useEffect(() => { + if (chatContainerRef.current) { + requestAnimationFrame(() => { + handleScrolltoBottom() + handleWindowResize() + }) + } + }) useEffect(() => { window.addEventListener('resize', debounce(handleWindowResize)) From d2624b13a0b49388100b1ccf1e69b8f2314b1034 Mon Sep 17 00:00:00 2001 From: legao <837937787@qq.com> Date: Tue, 26 Mar 2024 09:22:01 +0000 Subject: [PATCH 2/5] fix: the issue of text overflow in the NavSelector component (#2976) --- web/app/components/header/nav/nav-selector/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/components/header/nav/nav-selector/index.tsx b/web/app/components/header/nav/nav-selector/index.tsx index f6108661da..5e9242a841 100644 --- a/web/app/components/header/nav/nav-selector/index.tsx +++ b/web/app/components/header/nav/nav-selector/index.tsx @@ -77,7 +77,9 @@ const NavSelector = ({ curNav, navs, createText, onCreate, onLoadmore }: INavSel - {nav.name} +
+ {nav.name} +
)) From 5e60204832e9ac901ff4e4be4c81a0848777b7cd Mon Sep 17 00:00:00 2001 From: legao <837937787@qq.com> Date: Tue, 26 Mar 2024 09:26:58 +0000 Subject: [PATCH 3/5] fix: progress bar issue (#2957) --- web/app/(commonLayout)/datasets/DatasetCard.tsx | 2 +- web/package.json | 2 +- web/yarn.lock | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/web/app/(commonLayout)/datasets/DatasetCard.tsx b/web/app/(commonLayout)/datasets/DatasetCard.tsx index 8e4f29af9d..ffcf9a6c0c 100644 --- a/web/app/(commonLayout)/datasets/DatasetCard.tsx +++ b/web/app/(commonLayout)/datasets/DatasetCard.tsx @@ -46,7 +46,7 @@ const DatasetCard = ({ return ( <> - +
diff --git a/web/package.json b/web/package.json index 513efdc657..5d3a3a9a67 100644 --- a/web/package.json +++ b/web/package.json @@ -49,7 +49,7 @@ "mermaid": "10.4.0", "negotiator": "^0.6.3", "next": "^14.0.4", - "next-nprogress-bar": "^2.1.2", + "next-nprogress-bar": "^2.3.8", "qrcode.react": "^3.1.0", "qs": "^6.11.1", "rc-textarea": "^1.5.2", diff --git a/web/yarn.lock b/web/yarn.lock index fb5c4509d9..463ba6d14b 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -4849,10 +4849,10 @@ negotiator@^0.6.3: resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== -next-nprogress-bar@^2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/next-nprogress-bar/-/next-nprogress-bar-2.1.2.tgz" - integrity sha512-2Df5d7fr6uPx+BX8MkoWCfl+RjG+uWI5mA399e5sEe8mbT3q/GIUvCXLzBgJBIISpKuMmdLAOYEzqpjlsRVOWw== +next-nprogress-bar@^2.3.8: + version "2.3.9" + resolved "https://registry.yarnpkg.com/next-nprogress-bar/-/next-nprogress-bar-2.3.9.tgz#f271abb7e1f6bc95b024256f8dcec041dd63bcdb" + integrity sha512-X4nJqpyXcqpXwcSyCzed8hKWnOCqzLaINVHdwokKpuJ76Qj8EGB9mPqwCcFhgXsvIdlzPLAKxq6ajPI9tSYmig== dependencies: nprogress "^0.2.0" @@ -4926,7 +4926,7 @@ npm-run-path@^5.1.0: nprogress@^0.2.0: version "0.2.0" - resolved "https://registry.npmjs.org/nprogress/-/nprogress-0.2.0.tgz" + resolved "https://registry.yarnpkg.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1" integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA== nth-check@^2.0.1: From 815beac35691d3ec31505cfc46def55438c6e50d Mon Sep 17 00:00:00 2001 From: Ricky <5317425+rickythink@users.noreply.github.com> Date: Wed, 27 Mar 2024 09:08:38 +0800 Subject: [PATCH 4/5] Fix the time in the annotation from 12-hour clock to 24-hour clock. (#2990) --- .../components/app/annotation/edit-annotation-modal/index.tsx | 2 +- web/app/components/app/annotation/list.tsx | 2 +- .../components/app/annotation/view-annotation-modal/index.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/components/app/annotation/edit-annotation-modal/index.tsx b/web/app/components/app/annotation/edit-annotation-modal/index.tsx index 5edf07240d..91d856ad8e 100644 --- a/web/app/components/app/annotation/edit-annotation-modal/index.tsx +++ b/web/app/components/app/annotation/edit-annotation-modal/index.tsx @@ -117,7 +117,7 @@ const EditAnnotationModal: FC = ({
{t('appAnnotation.editModal.removeThisCache')}
- {createdAt &&
{t('appAnnotation.editModal.createdAt')} {dayjs(createdAt * 1000).format('YYYY-MM-DD hh:mm')}
} + {createdAt &&
{t('appAnnotation.editModal.createdAt')} {dayjs(createdAt * 1000).format('YYYY-MM-DD HH:mm')}
}
) : undefined diff --git a/web/app/components/app/annotation/list.tsx b/web/app/components/app/annotation/list.tsx index 093c42b76c..03ceb09bc8 100644 --- a/web/app/components/app/annotation/list.tsx +++ b/web/app/components/app/annotation/list.tsx @@ -54,7 +54,7 @@ const List: FC = ({ className='whitespace-nowrap overflow-hidden text-ellipsis max-w-[250px]' title={item.answer} >{item.answer} - {dayjs(item.created_at * 1000).format('YYYY-MM-DD hh:mm')} + {dayjs(item.created_at * 1000).format('YYYY-MM-DD HH:mm')} {item.hit_count} e.stopPropagation()}> {/* Actions */} diff --git a/web/app/components/app/annotation/view-annotation-modal/index.tsx b/web/app/components/app/annotation/view-annotation-modal/index.tsx index 5674c59d6d..16a95b823e 100644 --- a/web/app/components/app/annotation/view-annotation-modal/index.tsx +++ b/web/app/components/app/annotation/view-annotation-modal/index.tsx @@ -142,7 +142,7 @@ const ViewAnnotationModal: FC = ({ >{item.response} {item.source} {item.score ? item.score.toFixed(2) : '-'} - {dayjs(item.created_at * 1000).format('YYYY-MM-DD hh:mm')} + {dayjs(item.created_at * 1000).format('YYYY-MM-DD HH:mm')} ))} @@ -214,7 +214,7 @@ const ViewAnnotationModal: FC = ({
{t('appAnnotation.editModal.removeThisCache')}
-
{t('appAnnotation.editModal.createdAt')} {dayjs(createdAt * 1000).format('YYYY-MM-DD hh:mm')}
+
{t('appAnnotation.editModal.createdAt')} {dayjs(createdAt * 1000).format('YYYY-MM-DD HH:mm')}
) : undefined} From 13694293e3ba33d75dbbb14258fd9cfb685f538f Mon Sep 17 00:00:00 2001 From: Kenny Date: Wed, 27 Mar 2024 09:58:41 +0800 Subject: [PATCH 5/5] fix: resolve header.uid' length must be less or equal than 32 on Spark V1.5 (#2983) --- api/core/model_runtime/model_providers/spark/llm/_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/spark/llm/_client.py b/api/core/model_runtime/model_providers/spark/llm/_client.py index a4659454ee..4c8790141d 100644 --- a/api/core/model_runtime/model_providers/spark/llm/_client.py +++ b/api/core/model_runtime/model_providers/spark/llm/_client.py @@ -148,7 +148,8 @@ class SparkLLMClient: data = { "header": { "app_id": self.app_id, - "uid": user_id + # resolve this error message => $.header.uid' length must be less or equal than 32 + "uid": user_id[:32] if user_id else None }, "parameter": { "chat": {