feat(migrate, websearch): enable enhanceMode in websearch and update migration logic

This commit is contained in:
kangfenmao 2025-04-13 22:41:41 +08:00
parent 64200b00a9
commit 24e46efa0c
4 changed files with 17 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { useShortcut, useShortcutDisplay } from '@renderer/hooks/useShortcuts'
import { Tooltip } from 'antd'
import { CircleFadingPlus } from 'lucide-react'
import { Eraser } from 'lucide-react'
import { FC } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
@ -20,7 +20,7 @@ const NewContextButton: FC<Props> = ({ onNewContext, ToolbarButton }) => {
<Container>
<Tooltip placement="top" title={t('chat.input.new.context', { Command: newContextShortcut })} arrow>
<ToolbarButton type="text" onClick={onNewContext}>
<CircleFadingPlus size={18} />
<Eraser size={18} />
</ToolbarButton>
</Tooltip>
</Container>

View File

@ -172,7 +172,17 @@ const AssistantItem: FC<AssistantItemProps> = ({ assistant, isActive, onSwitch,
}
}
],
[addAgent, addAssistant, onSwitch, removeAllTopics, t, onDelete, sortByPinyinAsc, sortByPinyinDesc]
[
addAgent,
addAssistant,
onDelete,
onSwitch,
removeAllTopics,
setAssistantIconType,
sortByPinyinAsc,
sortByPinyinDesc,
t
]
)
const handleSwitch = useCallback(async () => {

View File

@ -1220,14 +1220,10 @@ const migrateConfig = {
state.settings.assistantIconType = state.settings?.showAssistantIcon ? 'model' : 'emoji'
// @ts-ignore eslint-disable-next-line
delete state.settings.showAssistantIcon
return state
} catch (error) {
return state
}
},
'97': (state: RootState) => {
try {
state.settings.enableBackspaceDeleteModel = true
if (state.websearch) {
state.websearch.enhanceMode = true
}
return state
} catch (error) {
return state

View File

@ -64,7 +64,7 @@ const initialState: WebSearchState = {
maxResults: 5,
excludeDomains: [],
subscribeSources: [],
enhanceMode: false,
enhanceMode: true,
overwrite: false
}