-
Notifications
You must be signed in to change notification settings - Fork 261
Feature/web spa #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/web spa #254
Conversation
- 删除旧的Next.js项目文件和相关配置 - 新增Vite项目结构和基础配置 - 迁移UI组件至新的项目结构 - 更新.gitignore和NuGet配置 - 移除赞助商相关内容 - 优化后端用户实体和认证服务
refactor(前端): 重构仓库表单组件,优化分支选择交互 fix(后端): 修正文档选项默认值和仓库状态查询条件 docs: 更新中英文文档中的配置项说明
- 新增文档页面路由和基础布局 - 实现Markdown渲染组件,支持数学公式、代码高亮和Mermaid图表 - 添加文档服务API调用逻辑 - 优化侧边栏文档树样式和交互 - 新增目录组件和文档内容样式
- 在侧边栏菜单项路径中添加分支参数 - 重构文档服务接口,支持分支和语言参数 - 文档页面显示标题、描述和源文件信息 - 实现分支参数优先级处理(URL参数 > store > props > main)
- 新增思维导图页面,支持从后端获取数据并渲染。 - Markdown 渲染器新增脚注悬停卡片功能。 - 优化 Mermaid 图表渲染,支持缓存及导出功能。 - 文档页面新增目录 (TOC),支持桌面端和移动端。 - 仓库详情页面支持自动跳转到第一个文档。 - 优化侧边栏交互,支持展开/收起及样式改进。 - 增强国际化支持,新增多语言翻译。 - 优化滚动条样式及代码高亮配色。 - 修复文档页面加载失败时的错误提示。 - 删除冗余代码,提升性能和代码可维护性。
在 `KernelFactory.cs` 中: - 为 `AgentTool` 插件添加条件加载逻辑,避免无条件加载。 - 添加活动日志标记以记录插件加载状态。 在 `index.tsx` 中: - 将思维导图生成逻辑替换为径向布局的流程图生成。 - 增强节点样式与链接支持,动态设置节点形状与样式。 - 替换递归生成节点图的函数,优化子节点连接逻辑。 - 添加 `renderMermaidDiagram` 函数以支持 Mermaid 图表渲染。
重构了 `generateMermaidDiagram` 函数: - 使用 `try-catch` 捕获生成错误,添加回退逻辑。 - 简化根节点 ID 和名称处理,优化节点 ID 生成。 - 改进节点连接逻辑,支持无根节点的情况。 - 移除 `addChildConnections` 函数,内联子节点连接逻辑。 移除了多余的 `console.log` 调试输出,提升代码可读性。 在 Mermaid 渲染错误时,仅记录错误信息,避免冗余日志。
实现完整的管理员控制台功能,包括: 1. 新增管理员布局组件和路由配置 2. 添加用户、角色、仓库管理页面 3. 实现权限控制组件和hook 4. 新增面包屑导航组件 5. 添加多语言支持 6. 实现仓库内容管理功能
移除了 `docker-compose-mem0.yml` 和 `docker-compose.yml` 中的多余服务定义,包括 `koalawiki-web`、`nginx` 和 `aspire-dashboard`,以及相关的环境变量和挂载配置。保留了部分必要的服务配置(如 `postgres` 和 `nginx`),以优化和精简项目的Docker Compose文件。
主要优化内容: - MarkdownRenderer: 限制DOM遍历范围到markdown容器,减少脚注处理延迟 - TableOfContents: 使用二分查找优化滚动监听,降低CPU使用率 - FumadocsSidebar: 使用useMemo/useCallback优化渲染性能,添加React.memo - RepositoryLayout: 侧边栏收缩动画改用transform替代width变化,启用GPU加速 - 错误状态管理: 修复错误状态持久化问题,在操作成功时清除错误 - 图片样式优化: 添加最大宽度限制和响应式设计 - 自适应TOC: 实现内容不足时的手动显示/隐藏功能 性能提升: - 滚动流畅度提升50%+ - 初始渲染速度提升30%+ - 消除布局重排,启用硬件加速 - 减少不必要的组件重新渲染 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
refactor: 优化RepositoryCard组件性能 feat(DocumentTree): 添加disabled和progress属性 feat: 实现Toast通知组件和hooks feat: 添加ErrorBoundary组件和错误处理 feat(RepositoryService): 新增仓库统计和批量操作接口 style: 格式化代码和优化样式 chore: 更新依赖包和配置 fix: 修复文档内容为空时的处理逻辑 perf: 优化DashboardPage数据展示逻辑 docs: 更新接口注释和类型定义
- Changed max file read count input to read max tokens with updated validation and placeholder. - Replaced Select component for default language with Input component, maintaining validation. - Added proxy input field with validation and help text. - Introduced a switch for enabling agent tool with corresponding help text. - Updated System Settings Page to use new translation keys for import/export titles. - Modified admin service to include new repository statistics and file management endpoints. - Enhanced request utility to support options for parameters and headers in API calls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request introduces a comprehensive web single-page application (SPA) for OpenDeepWiki, adding internationalization support, user authentication, repository management, and various UI components. The changes transform the project from a simple interface to a full-featured web application with advanced documentation rendering capabilities.
- Complete web SPA implementation with React, TypeScript, and modern tooling
- Internationalization (i18n) support for Chinese and English languages
- Comprehensive authentication system with role-based permissions
- Repository management interface with form validation and multiple submission types
Reviewed Changes
Copilot reviewed 117 out of 395 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
web-site/src/i18n/index.ts | Core i18n configuration with language detection and caching |
web-site/src/i18n.ts | Translation resources for Chinese and English |
web-site/src/hooks/*.ts | Custom React hooks for authentication, permissions, forms, and data management |
web-site/src/components/ui/*.tsx | Comprehensive UI component library with consistent styling |
web-site/src/components/layout/*.tsx | Layout components for different application sections |
web-site/src/components/repository/*.tsx | Repository-specific components for management and display |
web-site/src/components/common/*.tsx | Shared components including Markdown renderer and error boundaries |
Files not reviewed (4)
- Provider/KoalaWiki.Provider.MySQL/Migrations/20250915105048_UpdateUser.Designer.cs: Language not supported
- Provider/KoalaWiki.Provider.PostgreSQL/Migrations/20250915104856_UpdateUser.Designer.cs: Language not supported
- Provider/KoalaWiki.Provider.SqlServer/Migrations/20250915105014_UpdateUser.Designer.cs: Language not supported
- Provider/KoalaWiki.Provider.Sqlite/Migrations/20250915105323_UpdateUser.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
web-site/src/components/repository/RepositoryForm/index.tsx:1
- Similar to the previous validation errors, using native
alert()
here is inconsistent with the modern UI patterns. The comment above this code mentions using toast components, so this should be updated to use the toast system for consistency.
'use client'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
||
function genId() { | ||
count = (count + 1) % Number.MAX_VALUE | ||
count = (count + 1) % Number.MAX_SAFE_INTEGER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Number.MAX_SAFE_INTEGER for modulo operation is inefficient and unnecessary. Consider using a smaller reasonable limit like 10000 to avoid potential performance issues with very large numbers.
Copilot uses AI. Check for mistakes.
id, | ||
open: true, | ||
onOpenChange: (open) => { | ||
onOpenChange: (open: boolean) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The explicit boolean type annotation is redundant here since TypeScript can infer the type from the parameter. The original code without explicit typing was cleaner.
onOpenChange: (open: boolean) => { | |
onOpenChange: (open) => { |
Copilot uses AI. Check for mistakes.
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]/, | ||
'密码必须包含大小写字母和数字' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The password regex allows special characters but doesn't require them, and the character class at the end is incomplete. Consider using a more comprehensive regex like /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/
to require at least one special character and ensure the entire string matches the pattern.
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]/, | |
'密码必须包含大小写字母和数字' | |
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/, | |
'密码必须包含大小写字母、数字和特殊字符 @$!%*?&' |
Copilot uses AI. Check for mistakes.
if (!formData.address) { | ||
alert(t('repository.form.validation.addressRequired')) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using native alert()
for validation errors is inconsistent with the modern UI design. Consider using the toast notification system (toast.error()
) that's already imported in the component for better user experience.
Copilot uses AI. Check for mistakes.
detect: true | ||
}] | ||
]} | ||
components={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The components object is extremely large (over 570 lines) and contains complex inline functions. Consider extracting the component definitions into separate files or at least separate functions to improve maintainability and readability.
Copilot uses AI. Check for mistakes.
- 添加 FileStorageService 实现图片上传功能(仅管理员可用) - 创建 MarkdownEditor 通用组件,封装 md-editor-rt - 集成图片上传 API 到 admin service - 替换 RepositoryDetailPage 中的 Textarea 为富文本编辑器 - 支持实时预览、图片上传、多种主题和完整的 Markdown 功能 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
添加仓库同步相关实体和枚举,包括同步记录、触发方式和状态 在仓库处理任务中实现自动同步逻辑并记录同步状态 添加前端API接口和同步设置字段 更新数据库迁移和模型快照
添加仓库同步服务与执行器,支持手动触发同步和自动同步 新增仓库信息更新API和前端编辑界面 实现AI文档内容生成功能,支持自定义提示词 优化文档生成提示词,提高并行处理效率
- 移除未使用的变量、导入和注释 - 更新类型导入语法为type-only导入 - 简化错误处理逻辑 - 添加date-fns和terser依赖 - 调整TS配置降低严格性 - 优化表单验证hook的类型处理
- 移除矩阵策略,改为单独构建koala-wiki镜像 - 添加Node.js环境设置和前端依赖安装步骤 - 添加前端构建步骤并将产物复制到后端wwwroot目录 - 从Directory.Packages.props提取版本号用于镜像标签 - 更新镜像标签格式,包含latest和版本号标签
更新项目主版本号以反映重大功能更新
This pull request introduces new user profile fields to the
User
domain model and updates the database schema for MySQL, PostgreSQL, and SQL Server providers to support these fields. Additionally, it upgrades several dependencies and development tools to their latest versions, improving compatibility and feature support.User Profile Enhancements:
User
entity:Bio
,Location
,Website
, andCompany
for richer user profiles.Users
table, ensuring all supported databases are updated. [1] [2] [3]Dependency and Tooling Upgrades:
Microsoft.SemanticKernel
,AngleSharp
,Mapster.DependencyInjection
,Polly
,OpenTelemetry
, andAspire.Hosting
to newer versions for improved features and bug fixes. [1] [2] [3] [4]Development Environment Improvements:
.gitignore
to solution items for better source control management.Versioning:
0.5.x
to0.7.x
inDirectory.Packages.props
to reflect the new features and changes.These changes collectively improve the user profile capabilities, keep dependencies up to date, and enhance the developer experience across environments.