fix(math-sprint): remove unused import and autoFocus attribute

**Lint fixes**:
- Removed unused TEAM_MOVE import from Validator.ts
- Removed autoFocus attribute from PlayingPhase input (a11y best practice)

**Reason**: These were flagged by Biome linter as issues.
The unused import was left over from development, and autoFocus
can cause accessibility problems.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-15 21:38:08 -05:00
parent b47b1cc03f
commit 51593eb44f
2 changed files with 9 additions and 17 deletions

View File

@@ -6,7 +6,6 @@
*/
import type { GameValidator, ValidationResult } from '@/lib/arcade/game-sdk'
import { TEAM_MOVE } from '@/lib/arcade/validation/types'
import type {
Difficulty,
MathSprintConfig,
@@ -16,9 +15,7 @@ import type {
Question,
} from './types'
export class MathSprintValidator
implements GameValidator<MathSprintState, MathSprintMove>
{
export class MathSprintValidator implements GameValidator<MathSprintState, MathSprintMove> {
/**
* Validate a game move
*/
@@ -222,11 +219,7 @@ export class MathSprintValidator
return { valid: true, newState }
}
private validateSetConfig(
state: MathSprintState,
field: string,
value: any
): ValidationResult {
private validateSetConfig(state: MathSprintState, field: string, value: any): ValidationResult {
if (state.gamePhase !== 'setup') {
return { valid: false, error: 'Cannot change config during game' }
}
@@ -255,11 +248,7 @@ export class MathSprintValidator
return questions
}
private generateQuestion(
difficulty: Difficulty,
operation: Operation,
id: string
): Question {
private generateQuestion(difficulty: Difficulty, operation: Operation, id: string): Question {
let operand1: number
let operand2: number
let correctAnswer: number

View File

@@ -80,7 +80,9 @@ export function PlayingPhase() {
marginBottom: '8px',
})}
>
<span className={css({ fontSize: 'sm', fontWeight: 'semibold' })}>Question {progress}</span>
<span className={css({ fontSize: 'sm', fontWeight: 'semibold' })}>
Question {progress}
</span>
<span className={css({ fontSize: 'sm', color: 'gray.600' })}>
{state.difficulty.charAt(0).toUpperCase() + state.difficulty.slice(1)}
</span>
@@ -211,7 +213,6 @@ export function PlayingPhase() {
onChange={(e) => setInputValue(e.target.value)}
onKeyDown={handleKeyDown}
placeholder="Type your answer..."
autoFocus
className={css({
flex: 1,
padding: '12px 16px',
@@ -334,7 +335,9 @@ export function PlayingPhase() {
{player?.name}
</span>
</div>
<span className={css({ fontSize: 'sm', fontWeight: 'bold', color: 'purple.600' })}>
<span
className={css({ fontSize: 'sm', fontWeight: 'bold', color: 'purple.600' })}
>
{score} pts
</span>
</div>