Show default chess control detail in room summary
All checks were successful
CI / Deploy / test (push) Successful in 1m12s
CI / Deploy / deploy (push) Successful in 1m5s

- Use the selected chess time control detail when available
- Fall back to a balanced default description when no match is found
This commit is contained in:
syntaxbullet
2026-04-10 11:36:32 +02:00
parent cb056e010f
commit b0a103d8ce

View File

@@ -142,7 +142,8 @@ function CreateRoomDialog({
if (!show) return null;
const selectedGame = configGame ? gameUIRegistry.get(configGame) : null;
const selectedChessControl = CHESS_TIME_CONTROLS.find(control => control.key === chessTimeControl) ?? CHESS_TIME_CONTROLS[0];
const selectedChessControl = CHESS_TIME_CONTROLS.find(control => control.key === chessTimeControl);
const selectedChessControlDetail = selectedChessControl?.detail ?? "Balanced default for most quick matches.";
return (
<div
@@ -271,7 +272,7 @@ function CreateRoomDialog({
<div className={cn("rounded-3xl border p-4", gameSurfaceClass("chess"))}>
<div className="text-[11px] uppercase tracking-[0.2em] text-text-disabled">Room Summary</div>
<div className="mt-3 text-lg font-semibold text-foreground">{CHESS_TIME_CONTROL_LABELS[chessTimeControl]}</div>
<div className="mt-1 text-sm text-text-tertiary">{selectedChessControl.detail}</div>
<div className="mt-1 text-sm text-text-tertiary">{selectedChessControlDetail}</div>
<div className="mt-4 space-y-3 text-sm text-text-secondary">
<div className="flex items-center justify-between gap-3">
<span>Launch</span>