diff --git a/AGENTS.md b/AGENTS.md index 92c8670..c2c34d1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -169,12 +169,12 @@ eval "$(fnm env --use-on-cd)" && npm run dev 4. **禁止 `as any`**: 使用类型守卫或 `unknown` 5. **函数组件优先**: 禁止 class 组件 -## 13. 沟通规范 +## 11. 沟通规范 -1. **人设**: 在回答的末尾加上「🦆」,用于确认上下文是否被正确保留 +1. **人设**: 在回答的末尾加上「🦐」,用于确认上下文是否被正确保留 2. **语言**: 使用中文进行回答 -## 11. MVP Phase - Breaking Changes +## 12. MVP Phase - Breaking Changes **This is MVP phase - breaking changes are acceptable for better design.** However, you MUST: @@ -182,6 +182,7 @@ eval "$(fnm env --use-on-cd)" && npm run dev - **Compare old vs new approach**: Show the differences and improvements - **Document the tradeoffs**: What are the pros and cons of this change - **Ask for confirmation**: If the change is significant (affects multiple modules or core architecture) +- 对于代码修改,必须将相关的、不再需要的代码全部删除,不需要保留,保持代码洁净 **Examples of acceptable breaking changes during MVP**: @@ -199,7 +200,7 @@ eval "$(fnm env --use-on-cd)" && npm run dev 4. If significant, ask user for confirmation before implementing 5. Update related documentation after implementation -## 12. 测试规范 +## 13. 测试规范 ### 测试框架 diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index f950375..3291699 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -11,20 +11,19 @@ import { theme, ConfigProvider, App as AntApp, - Button, Space, - Dropdown, - Tooltip, } from "antd"; +import { Button, Tooltip, DropdownMenu } from "@lobehub/ui"; +import { SettingOutlined } from "@ant-design/icons"; import { - SettingOutlined, - GithubOutlined, - CloudServerOutlined, - CloudUploadOutlined, - HistoryOutlined, - MenuFoldOutlined, - MenuUnfoldOutlined, -} from "@ant-design/icons"; + Github, + Cloud, + CloudUpload, + History, + PanelLeftClose, + PanelLeftOpen, +} from "lucide-react"; + import { createStyles } from "antd-style"; import zhCN from "antd/locale/zh_CN"; import { useDomainStore } from "@renderer/stores"; @@ -222,15 +221,16 @@ const App: React.FC = () => {
- Kintone Manager
- - , - label: t("settings"), - }, - { type: "divider" }, - { - key: "github", - icon: , - label: "GitHub", - }, - ], - onClick: ({ key }) => { - if (key === "settings") { - setSettingsOpen(true); - } else if (key === "github") { - window.open("https://github.com", "_blank"); - } + } />} + items={[ + { + key: "settings", + icon: , + label: t("settings"), + onClick: () => setSettingsOpen(true), }, - }} - > - - @@ -235,13 +234,13 @@ const AppDetail: React.FC = () => {
- +

{currentApp.name}

{currentApp.appId}
- - + diff --git a/src/renderer/src/components/AppList/AppList.tsx b/src/renderer/src/components/AppList/AppList.tsx index a3cf807..ee14cb1 100644 --- a/src/renderer/src/components/AppList/AppList.tsx +++ b/src/renderer/src/components/AppList/AppList.tsx @@ -6,24 +6,20 @@ import React from "react"; import { useTranslation } from "react-i18next"; import { - Button, Input, - Empty, Spin, Typography, Space, - Tooltip, - Select, } from "antd"; +import { Button, Tooltip, Empty, Select } from "@lobehub/ui"; import { - ReloadOutlined, - SearchOutlined, - AppstoreOutlined, - PushpinOutlined, - PushpinFilled, - SortAscendingOutlined, - SortDescendingOutlined, -} from "@ant-design/icons"; + RefreshCw, + Search, + LayoutGrid, + Pin, + ArrowUpDown, + ArrowDownUp, +} from "lucide-react"; import { createStyles } from "antd-style"; import { useAppStore } from "@renderer/stores"; import { useDomainStore } from "@renderer/stores"; @@ -280,10 +276,10 @@ const AppList: React.FC = () => { className={`${styles.pinIcon} ${isPinned ? styles.pinIconPinned : ""}`} onClick={(e) => handlePinToggle(e, app.appId)} > - {isPinned ? : } + {isPinned ? : } - + {app.name} @@ -310,7 +306,7 @@ const AppList: React.FC = () => {
} + prefix={} value={searchText} onChange={(e) => setSearchText(e.target.value)} allowClear @@ -337,9 +333,9 @@ const AppList: React.FC = () => { size="small" icon={ appSortOrder === "asc" ? ( - + ) : ( - + ) } onClick={toggleSortOrder} @@ -348,7 +344,7 @@ const AppList: React.FC = () => { 0 ? t("reload") : t("loadApps")}>
= ({

{t("domainManagement")}

-
@@ -273,7 +274,7 @@ const DomainManager: React.FC = ({ onMouseEnter={() => setIsHoveringToggle(true)} onMouseLeave={() => setIsHoveringToggle(false)} > - +
= ({ accept=".js,.css" >

- +

{t("clickOrDragToUpload")}

@@ -167,11 +168,9 @@ const FileUploader: React.FC = ({ renderItem={(file, index) => (

-
{file.fileName}
@@ -189,7 +188,7 @@ const FileUploader: React.FC = ({
diff --git a/src/renderer/src/components/Settings/Settings.tsx b/src/renderer/src/components/Settings/Settings.tsx index 4a49393..01e88c6 100644 --- a/src/renderer/src/components/Settings/Settings.tsx +++ b/src/renderer/src/components/Settings/Settings.tsx @@ -5,8 +5,9 @@ import React from "react"; import { useTranslation } from "react-i18next"; -import { Typography, Radio, Divider, Button } from "antd"; -import { GlobalOutlined, CloseCircleOutlined } from "@ant-design/icons"; +import { Typography, Radio, Divider } from "antd"; +import { Button } from "@lobehub/ui"; +import { Globe, XCircle } from "lucide-react"; import { createStyles } from "antd-style"; import { useLocaleStore } from "@renderer/stores/localeStore"; import { LOCALES, type LocaleCode } from "@shared/types/locale"; @@ -100,7 +101,7 @@ const Settings: React.FC = ({ onClose }) => { {onClose && (