feat: 提交详情能看 diff,也能丢给 AI 审这一次改动。文件检查可单独排除路径,TODO 只认大写,避免把 todo 表和模块当成待办标记。

热力图按容器宽度铺满一年,不再横向滚动。托盘右键换成可换皮肤的弹层;更新下载显示进度,退出后再由脚本拉起安装器,避免还占着 exe。
This commit is contained in:
李琦
2026-08-19 15:46:03 +08:00
parent 1694397245
commit 7c4109f687
38 changed files with 2618 additions and 129 deletions

33
app.go
View File

@@ -335,7 +335,8 @@ func (a *App) RefreshProjectInsights(id int64) (ProjectInsights, error) {
return ProjectInsights{}, e
}
git, _ := a.store.GitStats(id)
x, e := (service.InsightService{}).Analyze(a.ctx, p, structure, git)
excludes, _ := a.store.InsightExcludes(id)
x, e := (service.InsightService{}).Analyze(a.ctx, p, structure, git, excludes)
if e != nil {
a.store.Log("error", "项目检查", "深度检查失败", p.Name+" | "+e.Error())
return x, e
@@ -438,12 +439,35 @@ func (a *App) DeleteRule(id int64) error {
return a.store.DeleteRule(id)
}
// GetProjectRules 项目专属排除规则(不含全局)。
// GetProjectRules 项目专属排除规则(不含全局、不含检查专用排除)。
func (a *App) GetProjectRules(projectID int64) ([]ExclusionRule, error) {
if e := a.ready(); e != nil {
return nil, e
}
return a.store.ProjectRules(projectID)
all, e := a.store.ProjectRules(projectID)
if e != nil {
return nil, e
}
return withoutRuleCategory(all, "insight"), nil
}
// GetInsightExcludes 文件检查专用排除(不影响行数统计)。
func (a *App) GetInsightExcludes(projectID int64) ([]ExclusionRule, error) {
if e := a.ready(); e != nil {
return nil, e
}
return a.store.InsightExcludes(projectID)
}
// AddInsightExclude 添加仅对文件检查生效的排除路径。
func (a *App) AddInsightExclude(projectID int64, pattern string) (ExclusionRule, error) {
if e := a.ready(); e != nil {
return ExclusionRule{}, e
}
if projectID <= 0 {
return ExclusionRule{}, errors.New("PROJECT_REQUIRED")
}
return a.store.AddProjectRule(projectID, pattern, "insight")
}
// AddProjectRule 给某项目添加专属排除规则。
@@ -454,6 +478,9 @@ func (a *App) AddProjectRule(projectID int64, pattern, category string) (Exclusi
if projectID <= 0 {
return ExclusionRule{}, errors.New("PROJECT_REQUIRED")
}
if category == "insight" {
category = "custom"
}
return a.store.AddProjectRule(projectID, pattern, category)
}
func (a *App) GetLogs(level string) ([]LogEntry, error) {