Fix web client interaction and layout bugs
Placing a card locked the turn in: the chosen card left the hand and no affordance reverted the placement, forcing the move through. Clicking the chosen destination again or pressing Escape now steps the selection back. A failing ONNX inference left the AI's turn unadvanced, permanently stalling the game. The AI turn now falls back to the heuristic policy. Other fixes: the score plaque no longer covers hand cards (plaques become compact chips at narrow widths and hand spacing tracks the viewport), opponent cards drawn from a discard pile render face up, long expedition stacks stay inside their lane, undo no longer bumps the generation counter on empty history, and small viewports scroll instead of clipping. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LmyprzuzanXRhpomc3Ga1i
This commit is contained in:
@@ -40,7 +40,7 @@ class OnnxPolicy implements Policy {
|
||||
}
|
||||
}
|
||||
|
||||
class HeuristicPolicy implements Policy {
|
||||
export class HeuristicPolicy implements Policy {
|
||||
readonly provider = "heuristic" as const;
|
||||
|
||||
async action(state: GameState): Promise<number> {
|
||||
@@ -100,3 +100,10 @@ export function loadPolicy(): Promise<{ policy: Policy; warning?: string }> {
|
||||
policyPromise ??= initializePolicy();
|
||||
return policyPromise;
|
||||
}
|
||||
|
||||
let heuristicFallback: HeuristicPolicy | undefined;
|
||||
|
||||
export function fallbackHeuristicPolicy(): HeuristicPolicy {
|
||||
heuristicFallback ??= new HeuristicPolicy();
|
||||
return heuristicFallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user