Count all eligible positions in dashboard position coverage

Previously only counted pos_1; now uses Player::positions() to tally
all position fields (pos_1-pos_8) so multi-position players are counted
at each eligible position.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-02-28 11:58:14 -06:00
parent 3e736442c7
commit a033a28b5a

View File

@ -221,11 +221,11 @@ impl DashboardState {
self.il_count = roster.il.len(); self.il_count = roster.il.len();
self.swar_total = roster.majors.iter().filter_map(|p| p.swar).sum(); self.swar_total = roster.majors.iter().filter_map(|p| p.swar).sum();
// Compute position counts from majors roster // Compute position counts from majors roster (all eligible positions)
let mut counts: HashMap<String, usize> = HashMap::new(); let mut counts: HashMap<String, usize> = HashMap::new();
for player in &roster.majors { for player in &roster.majors {
if let Some(pos) = &player.pos_1 { for pos in player.positions() {
*counts.entry(pos.clone()).or_insert(0) += 1; *counts.entry(pos.to_string()).or_insert(0) += 1;
} }
} }
self.position_counts = counts; self.position_counts = counts;