From dfa75719d055608d8da1f64f05393f969ea91272 Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 10 Aug 2026 15:32:31 +0200 Subject: [PATCH] Show pregame lobby chat in admin session logs Admins can now see the full lobby chat transcript (who said what, when) at the top of a session's log view, alongside the existing per-player terminal logs. Also swaps the log tabs' inline onclick handler for a data attribute, in prep for moving the tab-switching script out of the template. Co-Authored-By: Claude Sonnet 5 --- src/Game/Controller/GameAdminController.php | 4 ++- templates/game/admin/sessions/view.html.twig | 37 ++++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/Game/Controller/GameAdminController.php b/src/Game/Controller/GameAdminController.php index 763f671..33877fa 100644 --- a/src/Game/Controller/GameAdminController.php +++ b/src/Game/Controller/GameAdminController.php @@ -7,6 +7,7 @@ namespace App\Game\Controller; use App\Game\Entity\Session; use App\Game\Enum\SessionStatus; use App\Game\Repository\GameRepository; +use App\Game\Repository\LobbyMessageRepository; use App\Game\Repository\SessionRepository; use App\Tech\Repository\UserRepository; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -49,7 +50,7 @@ final class GameAdminController extends AbstractController } #[Route('/session/{session}', name: 'game_admin_view_session', methods: ['GET'])] - public function viewSession(Session $session): Response + public function viewSession(Session $session, LobbyMessageRepository $lobbyMessageRepository): Response { $playersLogs = []; foreach ($session->getPlayers() as $player) { @@ -65,6 +66,7 @@ final class GameAdminController extends AbstractController return $this->render('game/admin/sessions/view.html.twig', [ 'session' => $session, 'playersLogs' => $playersLogs, + 'lobbyMessages' => $lobbyMessageRepository->findForSession($session), ]); } } diff --git a/templates/game/admin/sessions/view.html.twig b/templates/game/admin/sessions/view.html.twig index 62b1640..cfbda72 100644 --- a/templates/game/admin/sessions/view.html.twig +++ b/templates/game/admin/sessions/view.html.twig @@ -10,6 +10,24 @@

{{ session.game.name }} — Session #{{ session.id }}

{{ session.status.value }} · {{ session.players|length }} player(s) · Created {{ session.created|date('Y-m-d H:i') }}

+
+

Pregame lobby chat

+ + {% if lobbyMessages is empty %} +

No lobby chat messages for this session.

+ {% else %} +
+ {% for message in lobbyMessages %} +
+ {{ message.player.user.username }} + {{ message.createdAt|date('Y-m-d H:i') }} +
{{ message.content }}
+
+ {% endfor %} +
+ {% endif %} +
+ {% if playersLogs is empty %}
No players in this session. @@ -19,7 +37,7 @@
{% for playerLog in playersLogs %}