Compare commits

..

4 Commits

Author SHA1 Message Date
semantic-release-bot
ed42651319 chore(release): 4.4.0 [skip ci]
## [4.4.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.3.1...v4.4.0) (2025-10-16)

### Features

* **complement-race:** add mini app navigation bar ([ed0ef2d](ed0ef2d3b8))
2025-10-16 17:17:45 +00:00
Thomas Hallock
ed0ef2d3b8 feat(complement-race): add mini app navigation bar
Adds PageWithNav wrapper to complement-race game for consistency with
other arcade games.

## Changes
- Created `GameComponent.tsx` wrapper that includes PageWithNav
- Wraps existing ComplementRaceGame with navigation bar
- Updates game title and emoji based on selected style:
  - Practice mode: "Complement Race" 🏁
  - Sprint mode: "Steam Sprint" 🚂
  - Survival mode: "Endless Circuit" ♾️
- Provides exit session and new game callbacks
- Emphasizes player selection during setup phase

## Integration
- Updated index.tsx to use new GameComponent instead of direct ComplementRaceGame
- Maintains all existing game functionality
- Navigation bar now matches other arcade games (matching, number-guesser)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 12:16:39 -05:00
semantic-release-bot
197297457b chore(release): 4.3.1 [skip ci]
## [4.3.1](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.3.0...v4.3.1) (2025-10-16)

### Bug Fixes

* **complement-race:** resolve TypeScript errors in state adapter ([59abcca](59abcca4c4))
2025-10-16 17:10:39 +00:00
Thomas Hallock
59abcca4c4 fix(complement-race): resolve TypeScript errors in state adapter
Fixes TypeScript compilation errors that prevented dev server from starting.

## Issues Fixed

1. **Provider.tsx - gamePhase type mismatch**
   - Added explicit type annotation for gamePhase variable
   - Properly maps multiplayer phases (setup/lobby) to single-player phases (controls)

2. **Provider.tsx - timeLimit undefined handling**
   - Convert undefined to null: `timeLimit ?? null`
   - Matches CompatibleGameState interface expectation

3. **Provider.tsx - difficultyTracker type**
   - Import DifficultyTracker type from gameTypes
   - Replace `any` with proper DifficultyTracker type
   - Fixes unknown type errors in useAdaptiveDifficulty hook

4. **useSteamJourney.ts - index signature error**
   - Add type assertion: `as keyof typeof MOMENTUM_DECAY_RATES`
   - Fixes "no index signature" error when accessing decay rates

## Verification
-  TypeScript: Zero compilation errors
-  Format: Biome passes
-  Lint: No new warnings

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-16 12:09:47 -05:00
6 changed files with 94 additions and 10 deletions

View File

@@ -1,3 +1,17 @@
## [4.4.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.3.1...v4.4.0) (2025-10-16)
### Features
* **complement-race:** add mini app navigation bar ([ed0ef2d](https://github.com/antialias/soroban-abacus-flashcards/commit/ed0ef2d3b87324470d06b3246652967544caec26))
## [4.3.1](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.3.0...v4.3.1) (2025-10-16)
### Bug Fixes
* **complement-race:** resolve TypeScript errors in state adapter ([59abcca](https://github.com/antialias/soroban-abacus-flashcards/commit/59abcca4c4192ca28944fa1fa366791d557c1c27))
## [4.3.0](https://github.com/antialias/soroban-abacus-flashcards/compare/v4.2.2...v4.3.0) (2025-10-16)

View File

@@ -78,7 +78,9 @@ export function useSteamJourney() {
// Steam Sprint is infinite - no time limit
// Get decay rate based on timeout setting (skill level)
const decayRate = MOMENTUM_DECAY_RATES[state.timeoutSetting] || MOMENTUM_DECAY_RATES.normal
const decayRate =
MOMENTUM_DECAY_RATES[state.timeoutSetting as keyof typeof MOMENTUM_DECAY_RATES] ||
MOMENTUM_DECAY_RATES.normal
// Calculate momentum decay for this frame
const momentumLoss = (decayRate * deltaTime) / 1000

View File

@@ -16,6 +16,7 @@ import {
useViewerId,
} from '@/lib/arcade/game-sdk'
import { DEFAULT_COMPLEMENT_RACE_CONFIG } from '@/lib/arcade/game-configs'
import type { DifficultyTracker } from '@/app/arcade/complement-race/lib/gameTypes'
import type { ComplementRaceConfig, ComplementRaceMove, ComplementRaceState } from './types'
/**
@@ -43,7 +44,7 @@ interface CompatibleGameState {
// Game status
isGameActive: boolean
isPaused: boolean
gamePhase: string
gamePhase: 'intro' | 'controls' | 'countdown' | 'playing' | 'results'
// Timing
gameStartTime: number | null
@@ -79,8 +80,8 @@ interface CompatibleGameState {
// UI state
showScoreModal: boolean
activeSpeechBubbles: Map<string, string>
adaptiveFeedback: any | null
difficultyTracker: any
adaptiveFeedback: { message: string; type: string } | null
difficultyTracker: DifficultyTracker
}
/**
@@ -244,8 +245,16 @@ export function ComplementRaceProvider({ children }: { children: ReactNode }) {
const localPlayer = localPlayerId ? multiplayerState.players[localPlayerId] : null
// Map gamePhase: setup/lobby -> controls
let gamePhase = multiplayerState.gamePhase
if (gamePhase === 'setup' || gamePhase === 'lobby') {
let gamePhase: 'intro' | 'controls' | 'countdown' | 'playing' | 'results'
if (multiplayerState.gamePhase === 'setup' || multiplayerState.gamePhase === 'lobby') {
gamePhase = 'controls'
} else if (multiplayerState.gamePhase === 'countdown') {
gamePhase = 'countdown'
} else if (multiplayerState.gamePhase === 'playing') {
gamePhase = 'playing'
} else if (multiplayerState.gamePhase === 'results') {
gamePhase = 'results'
} else {
gamePhase = 'controls'
}
@@ -280,7 +289,7 @@ export function ComplementRaceProvider({ children }: { children: ReactNode }) {
// Race mechanics
raceGoal: multiplayerState.config.raceGoal,
timeLimit: multiplayerState.config.timeLimit,
timeLimit: multiplayerState.config.timeLimit ?? null,
speedMultiplier: 1.0,
aiRacers: multiplayerState.aiOpponents.map((ai) => ({
id: ai.id,

View File

@@ -0,0 +1,59 @@
/**
* Complement Race Game Component with Navigation
* Wraps the existing ComplementRaceGame with PageWithNav for arcade play
*/
'use client'
import { useRouter } from 'next/navigation'
import { PageWithNav } from '@/components/PageWithNav'
import { ComplementRaceGame } from '@/app/arcade/complement-race/components/ComplementRaceGame'
import { useComplementRace } from '../Provider'
export function GameComponent() {
const router = useRouter()
const { state, exitSession, goToSetup } = useComplementRace()
// Get display name based on style
const getNavTitle = () => {
switch (state.style) {
case 'sprint':
return 'Steam Sprint'
case 'survival':
return 'Endless Circuit'
case 'practice':
default:
return 'Complement Race'
}
}
// Get emoji based on style
const getNavEmoji = () => {
switch (state.style) {
case 'sprint':
return '🚂'
case 'survival':
return '♾️'
case 'practice':
default:
return '🏁'
}
}
return (
<PageWithNav
navTitle={getNavTitle()}
navEmoji={getNavEmoji()}
emphasizePlayerSelection={state.gamePhase === 'controls'}
onExitSession={() => {
exitSession()
router.push('/arcade')
}}
onNewGame={() => {
goToSetup()
}}
>
<ComplementRaceGame />
</PageWithNav>
)
}

View File

@@ -7,7 +7,7 @@ import { defineGame } from '@/lib/arcade/game-sdk'
import type { GameManifest } from '@/lib/arcade/game-sdk'
import { complementRaceValidator } from './Validator'
import { ComplementRaceProvider } from './Provider'
import { ComplementRaceGame } from '@/app/arcade/complement-race/components/ComplementRaceGame'
import { GameComponent } from './components/GameComponent'
import type { ComplementRaceConfig, ComplementRaceState, ComplementRaceMove } from './types'
// Game manifest
@@ -69,7 +69,7 @@ export const complementRaceGame = defineGame<
>({
manifest,
Provider: ComplementRaceProvider,
GameComponent: ComplementRaceGame,
GameComponent,
validator: complementRaceValidator,
defaultConfig,
validateConfig: validateComplementRaceConfig,

View File

@@ -1,6 +1,6 @@
{
"name": "soroban-monorepo",
"version": "4.3.0",
"version": "4.4.0",
"private": true,
"description": "Beautiful Soroban Flashcard Generator - Monorepo",
"workspaces": [