refactor: the server says a count one way, words.Count, for notifications, a wanted match's reason and the duplicate resolver's activity line (M505 #5643)
release / govulncheck (push) Successful in 22s
release / web (push) Successful in 1m35s
release / go (push) Successful in 1m45s
release / integration (push) Successful in 5m41s
release / android (push) Successful in 6m7s
release / Build signed APK (releases and dev) (push) Successful in 6m26s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 29s
release / Verify release artifacts (tag releases only) (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 16:18:50 -04:00
co-authored by Claude Opus 5.5
parent 9e24b2b4fc
commit db15713798
5 changed files with 42 additions and 21 deletions
+3 -4
View File
@@ -3,6 +3,8 @@ package notifications
import (
"encoding/json"
"fmt"
"git.fabledsword.com/bvandeusen/minstrel/internal/words"
)
// Rendered is a notification as people read it. The server renders it once,
@@ -138,13 +140,10 @@ func Render(kind Kind, payload []byte) Rendered {
}
func plural(n int64, one, many string) string {
if n == 1 {
return "1 " + one
}
if n < 1 {
// A coalesced kind always carries a count; this only guards a
// malformed row from reading "0 tracks went missing".
return "Some " + many
}
return fmt.Sprintf("%d %s", n, many)
return words.Count(n, one, many)
}