From 301d5b131cba0f594a1f9201e7de51b046de8db6 Mon Sep 17 00:00:00 2001 From: Frank Schwenk Date: Thu, 30 Oct 2025 10:41:38 +0100 Subject: [PATCH] feat(ux): auto-advance on game type and race selection - Step 4: selecting a game type immediately advances to step 5 - Step 5: selecting Endlos or a quick-pick number immediately finalizes race-to Improves flow by removing an extra click. No changes to validation. Refs #26 --- src/components/NewGame.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/NewGame.tsx b/src/components/NewGame.tsx index db155b8..f8af11d 100644 --- a/src/components/NewGame.tsx +++ b/src/components/NewGame.tsx @@ -612,6 +612,8 @@ const GameTypeStep = ({ onNext, onCancel, initialValue = '' }: GameTypeStepProps const handleSelect = (selectedType: string) => { setGameType(selectedType); + // Auto-advance to next step on selection + onNext(selectedType); }; const handleSubmit = (e: Event) => { @@ -706,7 +708,11 @@ const RaceToStep = ({ onNext, onCancel, initialValue = '', gameType }: RaceToSte const handleQuickPick = (value: number) => { // For endlos (endless) games, use Infinity to prevent automatic completion - setRaceTo(value === 0 ? 'Infinity' : value); + const selected = value === 0 ? 'Infinity' : value; + setRaceTo(selected); + // Auto-advance to the next step (finalize) when a quick pick is chosen + const raceToValue = selected === 'Infinity' ? Infinity : (parseInt(String(selected), 10) || 0); + onNext(raceToValue); }; const handleInputChange = (e: Event) => {