feat(admin): show moves and hints used on the user card
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 51s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m21s

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.
This commit is contained in:
Ilia Denisov
2026-06-18 00:09:39 +02:00
parent ed7c6ac56d
commit d97cec7d8a
3 changed files with 5 additions and 1 deletions
@@ -32,6 +32,8 @@
<li><b>Wins</b> {{.Stats.Wins}}</li>
<li><b>Losses</b> {{.Stats.Losses}}</li>
<li><b>Draws</b> {{.Stats.Draws}}</li>
<li><b>Moves</b> {{.Stats.Moves}}</li>
<li><b>Hints used</b> {{.Stats.HintsUsed}}</li>
<li><b>Best game</b> {{.Stats.MaxGamePoints}}</li>
<li><b>Best move</b> {{.Stats.MaxWordPoints}}</li>
</ul>
+2
View File
@@ -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.
@@ -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 {