From cb20b78cbd9abc5bbaf3c69e8e2284a418f8aa9f Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Mon, 17 Aug 2026 20:09:20 -0400 Subject: [PATCH] feat(suramadu): the page says the match is over itself report.js polls headquarters for the result of the match and, once it exists, covers the page with a report of it and hides the client. Suramadu's "connection to the server is lost" card is built inside .suramadu-element when the container stops, so hiding that element is what keeps it off a player whose match is already over - no war patch, and the dialog still works for a page that is not a finished match. The result lands in S3 about five seconds after the game is decided, a minute before the container stops, which is the window this fills. A match that ended without a result says so instead of waiting forever. flare.css moves its two z-indexes above the report: the end of a match is when a player most has something to say about it. Co-Authored-By: Claude Opus 5 (1M context) --- TODO.md | 21 ++- suramadu/web/flare.css | 7 +- suramadu/web/index.html | 17 +- suramadu/web/report.css | 226 +++++++++++++++++++++++ suramadu/web/report.js | 331 ++++++++++++++++++++++++++++++++++ tests/shell/test-report-ui.sh | 159 ++++++++++++++++ 6 files changed, 750 insertions(+), 11 deletions(-) create mode 100644 suramadu/web/report.css create mode 100644 suramadu/web/report.js create mode 100755 tests/shell/test-report-ui.sh diff --git a/TODO.md b/TODO.md index f962074..1e89e85 100644 --- a/TODO.md +++ b/TODO.md @@ -92,12 +92,21 @@ the finish is supposed to leave behind. rooted in the container. Decide whether the client should have a File menu at all here; that is the same question as the read-only save paths below, and it wants answering once. -- [ ] **Suramadu still says "connection to the server is lost"** when the - linger ends. The dialog is the war's, and is reachable either from the - `options.customization` seam perf.js already uses or by a war patch; - gate it on the match being over so a real network drop still offers - Reconnect. It is the last screen in the way of the page saying the - match is over itself. +- [x] **The page says the match is over itself.** `suramadu/web/report.js` + polls headquarters' `/api/matches//result` and, when the result of + the match exists, covers the page with a report of it and hides the + client - so Suramadu's "connection to the server is lost" card, built + inside `.suramadu-element` when the container stops, is built inside + something that no longer paints. No war patch and no `customization` + seam: the dialog is left exactly as it is and simply never seen. + `result.json` carries `victoryTeam` and `victoryPlayerId` now, because a + forced victory leaves the loser's units standing and a report inferring + the winner from the counts would get that case backwards. +- [ ] **A reload after the container stops has nothing to show.** The report + lives in the page the container serves, so refreshing it once the task + is gone gets the proxy's 502 rather than the match's result. The durable + copy is in S3 and headquarters can already read it; what is missing is a + screen on the site that does. - [ ] **Save dialogs write into the read-only image tree.** No longer raised at the end of a match - both nags are off - but still reachable from the menus. "Save Unit List" defaults to `/opt/arena/megamek/TraineeA.mul` diff --git a/suramadu/web/flare.css b/suramadu/web/flare.css index 8d0ef32..4d6b675 100644 --- a/suramadu/web/flare.css +++ b/suramadu/web/flare.css @@ -8,11 +8,14 @@ * for. The custom properties are theme.css's. */ +/* Above the match report (report.css, 60): the end of a match is when a + player most has something to say about it, and a button under that screen + is a button that is gone. */ :root .lb-flare-button { position: fixed; right: 14px; top: 14px; - z-index: 40; + z-index: 70; display: flex; align-items: center; gap: 7px; @@ -47,7 +50,7 @@ :root .lb-flare-overlay { position: fixed; inset: 0; - z-index: 50; + z-index: 80; display: flex; align-items: center; justify-content: center; diff --git a/suramadu/web/index.html b/suramadu/web/index.html index e6ea32a..735c301 100644 --- a/suramadu/web/index.html +++ b/suramadu/web/index.html @@ -6,9 +6,10 @@ + + +