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
This commit is contained in:
Frank Schwenk
2025-10-30 10:41:38 +01:00
parent 4c8b0cfed7
commit 301d5b131c

View File

@@ -612,6 +612,8 @@ const GameTypeStep = ({ onNext, onCancel, initialValue = '' }: GameTypeStepProps
const handleSelect = (selectedType: string) => { const handleSelect = (selectedType: string) => {
setGameType(selectedType); setGameType(selectedType);
// Auto-advance to next step on selection
onNext(selectedType);
}; };
const handleSubmit = (e: Event) => { const handleSubmit = (e: Event) => {
@@ -706,7 +708,11 @@ const RaceToStep = ({ onNext, onCancel, initialValue = '', gameType }: RaceToSte
const handleQuickPick = (value: number) => { const handleQuickPick = (value: number) => {
// For endlos (endless) games, use Infinity to prevent automatic completion // 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) => { const handleInputChange = (e: Event) => {