feat: show excluded rounds count and cutoff rating in player history (#21) #23

Merged
shcizo merged 4 commits from feat/show-excluded-rounds-count-21 into main 2026-05-25 11:18:38 +02:00
Owner

Summary

  • Add Excluded rounds row to player history accordion (desktop + mobile) showing the count of rounds filtered out by the 2.5σ/100p outlier filter
  • Add Cutoff rating row showing the effective threshold max(mean − 100, mean − 2.5σ) that was actually applied
  • Persist excluded_rounds_count and cutoff_rating on players table (lazy backfill on next round-history refresh)
  • Remove the "View calculation details" modal entirely (HTML, JS, CSS, debugLog API field)

Closes #21

Notes

  • No backfill: existing players keep NULL for the new columns until they're refreshed. Bulk-refresh only updates current ratings, not predicted-rating fields.
  • Fallback handling: when outlier removal would leave fewer than 4 rounds, the calculator keeps all rounds — in that case both excludedRoundsCount and cutoffRating are reset (the filter was identified but not applied), so the UI reflects what actually happened.
  • Scope extension: cutoff rating was originally out of scope per the issue text but added after user feedback during manual testing.

Test plan

  • First app boot logs Adding excluded_rounds_count column… and Adding cutoff_rating column…
  • Second boot does NOT log the migration messages (idempotent)
  • Player with ≥7 rounds after refresh shows both Excluded rounds: N and Cutoff rating: X in desktop accordion
  • Same player shows both rows in mobile cards view
  • Player with <7 rounds shows Excluded rounds: 0 but no Cutoff rating row
  • Legacy player (not refreshed since deploy) shows neither row until refreshed
  • "View calculation details →" button gone from desktop accordion
  • Add-player and target-rating modals still work
  • POST /api/refresh-round-history/:pdga response contains excludedRoundsCount + cutoffRating, no debugLog
## Summary - Add `Excluded rounds` row to player history accordion (desktop + mobile) showing the count of rounds filtered out by the 2.5σ/100p outlier filter - Add `Cutoff rating` row showing the effective threshold `max(mean − 100, mean − 2.5σ)` that was actually applied - Persist `excluded_rounds_count` and `cutoff_rating` on `players` table (lazy backfill on next round-history refresh) - Remove the "View calculation details" modal entirely (HTML, JS, CSS, `debugLog` API field) Closes #21 ## Notes - **No backfill**: existing players keep `NULL` for the new columns until they're refreshed. Bulk-refresh only updates current ratings, not predicted-rating fields. - **Fallback handling**: when outlier removal would leave fewer than 4 rounds, the calculator keeps all rounds — in that case both `excludedRoundsCount` and `cutoffRating` are reset (the filter was identified but not applied), so the UI reflects what actually happened. - **Scope extension**: cutoff rating was originally out of scope per the issue text but added after user feedback during manual testing. ## Test plan - [ ] First app boot logs `Adding excluded_rounds_count column…` and `Adding cutoff_rating column…` - [ ] Second boot does NOT log the migration messages (idempotent) - [ ] Player with ≥7 rounds after refresh shows both `Excluded rounds: N` and `Cutoff rating: X` in desktop accordion - [ ] Same player shows both rows in mobile cards view - [ ] Player with <7 rounds shows `Excluded rounds: 0` but no `Cutoff rating` row - [ ] Legacy player (not refreshed since deploy) shows neither row until refreshed - [ ] "View calculation details →" button gone from desktop accordion - [ ] Add-player and target-rating modals still work - [ ] `POST /api/refresh-round-history/:pdga` response contains `excludedRoundsCount` + `cutoffRating`, no `debugLog`
shcizo added 4 commits 2026-05-25 11:18:21 +02:00
shcizo merged commit f8233960d2 into main 2026-05-25 11:18:38 +02:00
Sign in to join this conversation.