chore(deps): update lucide-react to version 0.525.0 and enhance i18n configuration

- Updated lucide-react dependency from 0.487.0 to 0.525.0 in package.json and yarn.lock.
- Added fallback language configuration in i18n setup for improved localization support.
- Refactored Tabs component to utilize classNames for conditional styling.
- Adjusted TopicsTab component's style for better layout management.
- Introduced a button in AboutSettings to open documentation based on the user's language preference.
This commit is contained in:
kangfenmao 2025-07-24 11:32:05 +08:00
parent 49469160b0
commit a50c411099
6 changed files with 36 additions and 10 deletions

View File

@ -203,7 +203,7 @@
"lint-staged": "^15.5.0",
"lodash": "^4.17.21",
"lru-cache": "^11.1.0",
"lucide-react": "^0.487.0",
"lucide-react": "^0.525.0",
"macos-release": "^3.4.0",
"markdown-it": "^14.1.0",
"mermaid": "^11.7.0",

View File

@ -40,6 +40,7 @@ export const getLanguageCode = () => {
i18n.use(initReactI18next).init({
resources,
lng: getLanguage(),
fallbackLng: defaultLanguage,
interpolation: {
escapeValue: false
},

View File

@ -442,7 +442,7 @@ const Topics: FC<Props> = ({ assistant: _assistant, activeTopic, setActiveTopic,
className="topics-tab"
list={sortedTopics}
onUpdate={updateTopics}
style={{ padding: '13px 0 10px 10px' }}
style={{ height: '100%', padding: '13px 0 10px 10px', display: 'flex', flexDirection: 'column' }}
itemContainerStyle={{ paddingBottom: '8px' }}
header={
<AddTopicButton onClick={() => EventEmitter.emit(EVENT_NAMES.ADD_NEW_TOPIC)}>

View File

@ -4,7 +4,7 @@ import { useNavbarPosition, useSettings } from '@renderer/hooks/useSettings'
import { useShowTopics } from '@renderer/hooks/useStore'
import { EVENT_NAMES, EventEmitter } from '@renderer/services/EventService'
import { Assistant, Topic } from '@renderer/types'
import { uuid } from '@renderer/utils'
import { classNames, uuid } from '@renderer/utils'
import { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
@ -99,7 +99,9 @@ const HomeTabs: FC<Props> = ({
}, [position, tab, topicPosition, forceToSeeAllTab])
return (
<Container style={{ ...border, ...style }} className="home-tabs">
<Container
style={{ ...border, ...style }}
className={classNames('home-tabs', { right: position === 'right' && topicPosition === 'right' })}>
{position === 'left' && topicPosition === 'left' && (
<CustomTabs>
<TabItem active={tab === 'assistants'} onClick={() => setTab('assistants')}>
@ -153,11 +155,17 @@ const Container = styled.div`
flex-direction: column;
max-width: var(--assistants-width);
min-width: var(--assistants-width);
&.right {
height: calc(100vh - var(--navbar-height));
}
[navbar-position='left'] & {
background-color: var(--color-background);
}
[navbar-position='top'] & {
min-height: calc(100vh - var(--navbar-height) - var(--navbar-height) - 12px);
height: calc(100vh - var(--navbar-height) - 12px);
&.right {
height: calc(100vh - var(--navbar-height) - var(--navbar-height) - 12px);
}
}
overflow: hidden;
.collapsed {

View File

@ -6,6 +6,7 @@ import { useTheme } from '@renderer/context/ThemeProvider'
import { useMinappPopup } from '@renderer/hooks/useMinappPopup'
import { useRuntime } from '@renderer/hooks/useRuntime'
import { useSettings } from '@renderer/hooks/useSettings'
import i18n from '@renderer/i18n'
import { useAppDispatch } from '@renderer/store'
import { setUpdateState } from '@renderer/store/runtime'
import { ThemeMode } from '@renderer/types'
@ -14,6 +15,7 @@ import { UpgradeChannel } from '@shared/config/constant'
import { Avatar, Button, Progress, Radio, Row, Switch, Tag, Tooltip } from 'antd'
import { debounce } from 'lodash'
import { Bug, FileCheck, Github, Globe, Mail, Rss } from 'lucide-react'
import { BadgeQuestionMark } from 'lucide-react'
import { FC, useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import Markdown from 'react-markdown'
@ -170,6 +172,13 @@ const AboutSettings: FC = () => {
setAutoCheckUpdate(autoCheckUpdate)
}, [autoCheckUpdate, setAutoCheckUpdate])
const onOpenDocs = () => {
const isChinese = i18n.language.startsWith('zh')
window.api.openWebsite(
isChinese ? 'https://docs.cherry-ai.com/' : 'https://docs.cherry-ai.com/cherry-studio-wen-dang/en-us'
)
}
return (
<SettingContainer theme={theme}>
<SettingGroup theme={theme}>
@ -275,6 +284,14 @@ const AboutSettings: FC = () => {
</SettingGroup>
)}
<SettingGroup theme={theme}>
<SettingRow>
<SettingRowTitle>
<BadgeQuestionMark size={18} />
{t('docs.title')}
</SettingRowTitle>
<Button onClick={onOpenDocs}>{t('settings.about.website.button')}</Button>
</SettingRow>
<SettingDivider />
<SettingRow>
<SettingRowTitle>
<Rss size={18} />

View File

@ -7255,7 +7255,7 @@ __metadata:
lint-staged: "npm:^15.5.0"
lodash: "npm:^4.17.21"
lru-cache: "npm:^11.1.0"
lucide-react: "npm:^0.487.0"
lucide-react: "npm:^0.525.0"
macos-release: "npm:^3.4.0"
markdown-it: "npm:^14.1.0"
mermaid: "npm:^11.7.0"
@ -13975,12 +13975,12 @@ __metadata:
languageName: node
linkType: hard
"lucide-react@npm:^0.487.0":
version: 0.487.0
resolution: "lucide-react@npm:0.487.0"
"lucide-react@npm:^0.525.0":
version: 0.525.0
resolution: "lucide-react@npm:0.525.0"
peerDependencies:
react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0
checksum: 10c0/7177778c584b8e9545957bef28e95841c4be1b3bf473f9e2e64454c3e183d7ed0bc977c9f7b5446088023c7000151b7a3b27398d4f70025bf343782192f653ca
checksum: 10c0/81c4438e2cf1c86ea2ebe0a97b378201512450894283cccce766a89bc6a4e47c8df1d9115d845d98f582bb0a10be31c454aa232520fea35018dac1cd8466ea9b
languageName: node
linkType: hard