diff --git a/docs/todo-list.md b/docs/todo-list.md index a79ae6b..5af00f1 100644 --- a/docs/todo-list.md +++ b/docs/todo-list.md @@ -7,4 +7,5 @@ 5、一键打开渠道可以新增渠道 - 完成 6、把龙虾包装到对话 7、迁移频道功能 -8、迁移agent功能 \ No newline at end of file +8、迁移agent功能 +9、知识库调整成上传文件,查看文件列表 \ No newline at end of file diff --git a/src/components/chat/ChatComposer.tsx b/src/components/chat/ChatComposer.tsx index eb94e0e..842a1ee 100644 --- a/src/components/chat/ChatComposer.tsx +++ b/src/components/chat/ChatComposer.tsx @@ -1,4 +1,5 @@ import { useRef } from 'react'; +import { SendHorizontal, Square, X, Paperclip, FileText, Film, Music, FileArchive, File, Loader2, AtSign } from 'lucide-react'; import type { AttachedFileMeta } from '../../shared/chat-model'; type ChatComposerProps = { @@ -32,9 +33,6 @@ export default function ChatComposer({
-
- AI -
{error ? (
@@ -100,21 +98,14 @@ export default function ChatComposer({ className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300" onClick={() => fileInputRef.current?.click()} > - 添加附件 + -
diff --git a/src/components/chat/ChatHistoryPanel.tsx b/src/components/chat/ChatHistoryPanel.tsx index 3472272..3e9cc87 100644 --- a/src/components/chat/ChatHistoryPanel.tsx +++ b/src/components/chat/ChatHistoryPanel.tsx @@ -120,7 +120,7 @@ function ChatHistoryPanel({ {!isCompact ? (
-
+
YINIAN
@@ -132,7 +132,7 @@ function ChatHistoryPanel({
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 3f02070..67094c8 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -13,7 +13,7 @@ const MENU_MARKS: Record = { '/models': Cpu, '/skills': Puzzle, '/cron': Clock, - '/scripts': Code, + // '/scripts': Code, '/setting': Settings, }; diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index af2485e..5afe697 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,4 +1,6 @@ import { useEffect, useMemo, useState } from 'react'; +import { RefreshCw +} from 'lucide-react'; import type { RawMessage } from '../../shared/chat-model'; import { extractText, isInternalMessage } from '../../shared/chat-model'; import { taskCenterList, type TaskCenterItem } from '../../constants/taskCenterList'; @@ -391,7 +393,7 @@ export default function HomePage() { onDeleteConversation={handleDeleteConversation} /> -
+

智能对话

@@ -424,7 +426,7 @@ export default function HomePage() { className="rounded-full border border-[#E5E8EE] px-3 py-1.5 text-xs text-[#525866] transition-colors hover:border-[#2B7FFF] hover:text-[#2B7FFF] dark:border-[#2a2a2d] dark:text-gray-300" onClick={handleRefreshConversationData} > - 刷新会话 +
@@ -434,7 +436,7 @@ export default function HomePage() {
-
+ {/*

任务中心

@@ -499,7 +501,7 @@ export default function HomePage() { ))}
-
+
*/}
diff --git a/src/pages/Setting/components/GeneralSettingsPanel.tsx b/src/pages/Setting/components/GeneralSettingsPanel.tsx index d61acdd..4fe2bfb 100644 --- a/src/pages/Setting/components/GeneralSettingsPanel.tsx +++ b/src/pages/Setting/components/GeneralSettingsPanel.tsx @@ -1,9 +1,9 @@ +import { Moon, Sun, Monitor, RefreshCw } from 'lucide-react'; import { useI18n } from '../../../i18n'; import { SUPPORTED_LANGUAGE_CODES } from '../../../i18n/constants'; import type { LanguageCode, ThemeMode } from '../../../types/runtime'; import type { SettingUpdateState } from '../useSettingUpdateState'; import SectionHeader from './SectionHeader'; -import { ComputerIcon, MoonIcon, RefreshIcon, SunIcon } from './SettingIcons'; import ToggleSwitch from './ToggleSwitch'; type GeneralSettingsPanelProps = { @@ -16,12 +16,12 @@ type GeneralSettingsPanelProps = { const THEME_OPTIONS: Array<{ value: ThemeMode; - icon: typeof SunIcon; + icon: typeof Sun | typeof Moon | typeof Monitor; labelPath: 'theme.light' | 'theme.dark' | 'theme.system'; }> = [ - { value: 'light', icon: SunIcon, labelPath: 'theme.light' }, - { value: 'dark', icon: MoonIcon, labelPath: 'theme.dark' }, - { value: 'system', icon: ComputerIcon, labelPath: 'theme.system' }, + { value: 'light', icon: Sun, labelPath: 'theme.light' }, + { value: 'dark', icon: Moon, labelPath: 'theme.dark' }, + { value: 'system', icon: Monitor, labelPath: 'theme.system' }, ]; function getUpdateStatusText(t: ReturnType['t'], updateState: SettingUpdateState) { @@ -59,14 +59,14 @@ export default function GeneralSettingsPanel({ const { t } = useI18n(); return ( -
+
-
-
+
+
{t('settings.general.themeSection')}
@@ -97,8 +97,8 @@ export default function GeneralSettingsPanel({
-
-
+
+
{t('settings.general.languageSection')}
@@ -126,14 +126,14 @@ export default function GeneralSettingsPanel({
-
-
+
+
{t('settings.general.updatesTitle')}
-
+
-
+
{t('settings.general.currentVersion')}
@@ -143,13 +143,13 @@ export default function GeneralSettingsPanel({
-
+
{ void updateState.downloadUpdate(); }} - className="rounded-[8px] bg-[#2B7FFF] px-[14px] py-[8px] text-[14px] font-medium text-white transition-colors hover:bg-[#1F6AE5]" + className="rounded-lg bg-[#2B7FFF] px-3.5 py-2 text-[14px] font-medium text-white transition-colors hover:bg-[#1F6AE5]" > {t('settings.general.downloadUpdate')} @@ -185,7 +185,7 @@ export default function GeneralSettingsPanel({ onClick={() => { void updateState.installUpdate(); }} - className="rounded-[8px] bg-[#1FC16B] px-[14px] py-[8px] text-[14px] font-medium text-white transition-colors hover:bg-[#17A95C]" + className="rounded-lg bg-[#1FC16B] px-3.5 py-2 text-[14px] font-medium text-white transition-colors hover:bg-[#17A95C]" > {t('settings.general.restartAndInstall')} @@ -195,9 +195,9 @@ export default function GeneralSettingsPanel({ onClick={() => { void updateState.checkUpdate(); }} - className="inline-flex items-center gap-2 rounded-[8px] border border-[#E5E8EE] bg-white px-[14px] py-[8px] text-[14px] font-medium text-[#171717] transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 dark:hover:bg-gray-600" + className="inline-flex items-center gap-2 rounded-lg border border-[#E5E8EE] bg-white px-3.5 py-2 text-[14px] font-medium text-[#171717] transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 dark:hover:bg-gray-600" > -
-
+
{t('settings.general.autoUpdateHint')}
-
+
-
+
{t('settings.general.autoCheckTitle')}
@@ -229,9 +229,9 @@ export default function GeneralSettingsPanel({ />
-
+
-
+
{t('settings.general.autoDownloadTitle')}
diff --git a/src/pages/Setting/components/SettingIcons.tsx b/src/pages/Setting/components/SettingIcons.tsx deleted file mode 100644 index 4346ccf..0000000 --- a/src/pages/Setting/components/SettingIcons.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import type { CSSProperties, ReactNode } from 'react'; - -type IconProps = { - className?: string; - style?: CSSProperties; -}; - -function BaseIcon({ - className, - style, - children, - viewBox = '0 0 24 24', -}: IconProps & { children: ReactNode; viewBox?: string }) { - return ( - - ); -} - -export function UserIcon({ className, style }: IconProps) { - return ( - - - - - ); -} - -export function SettingsIcon({ className, style }: IconProps) { - return ( - - - - - ); -} - -export function SunIcon({ className, style }: IconProps) { - return ( - - - - - - - - - - - - ); -} - -export function MoonIcon({ className, style }: IconProps) { - return ( - - - - ); -} - -export function ComputerIcon({ className, style }: IconProps) { - return ( - - - - - - - ); -} - -export function RefreshIcon({ className, style }: IconProps) { - return ( - - - - - - - ); -} - -export function CheckCircleIcon({ className, style }: IconProps) { - return ( - - ); -} diff --git a/src/pages/Setting/components/SettingMenu.tsx b/src/pages/Setting/components/SettingMenu.tsx index c116896..8d1564e 100644 --- a/src/pages/Setting/components/SettingMenu.tsx +++ b/src/pages/Setting/components/SettingMenu.tsx @@ -13,24 +13,24 @@ const MENU_ITEMS: Array<{ labelKey: 'settings.menu.account' | 'settings.menu.general'; Icon: typeof UserIcon; }> = [ - { - id: 'account', - labelKey: 'settings.menu.account', - Icon: UserIcon, - }, { id: 'general', labelKey: 'settings.menu.general', Icon: SettingsIcon, }, + { + id: 'account', + labelKey: 'settings.menu.account', + Icon: UserIcon, + }, ]; export default function SettingMenu({ currentView, onChange }: SettingMenuProps) { const { t } = useI18n(); return ( -