Fix auto play label and first step behavior

- Change initial play button label from Resume to Auto Play
- Ensure first step opens a single box when manually stepping
- Adjust logic to start from an initial idle state (-1) to align with expected behavior

X-Lovable-Edit-ID: edt-70f04cee-2de9-4621-9009-66a571a91a4f
This commit is contained in:
gpt-engineer-app[bot] 2025-11-19 03:49:23 +00:00
commit 6450824c73

View file

@ -23,7 +23,7 @@ const PresentsPuzzle = ({
const [aliceFound, setAliceFound] = useState(0);
const [bobFound, setBobFound] = useState(0);
const [isRunning, setIsRunning] = useState(false);
const [currentStep, setCurrentStep] = useState(0);
const [currentStep, setCurrentStep] = useState(-1);
const [aliceOrder, setAliceOrder] = useState<number[]>([]);
const [bobOrder, setBobOrder] = useState<number[]>([]);
const [winner, setWinner] = useState<'alice' | 'bob' | 'tie' | null>(null);
@ -406,7 +406,7 @@ const PresentsPuzzle = ({
className="gap-2"
>
<Play className="w-4 h-4" />
{currentStep === -1 ? 'Start' : 'Resume'}
{currentStep === -1 ? 'Auto Play' : 'Resume'}
</Button>
<Button
onClick={pauseSimulation}