From 98704fdb28c52766edcd51814f446341943a8a88 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Wed, 11 Sep 2024 19:39:27 +0800 Subject: [PATCH] docs: Update translations and UI for better readability. - Updated English translations in internationalization resources to simplify search assistant placeholder. - Removed unused import, improved text search UI and adjusted font sizes for better readability. --- src/renderer/src/i18n/index.ts | 4 ++-- src/renderer/src/pages/home/Assistants.tsx | 22 +++++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/renderer/src/i18n/index.ts b/src/renderer/src/i18n/index.ts index a3933d6c..aeeaa4b3 100644 --- a/src/renderer/src/i18n/index.ts +++ b/src/renderer/src/i18n/index.ts @@ -100,7 +100,7 @@ const resources = { 'suggestions.title': 'Suggested Questions', 'add.assistant.title': 'Add Assistant', 'message.new.context': 'New Context', - 'assistant.search.placeholder': 'Search Assistants' + 'assistant.search.placeholder': 'Search' }, agents: { title: 'Assistants', @@ -356,7 +356,7 @@ const resources = { 'suggestions.title': '建议的问题', 'add.assistant.title': '添加智能体', 'message.new.context': '清除上下文', - 'assistant.search.placeholder': '搜索智能体' + 'assistant.search.placeholder': '搜索' }, agents: { title: '智能体', diff --git a/src/renderer/src/pages/home/Assistants.tsx b/src/renderer/src/pages/home/Assistants.tsx index 0dfe2468..002c9b2e 100644 --- a/src/renderer/src/pages/home/Assistants.tsx +++ b/src/renderer/src/pages/home/Assistants.tsx @@ -1,9 +1,8 @@ -import { DeleteOutlined, EditOutlined, MinusCircleOutlined, SearchOutlined } from '@ant-design/icons' +import { DeleteOutlined, EditOutlined, MinusCircleOutlined } from '@ant-design/icons' import DragableList from '@renderer/components/DragableList' import CopyIcon from '@renderer/components/Icons/CopyIcon' import AssistantSettingPopup from '@renderer/components/Popups/AssistantSettingPopup' import { useAssistant, useAssistants } from '@renderer/hooks/useAssistant' -import { useRuntime } from '@renderer/hooks/useStore' import { getDefaultTopic, syncAsistantToAgent } from '@renderer/services/assistant' import { EVENT_NAMES, EventEmitter } from '@renderer/services/event' import { useAppDispatch, useAppSelector } from '@renderer/store' @@ -30,7 +29,6 @@ const Assistants: FC = ({ activeAssistant, setActiveAssistant, onCreateAs const { updateAssistant, removeAllTopics } = useAssistant(activeAssistant.id) const searchRef = useRef(null) const { t } = useTranslation() - const { searching } = useRuntime() const dispatch = useAppDispatch() const onDelete = useCallback( @@ -156,12 +154,10 @@ const Assistants: FC = ({ activeAssistant, setActiveAssistant, onCreateAs } suffix={⌘+K} value={search} onChange={(e) => setSearch(e.target.value)} - style={{ borderRadius: 4 }} + style={{ borderRadius: 4, borderWidth: 0.5 }} onKeyDown={onSearch} ref={searchRef} onFocus={() => dispatch(setSearching(true))} @@ -257,14 +253,14 @@ const ArrowRightButton = styled.div` background-color: var(--color-background); right: 9px; top: 6px; - .anticon { - font-size: 14px; + .iconfont { + font-size: 12px; } ` const TopicCount = styled.div` - color: var(--color-text-3); - font-size: 12px; + color: var(--color-text-2); + font-size: 10px; margin-right: 3px; background-color: var(--color-background-mute); opacity: 0.8; @@ -283,11 +279,11 @@ const SearchContainer = styled.div` ` const CommandKey = styled.div` - color: var(--color-text-3); - font-size: 11px; + color: var(--color-text-2); + font-size: 10px; padding: 2px 5px; border-radius: 4px; - background-color: var(--color-background-mute); + background-color: var(--color-background); margin-right: -4px; `