diff options
| -rw-r--r-- | internal/showcase/rank_history_svg.go | 11 | ||||
| -rw-r--r-- | internal/showcase/showcase.go | 17 |
2 files changed, 13 insertions, 15 deletions
diff --git a/internal/showcase/rank_history_svg.go b/internal/showcase/rank_history_svg.go index 67281cb..aae4dc1 100644 --- a/internal/showcase/rank_history_svg.go +++ b/internal/showcase/rank_history_svg.go @@ -37,10 +37,11 @@ type svgTimePoint struct { } // svgProjectData carries per-project metadata used by the interactive JS layer. -// Inactive is true when the project's average commit age exceeds 730 days AND -// the last commit was over a year ago — matching the gemtext inactivity notice. -// Inactive projects are rendered as grey lines by default and only switch to -// their project colour when the user mouses over their legend entry. +// Inactive is true when the project's average commit age (last 42 commits on +// HEAD) exceeds 730 days (~2 years). A single recent commit does not rescue +// a dormant project; ~42 recent commits are needed to move the average below +// the threshold. Inactive projects are rendered as grey lines by default and +// only switch to their project colour when the user mouses over their legend entry. type svgProjectData struct { Name string `json:"name"` Color string `json:"color"` @@ -393,7 +394,7 @@ svg{background:#1a1a2e;font-family:monospace} svgViewWidth/2, len(allProjects)) // Second subtitle: explain the grey lines so readers know what they mean. fmt.Fprintf(&svg, - `<text class="sub" x="%d" y="57" text-anchor="middle">grey lines = inactive projects (no meaningful commits in 1+ years) · hover legend entry to highlight</text>`, + `<text class="sub" x="%d" y="57" text-anchor="middle">grey lines = inactive projects (avg commit age > 2 years) · hover legend entry to highlight</text>`, svgViewWidth/2) // Rotated Y-axis label. diff --git a/internal/showcase/showcase.go b/internal/showcase/showcase.go index fbae2b7..4e8d637 100644 --- a/internal/showcase/showcase.go +++ b/internal/showcase/showcase.go @@ -1046,16 +1046,13 @@ func (g *Generator) formatGemtext(summaries []ProjectSummary) string { builder.WriteString("* 🧪 Status: Experimental (no releases yet)\n") } - // Check if project might be obsolete (avg age > 2 years AND last commit > 1 year) - if summary.Metadata.AvgCommitAge > 730 && summary.Metadata.LastCommitDate != "" { - // Parse the last commit date - lastCommit, err := time.Parse("2006-01-02", summary.Metadata.LastCommitDate) - if err == nil { - daysSinceLastCommit := time.Since(lastCommit).Hours() / 24 - if daysSinceLastCommit > 365 { - builder.WriteString("\n⚠️ **Notice**: This project appears to be finished, obsolete, or no longer maintained. Last meaningful activity was over 2 years ago. Use at your own risk.") - } - } + // Mark as inactive when the average age of the last 42 commits exceeds + // 730 days (~2 years). A single recent commit (e.g. a deprecation + // notice) does not rescue a dormant project — ~42 recent commits are + // required to move the average below the threshold. This matches the + // grey-line rule used in the interactive rank-history SVG. + if summary.Metadata.AvgCommitAge > 730 { + builder.WriteString("\n⚠️ **Notice**: This project appears to be inactive or no longer maintained. The average age of its last 42 commits exceeds 2 years. Use at your own risk.") } builder.WriteString("\n\n") } |
