Tell why a champ select makes a champion unavailable (#74)

Split the excluded set into banned and taken_by_ally, add
ChampSelect::unavailability (banned, taken_by_ally, not_offered; never for
the player's own pick) and make the anvil list an Option so an unreadable
list is not read as an empty one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
nessarandClaude Opus 5.5 committed 2026-11-20 21:12:42 +01:00
1 parent 9c13e14072
commit bd4de1ec05
6 files changed
+302 -59

No files matched your search

+4 -3
View File
@@ -797,6 +797,7 @@ impl Page {
.map(|s| {
s.anvil_champions
.iter()
.flatten()
.map(|id| {
let row = rows.iter().find(|r| r.champion.id == *id);
let mut label = champion_label(row, *id);
@@ -1254,7 +1255,7 @@ mod tests {
tracker.sync("Bob#EUW", &mut |_| {}).unwrap();
tracker.follow_client(0, Some("Alice#EUW"), &mut |_| {});
let (page, mut window) = open_page_with_tracker(cx, tracker);
let pick = ChampSelect::new(Some(39), [39].into(), vec![39]);
let pick = ChampSelect::new(Some(39), [39].into(), Some(vec![39]));
window.update(|w, cx| {
page.update(cx, |p, cx| {
// The table that follows the champ select pool back is the Statistics one.
@@ -1282,7 +1283,7 @@ mod tests {
});
// A hover change touches neither the Account nor the pool: the panel must still update.
let next = ChampSelect::new(None, [39].into(), vec![39]);
let next = ChampSelect::new(None, [39].into(), Some(vec![39]));
window.update(|w, cx| {
page.update(cx, |p, cx| {
p.apply(Msg::ChampSelect(Some(("Alice#EUW".into(), next))), w, cx);
@@ -1323,7 +1324,7 @@ mod tests {
},
)
});
let hovered = |current| ChampSelect::new(current, [39].into(), vec![39]);
let hovered = |current| ChampSelect::new(current, [39].into(), Some(vec![39]));
for champ_select in [
None,
Some(("Alice#EUW".into(), hovered(Some(39)))),