From 8f0b079fa4b990b53e1a0ebc271821dcc3a4f013 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Thu, 13 Aug 2026 16:45:53 -0600 Subject: [PATCH] feat(vega-gnn): suppress ranking/relations pages during espionage alerts When a fresh espionage notification is pending, skip ranking metrics and relations pages so the alert reads as a focused notification rather than being interleaved with unrelated charts. Reopening GNN without pending events (using history) always shows the full experience, providing an escape hatch for players who want the charts. --- src/games/mastervega/VegaGnnScreen.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/games/mastervega/VegaGnnScreen.js b/src/games/mastervega/VegaGnnScreen.js index f1124a7..347a6f6 100644 --- a/src/games/mastervega/VegaGnnScreen.js +++ b/src/games/mastervega/VegaGnnScreen.js @@ -583,11 +583,20 @@ export function openGnnScreen(scene, rules, state, art, opts = {}) { const storyEvents = usingHistory ? (state.gnn?.history ?? []) : pending; const storyPages = storyEvents.map((ev) => ({ kind: 'story', desc: Gnn.describeGnnStory(rules, state, ev) })); - const rankingPages = Gnn.RANKING_METRICS.map((metric) => ({ kind: 'ranking', metric })); - // Always-accessible: present every time GNN opens, independent of - // whether there's a pending story — same footing as the ranking pages. - const relationsPage = { kind: 'relations' }; - const pages = [...storyPages, ...rankingPages, relationsPage]; + // A spying/sabotage notification is a targeted alert, not a newscast — + // skip the ranking/relations pages so it reads as "here's what just + // happened," not "here's what just happened, now flip through five + // unrelated charts" (Brian's ask). Only suppresses on a FRESH pending + // notification; reopening GNN on demand with nothing pending + // (usingHistory) always gets the full experience back — that reopen IS + // the escape hatch for a player who does want the charts. + const isEspionageAlert = !usingHistory + && storyPages.some((p) => p.desc.kind === 'espionage' || p.desc.kind === 'espionageResult'); + const rankingPages = isEspionageAlert ? [] : Gnn.RANKING_METRICS.map((metric) => ({ kind: 'ranking', metric })); + // Always-accessible otherwise: present every time GNN opens, independent + // of whether there's a pending story — same footing as the ranking pages. + const relationsPage = isEspionageAlert ? null : { kind: 'relations' }; + const pages = [...storyPages, ...rankingPages, ...(relationsPage ? [relationsPage] : [])]; const root = scene.add.container(0, 0).setDepth(D.gnn); root.add(scene.add.rectangle(0, 0, GAME_WIDTH, GAME_HEIGHT, 0x030509, 0.99)