Files
worldmonitor/server
Elie Habib ec949ba8c7 feat(intel): add country facts section and right-click context menu (#1400)
* feat(intel): add country facts section and right-click context menu

Add a Country Facts section (expanded view only) showing head of state,
population, capital, languages, currencies, area, and Wikipedia summary
with thumbnail. Data sourced from RestCountries API and Wikidata/Wikipedia
with 24h server-side caching via cachedFetchJson.

Add right-click context menu on both DeckGL and Globe maps with "Open
Country Brief" and "Copy Coordinates" actions. Menu dismisses on click
outside or Escape, clamped to viewport bounds.

* fix(intel): address review findings for country facts and context menu

- Show noFacts state on RPC failure instead of leaving panel on "Loading..."
- Extract contextmenu handler to named bound method in DeckGLMap and
  GlobeMap so it can be removed in destroy(), preventing listener leaks
  on map mode switches
- Constrain Wikidata SPARQL to current head of state by filtering out
  statements with an end date qualifier (pq:P582)

* fix(intel): scope Wikidata title to country's head-of-state office

Use pq:P1039 (position held) qualifier on the P35 statement instead of
querying the person's arbitrary offices via wdt:P39. This ensures the
title returned (e.g. "President") is the one associated with the
head-of-state role for the specific country, not an unrelated position.

* fix(i18n): translate country facts and context menu keys for all locales

* fix(intel): use correct Wikidata qualifier P39 for head-of-state office title

P1039 (subject has role) is never set on P35 statements. P39 (position
held) is the actual qualifier used, returning values like "president"
for US and "President of the French Republic" for FR.
2026-03-11 08:24:54 +04:00
..