Skip to content

feat(leaderboard): per-faction data freshness (#212)#228

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/leaderboard-freshness
Jun 14, 2026
Merged

feat(leaderboard): per-faction data freshness (#212)#228
dmccoystephenson merged 1 commit into
mainfrom
feature/leaderboard-freshness

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

Adds a "Updated N days ago" line to each faction row (from faction.updatedAt), so visitors can judge whether a member count is current. Backed by a new pure helper utils/relativeTime.relativeTimeFrom(iso, now) (now passed in for testability).

Test plan

  • npm test 74 pass (5 new in relativeTime.test.ts: just-now, minutes sing/plural, hours, days, unparseable).
  • npm run lint clean, npm run build succeeds. Verified the Server cell renders once (no markup duplication).

Closes #212

Each faction row now displays "Updated N days ago" from its updatedAt, so a
stale member count (a server that stopped syncing) is distinguishable from a
live one. Adds a pure, tested utils/relativeTime.relativeTimeFrom helper.

Closes #212

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (CI green):

  • Scope: PASS — new relativeTime util + test, leaderboard cell, CHANGELOG; all for Leaderboard: no indication of how fresh the faction data is #212.
  • Tests-new: PASS — relativeTimeFrom has 5 tests covering each unit + plural + invalid input.
  • Sibling structure: PASS — util matches utils/* (pure fn, now-injected for testability); test mirrors sortPlugins/likedItems.
  • Self-caught defect: an over-broad first edit duplicated the Server ; removed it and verified exactly one label={faction.serverId} remains + clean build.
  • Issue resolution: PASS — per-row freshness shown from updatedAt.
  • Docs: PASS — CHANGELOG. CI: PASS. no-any: PASS. mui-only: PASS. env-vars-documented: N/A.

@dmccoystephenson dmccoystephenson merged commit d545896 into main Jun 14, 2026
2 checks passed
@dmccoystephenson dmccoystephenson deleted the feature/leaderboard-freshness branch June 14, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Leaderboard: no indication of how fresh the faction data is

1 participant