diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..8138d8b8 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,31 @@ +language: "en" +early_access: false +reviews: + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: false + path_filters: + - "!**/.xml" + - "!**/__generated__/**" + - "!**/generated/**" + - "!**/*.json" + - "!**/*.svg" + - "!**/*.png" + - "!**/*.jpg" + - "!**/*.gif" + - "!**/*.lock" + path_instructions: + - path: "**/*.{ts,tsx}" + instructions: + "Review the Typescript and React code for conformity with best practices. Ensure that it connects properly to the database, uses Shadcn/Tailwind components, and does not hard code colors. Highlight any deviations." + auto_review: + enabled: true + ignore_title_keywords: + - "WIP" + - "DO NOT MERGE" + - "DRAFT" + drafts: false +chat: + auto_reply: true \ No newline at end of file diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 9853782c..12603f7f 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -261,6 +261,7 @@ "fileManager": "File Manager", "serverStats": "Server Stats", "admin": "Admin", + "userProfile": "User Profile", "tools": "Tools", "newTab": "New Tab", "splitScreen": "Split Screen", diff --git a/public/locales/zh/translation.json b/public/locales/zh/translation.json index 2bc7b0bf..057299a9 100644 --- a/public/locales/zh/translation.json +++ b/public/locales/zh/translation.json @@ -260,6 +260,7 @@ "fileManager": "文件管理器", "serverStats": "服务器统计", "admin": "管理员", + "userProfile": "用户资料", "tools": "工具", "newTab": "新标签页", "splitScreen": "分屏", diff --git a/src/types/index.ts b/src/types/index.ts index 2767bc8e..302bed98 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -231,7 +231,7 @@ export interface TermixAlert { export interface TabContextTab { id: number; - type: 'home' | 'terminal' | 'ssh_manager' | 'server' | 'admin' | 'file_manager'; + type: 'home' | 'terminal' | 'ssh_manager' | 'server' | 'admin' | 'file_manager' | 'user_profile'; title: string; hostConfig?: any; terminalRef?: React.RefObject; diff --git a/src/ui/Desktop/DesktopApp.tsx b/src/ui/Desktop/DesktopApp.tsx index 91ac0da0..95316c1a 100644 --- a/src/ui/Desktop/DesktopApp.tsx +++ b/src/ui/Desktop/DesktopApp.tsx @@ -87,7 +87,7 @@ function AppContent() { const showHome = currentTabData?.type === 'home'; const showSshManager = currentTabData?.type === 'ssh_manager'; const showAdmin = currentTabData?.type === 'admin'; - const showProfile = currentTabData?.type === 'profile'; + const showProfile = currentTabData?.type === 'user_profile'; return (
diff --git a/src/ui/Desktop/Navigation/LeftSidebar.tsx b/src/ui/Desktop/Navigation/LeftSidebar.tsx index 92eb1498..8705d3d3 100644 --- a/src/ui/Desktop/Navigation/LeftSidebar.tsx +++ b/src/ui/Desktop/Navigation/LeftSidebar.tsx @@ -134,6 +134,16 @@ export function LeftSidebar({ const id = addTab({type: 'admin'} as any); setCurrentTab(id); }; + const userProfileTab = tabList.find((t) => t.type === 'user_profile'); + const openUserProfileTab = () => { + if (isSplitScreenActive) return; + if (userProfileTab) { + setCurrentTab(userProfileTab.id); + return; + } + const id = addTab({type: 'user_profile'} as any); + setCurrentTab(id); + }; const [hosts, setHosts] = useState([]); const [hostsLoading, setHostsLoading] = useState(false); @@ -387,14 +397,7 @@ export function LeftSidebar({ { - if (isSplitScreenActive) return; - const profileTab = tabList.find((t: any) => t.type === 'profile'); - if (profileTab) { - setCurrentTab(profileTab.id); - return; - } - const id = addTab({type: 'profile', title: t('profile.title')} as any); - setCurrentTab(id); + openUserProfileTab(); }}> {t('profile.title')} diff --git a/src/ui/Desktop/Navigation/Tabs/Tab.tsx b/src/ui/Desktop/Navigation/Tabs/Tab.tsx index 15bfa1c7..c3c4d4dc 100644 --- a/src/ui/Desktop/Navigation/Tabs/Tab.tsx +++ b/src/ui/Desktop/Navigation/Tabs/Tab.tsx @@ -8,7 +8,8 @@ import { X, Terminal as TerminalIcon, Server as ServerIcon, - Folder as FolderIcon + Folder as FolderIcon, + User as UserIcon } from "lucide-react"; interface TabProps { @@ -52,9 +53,10 @@ export function Tab({ ); } - if (tabType === "terminal" || tabType === "server" || tabType === "file_manager") { + if (tabType === "terminal" || tabType === "server" || tabType === "file_manager" || tabType === "user_profile") { const isServer = tabType === 'server'; const isFileManager = tabType === 'file_manager'; + const isUserProfile = tabType === 'user_profile'; return ( {canSplit && (