From f3f84ab9af54646aac1000d04bcec9bd52322bac Mon Sep 17 00:00:00 2001 From: williamhliu <137068196+williamhliu@users.noreply.github.com> Date: Mon, 4 Sep 2023 16:26:58 +0800 Subject: [PATCH] [improvement](webapp) optimize agent background color and remove entity metric tip (#54) * [improvement](webapp) optimize agent background color and remove entity metric tip --- .../src/components/ChatItem/ParseTip.tsx | 2 +- .../src/pages/Chat/AgentList/style.less | 20 +++++++++++-------- .../src/pages/Chat/MessageContainer/index.tsx | 2 -- .../supersonic-fe/src/pages/Chat/index.tsx | 3 +-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx b/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx index 03cd3fd46..f4e0e6000 100644 --- a/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx +++ b/webapp/packages/chat-sdk/src/components/ChatItem/ParseTip.tsx @@ -166,7 +166,7 @@ const ParseTip: React.FC = ({
{modelName}
)} - {queryMode !== 'ENTITY_ID' && metric && ( + {!queryMode.includes('ENTITY') && metric && (
指标:
{metric.name}
diff --git a/webapp/packages/supersonic-fe/src/pages/Chat/AgentList/style.less b/webapp/packages/supersonic-fe/src/pages/Chat/AgentList/style.less index e2df0d7ac..b9eab2b4e 100644 --- a/webapp/packages/supersonic-fe/src/pages/Chat/AgentList/style.less +++ b/webapp/packages/supersonic-fe/src/pages/Chat/AgentList/style.less @@ -42,15 +42,7 @@ border-radius: 8px; cursor: pointer; - &:hover, - &.active { - background: #f0f0f0; - } - .avatar { - // width: 40px; - // height: 40px; - // border-radius: 8px; font-size: 40px; } @@ -73,6 +65,18 @@ text-overflow: ellipsis; } } + + // &:hover { + // background: #f0f0f0; + // } + + &:hover, &.active { + background: #22a5f7; + + .agentName, .agentDesc { + color: #fff; + } + } } } } diff --git a/webapp/packages/supersonic-fe/src/pages/Chat/MessageContainer/index.tsx b/webapp/packages/supersonic-fe/src/pages/Chat/MessageContainer/index.tsx index 9906dfc3b..8042b460e 100644 --- a/webapp/packages/supersonic-fe/src/pages/Chat/MessageContainer/index.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Chat/MessageContainer/index.tsx @@ -6,7 +6,6 @@ import type { MsgDataType } from 'supersonic-chat-sdk'; import { AgentType, MessageItem, MessageTypeEnum } from '../type'; import { isMobile, updateMessageContainerScroll } from '@/utils/utils'; import styles from './style.less'; -import { MODEL_MODEL_ENTITY_ID_FILTER_MAP } from '../constants'; import AgentTip from '../components/AgentTip'; import classNames from 'classnames'; @@ -63,7 +62,6 @@ const MessageContainer: React.FC = ({ } return [ { - ...MODEL_MODEL_ENTITY_ID_FILTER_MAP[modelId], value: entityId, }, ]; diff --git a/webapp/packages/supersonic-fe/src/pages/Chat/index.tsx b/webapp/packages/supersonic-fe/src/pages/Chat/index.tsx index fa48b9980..53d42f12e 100644 --- a/webapp/packages/supersonic-fe/src/pages/Chat/index.tsx +++ b/webapp/packages/supersonic-fe/src/pages/Chat/index.tsx @@ -16,7 +16,7 @@ import { useThrottleFn } from 'ahooks'; import Conversation from './Conversation'; import ChatFooter from './ChatFooter'; import classNames from 'classnames'; -import { CHAT_TITLE, DEFAULT_CONVERSATION_NAME, MOBILE_TITLE, WEB_TITLE } from './constants'; +import { CHAT_TITLE, DEFAULT_CONVERSATION_NAME, WEB_TITLE } from './constants'; import { HistoryMsgItemType, MsgDataType, getHistoryMsg } from 'supersonic-chat-sdk'; import { cloneDeep } from 'lodash'; import 'supersonic-chat-sdk/dist/index.css'; @@ -364,7 +364,6 @@ const Chat: React.FC = ({ return (
{!isMobileMode && } - {isMobile && }
{!isMobile && (