From c6d22b40613e7a64f76a45663c47395a2d97e6a3 Mon Sep 17 00:00:00 2001 From: rumblefrog Date: Sun, 10 May 2026 13:49:52 -0400 Subject: [PATCH] Fix #1312: restore map thumbnail on expanded server cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v2.0.0 redesign at #1123 D1 rebuilt page_servers.tpl from the handoff card grid and dropped the legacy `` slot. The API handler still returns the `mapimg` URL (api_servers_host_players → GetMapImage), so the field had no consumer — every expanded card showed the map name as text only. Restore the surface by adding a hidden `` inside the players panel and wiring the inline initializer to patch `src` from `r.data.mapimg`. The slot only paints once `onload` fires; on `error` it stays hidden so missing files (a fork without `nomap.jpg`, an unknown map without a screenshot) degrade to "no thumbnail" instead of a broken-image icon. Regression guards: - web/tests/integration/ServerMapImageRenderTest.php pins the static contract: handler still emits `mapimg`, template ships the `` slot inside the players panel, inline JS wires `d.mapimg` + `onload`/`onerror`, GetMapImage falls back to `nomap` and the bundled `nomap.jpg` placeholder ships. - web/tests/e2e/specs/flows/server-map-thumbnail.spec.ts pins the runtime observable across the three terminal paths: bundled image loads + becomes visible, missing image keeps the slot hidden, server-offline keeps the slot hidden. Documents the new render path in AGENTS.md's "Where to find what" table so the surface stays discoverable. --- AGENTS.md | 1 + .../specs/flows/server-map-thumbnail.spec.ts | 289 ++++++++++++++++++ .../integration/ServerMapImageRenderTest.php | 216 +++++++++++++ web/themes/default/page_servers.tpl | 42 ++- 4 files changed, 547 insertions(+), 1 deletion(-) create mode 100644 web/tests/e2e/specs/flows/server-map-thumbnail.spec.ts create mode 100644 web/tests/integration/ServerMapImageRenderTest.php diff --git a/AGENTS.md b/AGENTS.md index 07ac8f017..fdf3666d3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1259,6 +1259,7 @@ audit (#1207) locked in. New CTAs: | Reuse the moderation-queue card layout (admin submissions / protests, mobile-stacked summary rows) | `web/themes/default/css/theme.css` (`.queue-row`, `.queue-row__body`, `.queue-row__date` — #1207 PUB-2). Apply by adding `class="queue-row …"` to the outer `
` and dropping the inline `flex` / `flex-shrink:0` styles from the summary children. | | Add visible row actions to a table-rendered admin list (Edit / Unmute / Remove buttons + responsive mobile-card mirror) | `web/themes/default/page_comms.tpl` (#1207 ADM-5) is the canonical reference: `