← all branches

feat/atlas-intl

needs attentionviewing older commit
164beb7 · fullpre-PRreviewed 2026-07-22 19:04 UTC2H · 4M · 8L · 12I
The branch
Purpose
Extends the open-source Atlas SEN (Mexico electricity grid map) to show the country's cross-border power interconnections — context missing from the current domestic-only map.
Goal
Add an 'Interconexiones internacionales' toggle layer showing Mexico's 6 border ties with the US, Guatemala, and Belize.
Sub-goals
  • Add international_ties.json GeoJSON with 6 ties + 12 endpoint points
  • Add 4 Mapbox layers (glow / AC / DC / pts) with click popups and toggle wiring
The changes (whole branch)
What
New static GeoJSON data file with 6 international power ties; index.html updated to fetch, render, and toggle the new layer.
Why
The Atlas SEN map lacked international context; showing border interconnections completes the picture of how Mexico's grid connects to WECC, ERCOT, SIEPAC, and Belize.
Areas
apps/web/public/atlas/data/international_ties.json+200apps/web/public/atlas/index.html+144
Blast
2 files, +34/−4. Static public atlas page; no backend, no DB, no auth.
open-source-data-file-xss-vector
CI· No PR openCodeRabbit· No .coderabbit.yaml

Findings · 13

correctness2

low

intl-glow omitted from cursor-handler forEach

apps/web/public/atlas/index.html

Hovering on the glow fringe won't switch cursor to pointer. Add 'intl-glow' to the cursor handler array.

low

p.tie has no null-guard in intl-pts popup

apps/web/public/atlas/index.html

Safe for current data but a future pt feature omitting 'tie' renders 'enlace: undefined'. Add p.tie||''.

security2

high

XSS: GeoJSON string properties interpolated unescaped into innerHTML popup

apps/web/public/atlas/index.html

All properties (n, mx, ext, pais, mw, tech, dir, year, grupo, src, name, tie) go directly into template literals rendered via pop() as innerHTML. A compromised or maliciously-PR'd international_ties.json would inject arbitrary JS. Fix: escapeHtml() on all interpolated values.

medium

Open-source data file is an unguarded XSS vector with no CI lint barrier

apps/web/public/atlas/data/international_ties.json

A PR modifying any string field could ship XSS without touching application code. Add a CI step rejecting angle brackets in GeoJSON string properties.

conventions2

low

intl-glow paint differs slightly from tx-lines-glow baseline

apps/web/public/atlas/index.html

blur:5/opacity:0.22 vs tx-lines-glow blur:4/opacity:0.28. Minor aesthetic divergence.

low

intl source has defensive ternary guard not present in other source registrations

apps/web/public/atlas/index.html

Safe but inconsistent; document as intentional or align with direct-pass pattern.

tests1

low

No CI schema validation for hand-authored GeoJSON data files

apps/web/public/atlas/data/international_ties.json

A lightweight Node script could assert line/point pairing, coordinate bounds, required properties, and nLines count.

improvement5

high

No legend distinguishing AC solid lines from DC/async dashed lines

apps/web/public/atlas/index.html

The sync/async visual split (solid vs dashed) has no explanation in the UI. Users will see dashed lines for Laredo VFT and Railroad/Sharyland with no affordance. Add an 'Internacional: CA / CC' legend entry.

medium

Popup omits null guard for mw and dir properties

apps/web/public/atlas/index.html

p.mw is always interpolated without a guard — if mw:0 or null, renders bare '0'. Add: ${p.mw?p.mw:'capacidad no publicada'}.

medium

Source ID and layer ID both named 'intl' — confusing for maintainers

apps/web/public/atlas/index.html

Mapbox GL JS namespaces don't conflict but readable disambiguation is better. Rename solid-AC layer to 'intl-ac' for symmetry with 'intl-dc'.

medium

Data gaps: possible second Belize circuit; seasonal capacity limits not reflected

apps/web/public/atlas/data/international_ties.json

CFE docs reference two Belize circuits. MX-GT seasonal limits differ from nameplate. Add a 'capacidad nominal' tooltip note.

low

Inline muted color (#8b93a4) repeated — use CSS class

apps/web/public/atlas/index.html

Two popup spans use style='color:#8b93a4' inline. Define a .tag--muted CSS class.

seo1

low

Page title/meta description may not reflect new international scope

apps/web/public/atlas/index.html

If title/description scopes to Mexico-only, the addition of CAISO/ERCOT/Guatemala/Belize cross-border ties warrants an update.

History · 3 commits

  1. c1177dbneeds attentionincremental0H · 0M · 3L2026-07-27 18:30
  2. 164beb7needs attentionfull2H · 4M · 8L2026-07-22 19:04current
  3. 0480e20safefull0H · 1M · 5L2026-07-22 18:49