From d97cec7d8ae180950e8cba83160ed2cef72119cc Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Thu, 18 Jun 2026 00:09:39 +0200 Subject: [PATCH] feat(admin): show moves and hints used on the user card The admin user-detail stats panel listed wins/losses/draws/best game/best move but not the two new lifetime counters. Surface them as raw operator-facing numbers (Moves, Hints used) next to the rest. Audit follow-up (no code needed elsewhere): the load-test harness uses the shared pkg/fbs codec and only checks result codes / reads a StateView subset, so the trailing StatsView/StateView/HintResult fields are backward-compatible there; the game-detail per-seat "hints used" already reflects the true total via the repurposed counter. --- .../internal/adminconsole/templates/pages/user_detail.gohtml | 2 ++ backend/internal/adminconsole/views.go | 2 ++ backend/internal/server/handlers_admin_console.go | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/internal/adminconsole/templates/pages/user_detail.gohtml b/backend/internal/adminconsole/templates/pages/user_detail.gohtml index 5d4b14b..b8ca25a 100644 --- a/backend/internal/adminconsole/templates/pages/user_detail.gohtml +++ b/backend/internal/adminconsole/templates/pages/user_detail.gohtml @@ -32,6 +32,8 @@
  • Wins {{.Stats.Wins}}
  • Losses {{.Stats.Losses}}
  • Draws {{.Stats.Draws}}
  • +
  • Moves {{.Stats.Moves}}
  • +
  • Hints used {{.Stats.HintsUsed}}
  • Best game {{.Stats.MaxGamePoints}}
  • Best move {{.Stats.MaxWordPoints}}
  • diff --git a/backend/internal/adminconsole/views.go b/backend/internal/adminconsole/views.go index 9b822d0..11a3de4 100644 --- a/backend/internal/adminconsole/views.go +++ b/backend/internal/adminconsole/views.go @@ -203,6 +203,8 @@ type StatsRow struct { Draws int MaxGamePoints int MaxWordPoints int + Moves int + HintsUsed int } // IdentityRow is one platform/email identity of an account. diff --git a/backend/internal/server/handlers_admin_console.go b/backend/internal/server/handlers_admin_console.go index 46b7e01..80a3146 100644 --- a/backend/internal/server/handlers_admin_console.go +++ b/backend/internal/server/handlers_admin_console.go @@ -348,7 +348,7 @@ func (s *Server) consoleUserDetail(c *gin.Context) { } if view.HasStats { if st, err := s.accounts.GetStats(ctx, id); err == nil { - view.Stats = adminconsole.StatsRow{Wins: st.Wins, Losses: st.Losses, Draws: st.Draws, MaxGamePoints: st.MaxGamePoints, MaxWordPoints: st.MaxWordPoints} + view.Stats = adminconsole.StatsRow{Wins: st.Wins, Losses: st.Losses, Draws: st.Draws, MaxGamePoints: st.MaxGamePoints, MaxWordPoints: st.MaxWordPoints, Moves: st.Moves, HintsUsed: st.HintsUsed} } } if ids, err := s.accounts.Identities(ctx, id); err == nil {