Skip to content

Map loses province name labels when switching between game tabs #1300

Description

@johnpooch

Goal

Stop the game map from dropping its province name labels when the player switches between the Map, Orders and Chat tabs.

Current behaviour

Switching between tabs — particularly switching quickly — leaves the map rendered with territory fills, supply centre markers, borders and unit icons intact, but with every province name label missing. The labels come back after a while, sometimes within seconds and sometimes only after several minutes or after leaving and re-entering the game. Reported on Discord by two players; one saw it on the classic map and its draft variant, the other reports it on every map they play (Classic, Chaos, Modern Dip II, Youngstown Redux), so it is not variant-specific.

Expected behaviour

Province name labels stay on the map across tab switches, at whatever rate the player switches.

Where

Province names live in the province-names layer of the dSVG (packages/web/src/components/InteractiveMap/dsvgParser.ts:112) and are rendered into the static base layer, which is rasterised once through an <img> blob URL in packages/web/src/components/GameMapCanvas/rasterizeSvg.ts:37, driven from packages/web/src/components/GameMapCanvas/GameMapCanvas.tsx:195. Units and order arrows are on the separate live vector overlay, which matches the reported symptom: the overlay survives, the text in the base raster does not.

One lead worth checking first: the label <text> elements specify font-family: 'Libre Baskerville', a Google Font the app loads via <link> in index.html. An SVG rasterised inside an <img> renders in an isolated document that cannot reach the parent document's fonts or fetch external resources, so whether the text paints depends on font availability at raster time — which would explain both the intermittency and the recovery after a delay.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions