From f6df9f7ba6a2d23f71481ea66146725ee82703ca Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 10 Aug 2026 14:58:01 +0200 Subject: [PATCH] Show friendly session status labels on the player dashboard Players saw the raw enum value (e.g. "created") in the sessions table, which doesn't mean anything to them. Adds SessionStatus::label() mapping each status to a player-facing description like "Waiting for players". --- src/Game/Enum/SessionStatus.php | 11 +++++++++++ templates/game/dashboard.html.twig | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Game/Enum/SessionStatus.php b/src/Game/Enum/SessionStatus.php index 9cb0149..4d07bf7 100644 --- a/src/Game/Enum/SessionStatus.php +++ b/src/Game/Enum/SessionStatus.php @@ -9,4 +9,15 @@ enum SessionStatus: string case PLAYING = 'playing'; case WON = 'won'; case LOST = 'lost'; + + public function label(): string + { + return match ($this) { + self::CREATED => 'Waiting for players', + self::READY => 'Waiting for players to be ready', + self::PLAYING => 'In progress', + self::WON => 'Completed - Won', + self::LOST => 'Completed - Lost', + }; + } } diff --git a/templates/game/dashboard.html.twig b/templates/game/dashboard.html.twig index f9070c0..9b73fd7 100644 --- a/templates/game/dashboard.html.twig +++ b/templates/game/dashboard.html.twig @@ -67,7 +67,7 @@ {{ session.id }} {{ session.game.name }} - {{ session.status.value }} + {{ session.status.label }} {{ session.created|date('Y-m-d H:i') }} {% set inviteCode = '' %}