fix(policy): unblock upgrade confirmation after card selection

This commit is contained in:
0xrsydn 2026-09-22 12:45:46 +07:00
commit 1e14680c39
2 changed files with 25 additions and 1 deletions

View file

@ -119,7 +119,12 @@ class PolicyContext:
if inventory_item(old) == inventory_item(new):
return
elif action == "combat_select_card":
if len(screen.get("selected_cards") or []) <= len(pending.screen.get("selected_cards") or []):
# Upgrade previews do not expose selected_cards. A ready upgrade
# confirmation is completion evidence for the accepted selection.
upgrade_ready = screen.get("mode") == "upgrade_select" and screen.get("can_confirm")
selection_grew = (len(screen.get("selected_cards") or [])
> len(pending.screen.get("selected_cards") or []))
if not upgrade_ready and not selection_grew:
return
elif action == "select_bundle":
if not screen.get("preview_showing") or not screen.get("can_confirm"):