-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
uncompact report --project . always returns zero results, even when the current project has activity log entries.
In cmd/report.go:82-85, the flag value is only cleaned, not resolved to an absolute path:
var filterProject string
if reportProject != "" {
filterProject = filepath.Clean(reportProject)
}filepath.Clean(".") returns "." — a relative path. But activity log entries store absolute paths (e.g. /home/user/myproject) set via proj.RootDir from project.Detect. The comparison in filterEntries at cmd/report.go:131 is:
filepath.Clean(e.Project) != filterProjectfilepath.Clean("/home/user/myproject") != "." is always true, so every entry is filtered out.
Steps to reproduce
- Run
uncompact runa few times to populate the activity log. cdinto that project directory.- Run
uncompact report --project . - Observe zero results even though events exist.
Fix
Resolve the flag value to an absolute path before storing it:
if reportProject != "" {
if abs, err := filepath.Abs(reportProject); err == nil {
filterProject = abs
} else {
filterProject = filepath.Clean(reportProject)
}
}Location
cmd/report.go:82-85(relative path not resolved)cmd/report.go:131(comparison using the unresolved path)
Note: logsHandler and statsHandler correctly call project.Detect (which calls os.Getwd() internally) to resolve the project path, so they are not affected. Only reportHandler has this bug.
@claude please implement this