feat: add 'code_tools' to sidebar icons and update related components

This commit is contained in:
kangfenmao 2025-08-20 10:56:44 +08:00
parent 973ece9eb9
commit cffaf99b17
4 changed files with 11 additions and 8 deletions

View File

@ -144,7 +144,8 @@ const sidebarIconKeyMap = {
translate: 'translate.title',
minapp: 'minapp.title',
knowledge: 'knowledge.title',
files: 'files.title'
files: 'files.title',
code_tools: 'code.title'
} as const
export const getSidebarIconLabel = (key: string): string => {

View File

@ -11,7 +11,7 @@ import { getSidebarIconLabel } from '@renderer/i18n/label'
import { useAppDispatch } from '@renderer/store'
import { setSidebarIcons } from '@renderer/store/settings'
import { message } from 'antd'
import { FileSearch, Folder, Languages, LayoutGrid, MessageSquareQuote, Palette, Sparkle } from 'lucide-react'
import { Code, FileSearch, Folder, Languages, LayoutGrid, MessageSquareQuote, Palette, Sparkle } from 'lucide-react'
import { FC, useCallback, useMemo } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
@ -116,7 +116,8 @@ const SidebarIconsManager: FC<SidebarIconsManagerProps> = ({
translate: <Languages size={16} />,
minapp: <LayoutGrid size={16} />,
knowledge: <FileSearch size={16} />,
files: <Folder size={15} />
files: <Folder size={15} />,
code_tools: <Code size={16} />
}),
[]
)
@ -206,15 +207,14 @@ const IconColumn = styled.div`
`
const IconList = styled.div`
height: 365px;
min-height: 365px;
height: 400px;
min-height: 400px;
padding: 10px;
background: var(--color-background-soft);
border-radius: 8px;
border: 1px solid var(--color-border);
display: flex;
flex-direction: column;
overflow-y: hidden;
`
const IconItem = styled.div`

View File

@ -40,8 +40,9 @@ const PopupContainer: React.FC<Props> = ({ resolve }) => {
afterClose={onClose}
transitionName="animation-move-down"
width="80vw"
footer={null}
centered>
<SettingContainer theme={theme} style={{ padding: '10px 0' }}>
<SettingContainer theme={theme} style={{ padding: '10px 0', background: 'transparent' }}>
<TranslatePromptSettings />
<SettingGroup theme={theme} style={{ flex: 1 }}>
<CustomLanguageSettings />

View File

@ -38,7 +38,8 @@ export const DEFAULT_SIDEBAR_ICONS: SidebarIcon[] = [
'translate',
'minapp',
'knowledge',
'files'
'files',
'code_tools'
]
export interface NutstoreSyncRuntime extends RemoteSyncState {}