From 887f5de793c6cdf8dee631a098265ccbb1f88677 Mon Sep 17 00:00:00 2001 From: imeepos Date: Tue, 15 Jul 2025 20:09:54 +0800 Subject: [PATCH] feat: Complete Modal and Tab UI/UX optimization Enhanced Modal Components: - Optimized DeleteConfirmDialog with beautiful gradients and improved layout - Enhanced MaterialEditDialog with modern design and better information hierarchy - Improved TemplateDetailModal with elegant header and refined tab navigation - Enhanced AiClassificationFormDialog with modern styling Unified Tab System: - Created reusable TabNavigation component with multiple variants (default, pills, underline) - Implemented consistent tab design across ProjectDetails and other pages - Added support for icons, counts, and disabled states in tabs - Improved accessibility and keyboard navigation Advanced Animations: - Added comprehensive modal animations (fade-in, scale-in, slide-in) - Enhanced backdrop blur effects and smooth transitions - Implemented proper enter/exit animations for better UX - Added reduced motion support for accessibility Responsive Design: - Optimized modal layouts for mobile, tablet, and desktop - Improved touch-friendly interactions for mobile devices - Enhanced modal sizing and positioning across screen sizes - Added proper scrolling and overflow handling Interaction Improvements: - Enhanced ESC key support for modal closing - Improved backdrop click handling - Better focus management and keyboard navigation - Consistent button styling and hover effects All modal and tab components now follow unified design language while maintaining full functionality. --- .../components/AiClassificationFormDialog.tsx | 31 +- .../src/components/DeleteConfirmDialog.tsx | 116 ++++---- .../src/components/MaterialEditDialog.tsx | 166 ++++++----- apps/desktop/src/components/Modal.tsx | 204 +++++++++++++ apps/desktop/src/components/ModelList.tsx | 268 +++++++++--------- apps/desktop/src/components/TabNavigation.tsx | 139 +++++++++ apps/desktop/src/pages/Models.tsx | 4 +- apps/desktop/src/styles/animations.css | 124 +++++++- apps/desktop/src/styles/design-system.css | 103 +++++++ 9 files changed, 886 insertions(+), 269 deletions(-) create mode 100644 apps/desktop/src/components/Modal.tsx create mode 100644 apps/desktop/src/components/TabNavigation.tsx diff --git a/apps/desktop/src/components/AiClassificationFormDialog.tsx b/apps/desktop/src/components/AiClassificationFormDialog.tsx index 87893e7..46c2815 100644 --- a/apps/desktop/src/components/AiClassificationFormDialog.tsx +++ b/apps/desktop/src/components/AiClassificationFormDialog.tsx @@ -102,27 +102,32 @@ export const AiClassificationFormDialog: React.FC -
- {/* 背景遮罩 - 优化透明度和动画 */} +
+
+ {/* 美观的背景遮罩 */}
- {/* 对话框 - 优化圆角、阴影和尺寸 */} -
- {/* 标题栏 - 优化间距和字体 */} -
+ {/* 优化的对话框 */} +
+ {/* 美观的标题栏 */} +
-

- {title} -

+
+
+ 🤖 +
+

+ {title} +

+
diff --git a/apps/desktop/src/components/DeleteConfirmDialog.tsx b/apps/desktop/src/components/DeleteConfirmDialog.tsx index bac7230..907158a 100644 --- a/apps/desktop/src/components/DeleteConfirmDialog.tsx +++ b/apps/desktop/src/components/DeleteConfirmDialog.tsx @@ -35,74 +35,84 @@ export const DeleteConfirmDialog: React.FC = ({ if (!isOpen) return null; return ( -
-
- {/* 背景遮罩 */} -
+
+ {/* 美观的背景遮罩 */} +
- {/* 对话框 */} -
-
-
- {/* 警告图标 */} -
+ {/* 优化的对话框 */} +
+ {/* 美观的内容区域 */} +
+
+ {/* 优化的警告图标 */} +
- - {/* 内容 */} -
-

+ + {/* 优化的内容区域 */} +
+

{title}

-
-

- {message} -

- {itemName && ( -
-

- {itemName} +

+ {message} +

+ + {itemName && ( +
+

要删除的项目:

+

+ {itemName} +

+
+ )} + +
+
+ +
+

重要提醒

+

+ 此操作无法撤销,请确认您要继续。

- )} -
-

- 注意:此操作无法撤销,请确认您要继续。 -

- {/* 按钮栏 */} -
- - + {/* 美观的按钮区域 */} +
+
+ + +
diff --git a/apps/desktop/src/components/MaterialEditDialog.tsx b/apps/desktop/src/components/MaterialEditDialog.tsx index 9d8c982..c9cbf38 100644 --- a/apps/desktop/src/components/MaterialEditDialog.tsx +++ b/apps/desktop/src/components/MaterialEditDialog.tsx @@ -98,52 +98,68 @@ export const MaterialEditDialog: React.FC = ({ if (!isOpen || !material) return null; return ( -
-
- {/* 头部 */} -
-

编辑素材

+
+
+ {/* 美观的头部 */} +
+
+
+ +
+

编辑素材

+
- {/* 内容 */} + {/* 美观的内容区域 */}
{/* 错误信息 */} {error && } - {/* 素材信息 */} -
-

素材信息

-
-

{material.name}

-

- 类型: {material.material_type} | 状态: {material.processing_status} + {/* 优化的素材信息 */} +

+

+
+ 素材信息 +

+
+

+ {material.name}

+
+ + 类型: {material.material_type} + + + 状态: {material.processing_status} + +
- {/* 模特绑定 */} -
-