Commit Graph

19 Commits

Author SHA1 Message Date
wonder 3e93344c7b test: 添加单元测试(config/services/handlers,共 59 个用例)
Deploy PR-Helper / deploy (push) Successful in 40s
2026-06-24 18:28:14 +08:00
wonder 496e3ba71e refactor: LLM 直接输出 Markdown,移除 JSON 解析层
Deploy PR-Helper / deploy (push) Successful in 30s
服务端:
- prompt 改为要求直接输出 Markdown,不再输出 JSON
- GeneratePR 返回 string 而非 PRDescription 结构体
- 移除 JSON 解析、extractJSON、fixInlineCode 等逻辑
- ChatStream 的 content 事件直接携带 Markdown 片段流式传输

前端:
- generate() 仅处理 content + done + error 三个事件
- content 事件累积 Markdown 文本,实时渲染到两栏
- 移除 parsePartialJSON、buildMarkdown 等中间层
- 代码量从 ~100 行减至 ~50 行
2026-06-21 16:02:05 +08:00
wonder 4a8e43e698 fix: 修复 PR 生成页 INLINECODE 显示及复制 Markdown 失败问题
Deploy PR-Helper / deploy (push) Successful in 26s
- 改进 LLM 提示词,明确要求用反引号包裹代码引用,避免输出 INLINECODE 占位符
- 后端新增 fixInlineCode 后处理,将残留 INLINECODE 占位符转为反引号代码
- 前端在 done 回调中从结构化字段组装完整 markdown 文本,修复复制按钮复制空内容
- 复制按钮增加空内容检查和错误提示
- Markdown 预览区域初始隐藏,生成完成后自动显示
2026-06-21 15:37:10 +08:00
wonder c7b03303e4 fix: 修复代码审查进度条逻辑
Deploy PR-Helper / deploy (push) Successful in 28s
- 后端: file_start 事件改为在获取信号量之后发送,避免并发时所有文件同时'开始'导致进度瞬间跳到90%
- 前端: 进度追踪改为基于 file_end 事件(完成)而非 file_start(开始),进度条平滑反映实际审查进度
2026-06-21 15:17:51 +08:00
wonder a6bd46db34 feat: support private repo cloning with HTTP basic auth
Deploy PR-Helper / deploy (push) Successful in 30s
- Add SSH URL detection with friendly prompt to use HTTPS instead
- Add private repo toggle (default off) with username/password fields
- Persist auth_type and credential in repositories table
- Pass stored credentials to PullRepo for authenticated pulls
- Incremental migration adds auth_type and credential columns
2026-06-21 14:58:12 +08:00
wonder 20be99b287 feat: add git pull to update cached repositories from remote
Deploy PR-Helper / deploy (push) Successful in 34s
- Replace dead FetchRemote with PullRepo (fetch + merge) in services/git.go
- Add POST /api/repos/:id/pull endpoint with DB size/last_used update
- Add '更新' button next to each cached repo in the index page
2026-06-21 14:31:33 +08:00
wonder 735126ff56 fix: escape 'key' as reserved word in all MySQL queries with backticks 2026-06-20 23:21:24 +08:00
wonder 6c60b767df refactor: replace chromedp with browser native print for PDF export
Remove chromedp dependency, use window.print() instead. Docker image no longer needs Chromium (~200MB smaller).

- Delete services/pdf.go and templates/reports/review.html

- Remove PDF API route POST /api/repos/:id/review/pdf

- Add @media print CSS to review page

- Remove chromium from Dockerfile
2026-06-20 22:26:46 +08:00
wonder 37aa9c0a33 fix: 结构化渲染审查总结,替换原始JSON显示
- 后端发送结构化数据(score/overall/findings/recommendations)而非格式化文本
- 增加灵活JSON解析,兼容LLM返回recommendations为数组的情况
- 前端渲染带样式的审查总结:评分徽章(颜色分级)、分区展示
- 两个页面统一处理:repo页面的内联审查和review页面的完整审查
2026-06-20 22:15:00 +08:00
wonder 292588ef23 feat: 将默认 LLM 配置从 OpenAI 切换为 DeepSeek (deepseek-v4-pro) 2026-06-20 22:03:09 +08:00
wonder 9c843b79ba feat: 添加用户注册登录功能,实现数据和配置的用户隔离
- 新增 users 和 user_settings 表,repositories/analyses/review_notes 添加 user_id 列
- 实现基于邮箱+密码的注册登录,密码使用 bcrypt 哈希
- 使用 gin-contrib/sessions cookie-based session 管理
- 所有仓库、分析记录、review notes 按用户隔离
- 用户设置(LLM 配置、review 参数、缓存配置)独立存储
- 新增登录/注册页面,导航栏显示用户邮箱和退出按钮
- 前端 fetch 请求统一添加 credentials: 'same-origin'
- 支持 SESSION_SECRET 环境变量配置会话密钥
2026-06-20 21:57:46 +08:00
wonder 46778bc227 refactor: 移除 services/git.go 中的无用代码 2026-06-20 00:06:03 +08:00
wonder a66074e49c feat: 并发文件审查,可配置并行度 2026-06-19 23:40:13 +08:00
wonder 0528eee4de feat: 持久化 AI 审查结果,文件级内联展示与页面集成 2026-06-19 23:24:06 +08:00
wonder a89d057716 fix: 使用正确的 SSE 事件名 'start' 展示审查进度 2026-06-19 23:05:01 +08:00
wonder b35d6f874b feat: Phase 5 — 审查备注编辑器与 PDF 导出 2026-06-19 22:10:13 +08:00
wonder afb270721c feat: Phase 4 — LLM 集成,PR 描述生成与 AI 代码审查 2026-06-19 19:43:18 +08:00
wonder 1f2cc662ea fix: 移除 Clone() 中过早触发的 SSE complete 事件 2026-06-18 23:22:41 +08:00
wonder 34ef868e10 feat: Phase 2 — Git 核心功能,go-git 克隆、SSE 进度、D3.js 图形、diff2html 查看器 2026-06-18 22:59:51 +08:00