Skip to content

Commit

Permalink
docs: Update translations and UI for better readability.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
kangfenmao committed Sep 11, 2024
1 parent fd5cba5 commit 98704fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/renderer/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -356,7 +356,7 @@ const resources = {
'suggestions.title': '建议的问题',
'add.assistant.title': '添加智能体',
'message.new.context': '清除上下文',
'assistant.search.placeholder': '搜索智能体'
'assistant.search.placeholder': '搜索'
},
agents: {
title: '智能体',
Expand Down
22 changes: 9 additions & 13 deletions src/renderer/src/pages/home/Assistants.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -30,7 +29,6 @@ const Assistants: FC<Props> = ({ activeAssistant, setActiveAssistant, onCreateAs
const { updateAssistant, removeAllTopics } = useAssistant(activeAssistant.id)
const searchRef = useRef<InputRef>(null)
const { t } = useTranslation()
const { searching } = useRuntime()
const dispatch = useAppDispatch()

const onDelete = useCallback(
Expand Down Expand Up @@ -156,12 +154,10 @@ const Assistants: FC<Props> = ({ activeAssistant, setActiveAssistant, onCreateAs
<SearchContainer>
<Input
placeholder={t('chat.assistant.search.placeholder')}
variant="filled"
prefix={<SearchOutlined style={{ color: 'var(--color-icon)' }} />}
suffix={<CommandKey>⌘+K</CommandKey>}
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))}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
`

Expand Down

0 comments on commit 98704fd

Please sign in to comment.