M007: getSuggestedTurn() is dead code — defined in engine but never imported or called #7

Closed
opened 2026-05-15 19:19:39 +00:00 by Mark · 1 comment
Owner

Severity: LOW
File: src/engine/openings.ts:131-151

Problem

getSuggestedTurn() correctly handles contingency branch selection (reads from branch.branchTurns[branchTurnIndex] when activeBranchIndex !== null), but it is never imported or called anywhere. OpeningSuggestion.tsx duplicates this logic inline and does it wrong (ignores branches).

Fix

Export getSuggestedTurn() from engine/openings.ts and use it in OpeningSuggestion.tsx to determine the current suggested turn. This fixes the contingency branch bug (issue #4) and eliminates dead code.

**Severity:** LOW **File:** src/engine/openings.ts:131-151 ## Problem `getSuggestedTurn()` correctly handles contingency branch selection (reads from `branch.branchTurns[branchTurnIndex]` when `activeBranchIndex !== null`), but it is never imported or called anywhere. OpeningSuggestion.tsx duplicates this logic inline and does it wrong (ignores branches). ## Fix Export `getSuggestedTurn()` from engine/openings.ts and use it in OpeningSuggestion.tsx to determine the current suggested turn. This fixes the contingency branch bug (issue #4) and eliminates dead code.
Author
Owner

Unblocking — lint gate now passes clean (47dfc01).

Unblocking — lint gate now passes clean (47dfc01).
Mark closed this issue 2026-05-16 17:23:30 +00:00
Sign in to join this conversation.
No description provided.