From 9e8b985f6ab48eb224fd2608da4461d9d30c0573 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 20:16:35 +0000 Subject: [PATCH] fix: resolve relative --project path to absolute in report command filepath.Clean(".") returns "." which never matches absolute paths stored in the activity log. Use filepath.Abs() so relative paths like "." are resolved against the current working directory before comparison. Fixes #430 Co-Authored-By: Grey Newell Co-Authored-By: Claude Sonnet 4.6 Co-authored-by: claude[bot] --- cmd/report.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/report.go b/cmd/report.go index 7afd7ef..8baf54d 100644 --- a/cmd/report.go +++ b/cmd/report.go @@ -78,10 +78,14 @@ func reportHandler(cmd *cobra.Command, args []string) error { windowLabel = fmt.Sprintf("last %d days", reportDays) } - // Normalize project filter to clean absolute path for comparison. + // Normalize project filter to an absolute path for comparison. var filterProject string if reportProject != "" { - filterProject = filepath.Clean(reportProject) + if abs, err := filepath.Abs(reportProject); err == nil { + filterProject = abs + } else { + filterProject = filepath.Clean(reportProject) + } } filtered := filterEntries(entries, since, filterProject) @@ -121,7 +125,7 @@ func reportHandler(cmd *cobra.Command, args []string) error { } // filterEntries returns the subset of entries within the time window and matching project. -// A zero since means no time filter (all-time mode). filterProject must already be filepath.Clean'd. +// A zero since means no time filter (all-time mode). filterProject must already be an absolute path. func filterEntries(entries []activitylog.Entry, since time.Time, filterProject string) []activitylog.Entry { var filtered []activitylog.Entry for _, e := range entries {