GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Solar and storage design / globalgrid2050 / solar-bess-topology-v7/module-layout

Manifest and 7 more files

A configuration file in the upgrades folder of GlobalGrid2050 covering solar, battery storage (BESS), 400kV and 66kV.

666 lines of YAML and HTML from globalgrid2050, in 8 files. Topic: Solar and storage design. Section 106 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page render · globalgrid2050 / solar-bess-topology-v7/module-layout/index.html lines 1–91
  2. Manifest test · globalgrid2050 / solar-bess-topology-v7/upgrades/000_validation_test/manifest.yml lines 1–11
  3. Manifest test · globalgrid2050 / solar-bess-topology-v7/upgrades/001_gis_sld_validation_test/manifest.yml lines 1–11
  4. Manifest docs-config · globalgrid2050 / solar-bess-topology-v7/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml lines 1–66
  5. Manifest docs-config · globalgrid2050 / solar-bess-topology-v7/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml lines 1–143
  6. Manifest docs-config · globalgrid2050 / solar-bess-topology-v7/upgrades/004_gis_sld_atlas_v8_voltage_buttons/manifest.yml lines 1–153
  7. Manifest docs-config · globalgrid2050 / solar-bess-topology-v7/upgrades/004b_gis_sld_atlas_v8_voltage_buttons_safe/manifest.yml lines 1–82
  8. Manifest docs-config · globalgrid2050 / solar-bess-topology-v7/upgrades/004c_gis_sld_atlas_v8_voltage_buttons_no_map_patch/manifest.yml lines 1–109

Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page

A web page in GlobalGrid2050 that reads inputs for ml total modules, ml module width and ml module height, covering cables. Published at https://globalgrid2050.com/solar-bess-topology-v7/module-layout/.

Set aside from the main view: 99% of its lines are the same as testcode/202609051958/layer-apps/solar-bess-topology-v7/module-layout/index.html (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 98% of lines shared with Solar Battery Energy Storage System (BESS) Topology V7 — Module Layout Page; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 0.9859 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/202609051958/layer-apps/solar-bess-topology-v7/module-layout/index.html:1-92 5cbd99c77d980a6035bd193ac9ad0f7a348f2d17
  • sha256 e7efd4e87539565a7402e285595049077d8a0aa19106979ac92abd796afae1aa
  • target sha256 4895b5e3f0be24f9773857411c10049f9030b85cf4d15f1dc8a0ee79b4c5ee88
  • group of 4 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

renderglobalgrid2050 / solar-bess-topology-v7/module-layout/index.html · lines 1–91 of 91 · Entry point

What it does
It draws cables. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: cables.
Inputs & outputs
In: form fields (user input). Out: web page.
Downstream impact
Used directly by 2 files: Solar Battery Energy Storage System (BESS) Topology V7 — DC AC LV Topology Review Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/dc-ac-lv-topology-review/); GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V7 Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/). Reached from 138 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Demonstration Videos (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html). It is itself an entry point, published at https://globalgrid2050.com/solar-bess-topology-v7/module-layout/.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Loaded by the DC AC LV Topology Review page at https://globalgrid2050.com/solar-bess-topology-v7/dc-ac-lv-topology-review/ and 1 other page.
Application
globalgrid2050 · solar-bess-topology-v7/module-layout · page
Uses
GIS Single-Line Diagram (SLD) V4 (stylesheet), Module Layout V5 (stylesheet), Solar Battery Energy Storage System (BESS) Topology V7 — DC AC LV Topology Review Page (link), Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (link), Solar Battery Energy Storage System (BESS) Topology V7 — GIS Single-Line Diagram (SLD) Financial Sandbox Page (link), GIS Single-Line Diagram (SLD) V5 Config (script src), GIS Single-Line Diagram (SLD) V5 Helpers (script src), Module Layout V3 (script src), https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.js, https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.css, https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js
Used by
linked from Solar Battery Energy Storage System (BESS) Topology V7 — DC AC LV Topology Review Page (link), linked from GlobalGrid2050 — Solar Battery Energy Storage System (BESS) Topology V7 Page (link)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/module-layout/index.html:1-91 · blob bd99a1a50fcb41a08c48d79748630969962dcf81 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>Module Layout V7 | GlobalGrid2050</title>

    <script src="https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.js"></script>
    <link href="https://unpkg.com/maplibre-gl@3.3.1/dist/maplibre-gl.css" rel="stylesheet" />
    <script src="https://cdn.jsdelivr.net/npm/@turf/turf@6/turf.min.js"></script>

    <link rel="stylesheet" href="./gis-sld-v5.css" />
    <link rel="stylesheet" href="./module-layout-v5.css" />
</head>
<body>
    <div class="module-app-shell">
        <header class="module-header">
            <div>
                <div class="module-kicker">GlobalGrid2050 V7</div>
                <h1>Physical Solar Module Layout</h1>
                <p>Separate non breaking app for testing physical module footprint, portrait or landscape orientation and exact module count visualisation.</p>
            </div>
            <div class="topo-header-links">
<button id="ml_print_report" class="module-link print-btn" type="button" onclick="window.print()">Print</button><a class="module-link" href="../dc-ac-lv-topology-review/index.html">DC AC LV Topology Review</a><a class="module-link" href="../cable-geometry-visualiser/index.html">Cable Geometry Visualiser V7</a><a class="module-link" href="../gis-sld-financial-sandbox/index.html">Back to GIS SLD V7<  … [line shortened here: 409 characters; full line on GitHub]
        </header>

        <main class="module-main">
            <section class="module-panel">
                <h2>Module Inputs</h2>

                <label>Total Modules</label>
                <input id="ml_total_modules" type="number" value="1200" min="1" step="1" />

                <label>Module Width m</label>
                <input id="ml_module_width_m" type="number" value="1.134" min="0.1" step="0.001" />

                <label>Module Height m</label>
                <input id="ml_module_height_m" type="number" value="2.278" min="0.1" step="0.001" />

                <label>Orientation</label>
                <select id="ml_orientation">
                    <option value="portrait">Portrait</option>
                    <option value="landscape">Landscape</option>
                </select>

                <label>Modules Per Row</label>
                <input id="ml_modules_per_row" type="number" value="60" min="1" step="1" />

                <label>Row Pitch m</label>
                <input id="ml_row_pitch_m" type="number" value="6.0" min="0.1" step="0.1" />

                <label>Module Gap m</label>
                <input id="ml_module_gap_m" type="number" value="0.03" min="0" step="0.01" />

                <label>Array Rotation degrees</label>
                <input id="ml_rotation_deg" type="number" value="0" step="5" />

                <div class="module-button-row">
                    <button id="ml_draw_center" class="btn">Draw at Map Centre</button>
                    <button id="ml_pick_site" class="btn secondary">Pick Site on Map</button>
                    <button id="ml_clear" class="btn danger">Clear</button>
                </div>

                <h2>Results</h2>
                <div class="module-stat"><span>Rows</span><strong id="ml_out_rows">0</strong></div>
                <div class="module-stat"><span>Layout Width</span><strong id="ml_out_width">0 m</strong></div>
                <div class="module-stat"><span>Layout Length</span><strong id="ml_out_length">0 m</strong></div>
                <div class="module-stat"><span>Footprint Area</span><strong id="ml_out_area">0 ha</strong></div>
                <div class="module-stat"><span>Rendered Modules</span><strong id="ml_out_rendered">0</strong></div>
                <div id="ml_status" class="module-status">Ready.</div>

                <div class="module-note">
                    This app is for physical GIS visualisation only. It does not replace paid EPC design, cable schedules, structural layout, shading study or IFC drawings.
                </div>
            </section>

            <section class="module-map-card">
                <div id="module_map"></div>
                <div class="module-map-toolbar">
                    <button id="ml_satellite" class="btn small">Satellite View</button>
                    <button id="ml_zoom_layout" class="btn small secondary">Zoom to Layout</button>
                </div>
            </section>
        </main>
    </div>

    <script src="./gis-sld-v5-config.js"></script>
    <script src="./gis-sld-v5-helpers.js"></script>
    <script src="./module-layout-v5.js"></script>
</body>
</html>

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that tests solar and battery storage (BESS).

testglobalgrid2050 / solar-bess-topology-v7/upgrades/000_validation_test/manifest.yml · lines 1–11 of 11 · Not reached from any entry point (candidate for review)

What it does
It tests solar and battery storage (BESS).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS).
What it achieves
Validation only manifest for the V7 Complex Upgrade Install workflow.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/000_validation_test · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/000_validation_test/manifest.yml:1-11 · blob d9121c34ad6885de912f8aa11bcd641796f6a2d8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 000_validation_test
target_app: docs
description: Validation only manifest for the V7 Complex Upgrade Install workflow.
allowed_paths:
  - solar-bess-topology-v7/docs
operations: []
checks:
  - manifest_read
  - target_app_validated
  - allowed_paths_validated
  - report_written

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that tests solar and battery storage (BESS).

testglobalgrid2050 / solar-bess-topology-v7/upgrades/001_gis_sld_validation_test/manifest.yml · lines 1–11 of 11 · Not reached from any entry point (candidate for review)

What it does
It tests solar and battery storage (BESS).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS).
What it achieves
Validation only manifest for the V7 GIS single-line diagram (SLD) Financial Sandbox.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/001_gis_sld_validation_test · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/001_gis_sld_validation_test/manifest.yml:1-11 · blob 6d3936ed11fba024be434aa6e7358c1428dd0f9f · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 001_gis_sld_validation_test
target_app: gis-sld-financial-sandbox
description: Validation only manifest for the V7 GIS SLD Financial Sandbox.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox
operations: []
checks:
  - manifest_read
  - target_app_validated
  - allowed_paths_validated
  - report_written

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that maps atlas grid 132kV line, atlas grid 400kV line, l sat and solar.

docs-configglobalgrid2050 / solar-bess-topology-v7/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml · lines 1–66 of 66 · Not reached from any entry point (candidate for review)

What it does
It maps atlas grid 132kV line, atlas grid 400kV line, l sat and solar.
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, 400kV, 132kV.
Inputs & outputs
Voltage levels named: 400kV, 132kV.
What it achieves
Add Atlas V8 132kV and 400kV grid line visibility to the V7 GIS single-line diagram (SLD) Financial Sandbox map.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/002_gis_sld_atlas_v8_132_400kv_layers · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/002_gis_sld_atlas_v8_132_400kv_layers/manifest.yml:1-66 · blob 5588f49211b0080e0a89708cc7f83cbed27becfa · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 002_gis_sld_atlas_v8_132_400kv_layers
target_app: gis-sld-financial-sandbox
description: Add Atlas V8 132 kV and 400 kV grid line visibility to the V7 GIS SLD Financial Sandbox map.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
operations:
  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    marker: '    map.addLayer({ id: "l-sat", type: "raster", source: "sat-s", layout: { visibility: "none" } });'
    insert: |

      // Atlas V8 transmission visibility layers
      // These layers are read from the existing Atlas V8 data folder.
      // They are visual context only and do not imply confirmed grid headroom.
      map.addSource("atlas-v8-grid-132kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_132kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-132kv-line",
          type: "line",
          source: "atlas-v8-grid-132kv",
          layout: { visibility: "visible" },
          paint: {
              "line-color": "#ffcc00",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.0, 10, 1.8, 14, 3.0],
              "line-opacity": 0.72
          }
      });

      map.addSource("atlas-v8-grid-400kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_400kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-400kv-line",
          type: "line",
          source: "atlas-v8-grid-400kv",
          layout: { visibility: "visible" },
          paint: {
              "line-color": "#ff3333",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.6, 10, 2.8, 14, 4.2],
              "line-opacity": 0.82
          }
      });
  - type: replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    find: '        <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>'
    replace: |
      <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>
              <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 2px solid #ffcc00;"></div> Atlas V8 132 kV Lines</div>
              <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 3px solid #ff3333;"></div> Atlas V8 400 kV Lines</div>
checks:
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-132kv-line'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-400kv-line'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 132 kV Lines'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 400 kV Lines'

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 that maps atlas grid 66kV line, atlas grid 132kV line, atlas grid 275kV line and atlas grid 400kV line.

docs-configglobalgrid2050 / solar-bess-topology-v7/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml · lines 1–143 of 143 · Not reached from any entry point (candidate for review)

What it does
It maps atlas grid 66kV line, atlas grid 132kV line, atlas grid 275kV line and atlas grid 400kV line.
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: 400kV, 275kV, 132kV, 66kV.
Inputs & outputs
Voltage levels named: 400kV, 275kV, 132kV, 66kV.
What it achieves
Add Atlas V8 66kV and 275kV grid line layers and allow Atlas voltage layers to be toggled from the V7 GIS single-line diagram (SLD) map legend.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/003_gis_sld_atlas_v8_voltage_layer_toggles/manifest.yml:1-143 · blob e5f8aa5175108df14affed08999fdb4ec90cf101 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 003_gis_sld_atlas_v8_voltage_layer_toggles
target_app: gis-sld-financial-sandbox
description: Add Atlas V8 66 kV and 275 kV grid line layers and allow Atlas voltage layers to be toggled from the V7 GIS SLD map legend.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
operations:
  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    marker: 'let map = null;'
    insert: |

      const atlasV8GridLayerVisibility = {
          "66kv": true,
          "132kv": true,
          "275kv": true,
          "400kv": true
      };

      const atlasV8GridLayerIds = {
          "66kv": "atlas-v8-grid-66kv-line",
          "132kv": "atlas-v8-grid-132kv-line",
          "275kv": "atlas-v8-grid-275kv-line",
          "400kv": "atlas-v8-grid-400kv-line"
      };

      function toggleAtlasV8GridLayer(voltageKey) {
          if (!atlasV8GridLayerIds[voltageKey]) return;
          atlasV8GridLayerVisibility[voltageKey] = !atlasV8GridLayerVisibility[voltageKey];
          const layerId = atlasV8GridLayerIds[voltageKey];
          if (map && map.getLayer(layerId)) {
              map.setLayoutProperty(layerId, "visibility", atlasV8GridLayerVisibility[voltageKey] ? "visible" : "none");
          }
          updateLegend();
      }
  - type: regex_replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    flags: s
    pattern: '// Atlas V8 transmission visibility layers.*?map\.addLayer\(\{\n    id: "atlas-v8-grid-400kv-line",\n    type: "line",\n    source: "atlas-v8-grid-400kv",\n    layout: \{ visibility: "visible" \},\n    paint: \{\n        "line-color": "#ff3333",\n        "line-width": \["interpolate", \["linear"\], \["zoom"\], 5, 1\.6, 10, 2\.8, 14, 4\.2\],\n        "line-opacity": 0\.82\n    \}\n\}\  … [line shortened here: 403 characters; full line on GitHub]
    replace: |
      // Atlas V8 transmission visibility layers
      // These layers are read from the existing Atlas V8 data folder.
      // They are visual context only and do not imply confirmed grid headroom.
      map.addSource("atlas-v8-grid-66kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_66kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-66kv-line",
          type: "line",
          source: "atlas-v8-grid-66kv",
          layout: { visibility: atlasV8GridLayerVisibility["66kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#66ff66",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 0.8, 10, 1.4, 14, 2.4],
              "line-opacity": 0.62
          }
      });

      map.addSource("atlas-v8-grid-132kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_132kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-132kv-line",
          type: "line",
          source: "atlas-v8-grid-132kv",
          layout: { visibility: atlasV8GridLayerVisibility["132kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ffcc00",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.0, 10, 1.8, 14, 3.0],
              "line-opacity": 0.72
          }
      });

      map.addSource("atlas-v8-grid-275kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_275kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-275kv-line",
          type: "line",
          source: "atlas-v8-grid-275kv",
          layout: { visibility: atlasV8GridLayerVisibility["275kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ff66ff",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.3, 10, 2.4, 14, 3.7],
              "line-opacity": 0.76
          }
      });

      map.addSource("atlas-v8-grid-400kv", {
          type: "geojson",
          data: "../../repd_grid_atlasv8/data/grid_400kv.geojson"
      });
      map.addLayer({
          id: "atlas-v8-grid-400kv-line",
          type: "line",
          source: "atlas-v8-grid-400kv",
          layout: { visibility: atlasV8GridLayerVisibility["400kv"] ? "visible" : "none" },
          paint: {
              "line-color": "#ff3333",
              "line-width": ["interpolate", ["linear"], ["zoom"], 5, 1.6, 10, 2.8, 14, 4.2],
              "line-opacity": 0.82
          }
      });
  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    marker: 'function updateLegend() {'
    insert: |
      function atlasV8LegendItem(voltageKey, label, colour, widthPx) {
          const visible = atlasV8GridLayerVisibility?.[voltageKey] !== false;
          const opacity = visible ? "1" : "0.35";
          const suffix = visible ? "" : " OFF";
          return `<div class="legend-item" onclick="toggleAtlasV8GridLayer('${voltageKey}')" style="cursor:pointer; opacity:${opacity};" title="Tap to toggle ${label}"><div class="swatch" style="background:transparent; border-bottom: ${widthPx}px solid ${colour};"></div> ${label}${suffix}</div>`;
      }

  - type: regex_replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    flags: s
    pattern: '<div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>\n        <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom: 2px solid #ffcc00;"></div> Atlas V8 132 kV Lines</div>\n        <div class="legend-item"><div class="swatch" style="background:transparent; border-bottom  … [line shortened here: 457 characters; full line on GitHub]
    replace: |
      <div class="legend-item"><div class="swatch" style="background:#ffffff; border-color:#ff3333;"></div> Atlas Substation Dataset</div>
              ${atlasV8LegendItem("66kv", "Atlas V8 66 kV Lines", "#66ff66", 2)}
              ${atlasV8LegendItem("132kv", "Atlas V8 132 kV Lines", "#ffcc00", 2)}
              ${atlasV8LegendItem("275kv", "Atlas V8 275 kV Lines", "#ff66ff", 3)}
              ${atlasV8LegendItem("400kv", "Atlas V8 400 kV Lines", "#ff3333", 3)}
checks:
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-66kv-line'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'atlas-v8-grid-275kv-line'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'toggleAtlasV8GridLayer'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'atlasV8LegendItem'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui-core.js
    text: 'Atlas V8 275 kV Lines'

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 covering solar, battery storage (BESS), 400kV and 66kV.

docs-configglobalgrid2050 / solar-bess-topology-v7/upgrades/004_gis_sld_atlas_v8_voltage_buttons/manifest.yml · lines 1–153 of 153 · Not reached from any entry point (candidate for review)

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS), 400kV, 66kV, 275kV, 132kV.
Inputs & outputs
Voltage levels named: 400kV, 275kV, 132kV, 66kV.
What it achieves
Replace legend based Atlas V8 voltage toggles with real map buttons using the same interaction pattern as SUBS and SATELLITE VIEW.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/004_gis_sld_atlas_v8_voltage_buttons · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/004_gis_sld_atlas_v8_voltage_buttons/manifest.yml:1-153 · blob e5e1eaca0fcbe898694c9b92c462fc831bf4e830 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 004_gis_sld_atlas_v8_voltage_buttons
target_app: gis-sld-financial-sandbox
description: Replace legend based Atlas V8 voltage toggles with real map buttons using the same interaction pattern as SUBS and SATELLITE VIEW.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
operations:
  - type: replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    find: |
      <div style="position: absolute; top: 10px; right: 10px; z-index: 20; display: flex; gap: 8px;">
              <button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>
              <button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>
          </div>
    replace: |
      <div class="map-controls">
              <div class="map-toggle-row">
                  <button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>
                  <button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>
              </div>
              <div class="map-toggle-row voltage-toggle-row">
                  <button id="btn_atlas_66kv" class="map-toggle-btn active atlas-voltage-btn atlas-66kv" data-atlas-voltage="66kv">66 kV ON</button>
                  <button id="btn_atlas_132kv" class="map-toggle-btn active atlas-voltage-btn atlas-132kv" data-atlas-voltage="132kv">132 kV ON</button>
                  <button id="btn_atlas_275kv" class="map-toggle-btn active atlas-voltage-btn atlas-275kv" data-atlas-voltage="275kv">275 kV ON</button>
                  <button id="btn_atlas_400kv" class="map-toggle-btn active atlas-voltage-btn atlas-400kv" data-atlas-voltage="400kv">400 kV ON</button>
              </div>
          </div>
  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
    marker: '/* Map Elements */'
    insert: |
      .map-controls {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 20;
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
      }

      .map-toggle-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .voltage-toggle-row .map-toggle-btn {
        font-size: 10px;
        padding: 5px 8px;
      }

      .atlas-voltage-btn:not(.active) {
        color: #777;
        border-color: #333;
        opacity: 0.65;
      }

      .atlas-66kv.active { border-color: #66ff66; color: #66ff66; }
      .atlas-132kv.active { border-color: #ffcc00; color: #ffcc00; }
      .atlas-275kv.active { border-color: #ff66ff; color: #ff66ff; }
      .atlas-400kv.active { border-color: #ff3333; color: #ff3333; }

  - type: replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    find: |
      function toggleAtlasV8GridLayer(voltageKey) {
          if (!atlasV8GridLayerIds[voltageKey]) return;
          atlasV8GridLayerVisibility[voltageKey] = !atlasV8GridLayerVisibility[voltageKey];
          const layerId = atlasV8GridLayerIds[voltageKey];
          if (map && map.getLayer(layerId)) {
              map.setLayoutProperty(layerId, "visibility", atlasV8GridLayerVisibility[voltageKey] ? "visible" : "none");
          }
          updateLegend();
      }
    replace: |
      function toggleAtlasV8GridLayer(voltageKey) {
          if (!atlasV8GridLayerIds[voltageKey]) return;
          atlasV8GridLayerVisibility[voltageKey] = !atlasV8GridLayerVisibility[voltageKey];
          const layerId = atlasV8GridLayerIds[voltageKey];
          if (map && map.getLayer(layerId)) {
              map.setLayoutProperty(layerId, "visibility", atlasV8GridLayerVisibility[voltageKey] ? "visible" : "none");
          }
          updateLegend();
          if (typeof updateAtlasV8GridToggleButtons === "function") updateAtlasV8GridToggleButtons();
      }
  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: |
      function toggleSubs() {
          if (!map || !map.getLayer("l-subs")) return;
          state.subsVisible = !state.subsVisible;
          map.setLayoutProperty("l-subs", "visibility", state.subsVisible ? "visible" : "none");
          const btn = $("btn_subs_toggle");
          if (btn) {
              btn.textContent = state.subsVisible ? "SUBS ON" : "SUBS OFF";
              btn.classList.toggle("active", state.subsVisible);
          }
      }
    insert: |

      function updateAtlasV8GridToggleButtons() {
          const labels = {
              "66kv": "66 kV",
              "132kv": "132 kV",
              "275kv": "275 kV",
              "400kv": "400 kV"
          };
          Object.keys(labels).forEach(voltageKey => {
              const btn = $(`btn_atlas_${voltageKey}`);
              if (!btn) return;
              const visible = atlasV8GridLayerVisibility?.[voltageKey] !== false;
              btn.textContent = `${labels[voltageKey]} ${visible ? "ON" : "OFF"}`;
              btn.classList.toggle("active", visible);
          });
      }

      function wireAtlasV8GridToggleButtons() {
          document.querySelectorAll(".atlas-voltage-btn").forEach(btn => {
              btn.addEventListener("click", () => {
                  const voltageKey = btn.dataset.atlasVoltage;
                  toggleAtlasV8GridLayer(voltageKey);
              });
          });
          updateAtlasV8GridToggleButtons();
      }
  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: |
          $("btn_basemap")?.addEventListener("click", toggleBasemap);
          $("btn_subs_toggle")?.addEventListener("click", toggleSubs);
    insert: |
          wireAtlasV8GridToggleButtons();
checks:
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    text: 'btn_atlas_66kv'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    text: 'data-atlas-voltage="400kv"'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    text: 'wireAtlasV8GridToggleButtons'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'updateAtlasV8GridToggleButtons'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
    text: '.map-controls'

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 covering solar, battery storage (BESS), 66kV and 132kV.

docs-configglobalgrid2050 / solar-bess-topology-v7/upgrades/004b_gis_sld_atlas_v8_voltage_buttons_safe/manifest.yml · lines 1–82 of 82 · Not reached from any entry point (candidate for review)

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS), 66kV, 132kV, 400kV, 275kV.
Inputs & outputs
Voltage levels named: 400kV, 275kV, 132kV, 66kV.
What it achieves
Add real Atlas voltage toggle buttons using the same event listener pattern as existing map buttons.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/004b_gis_sld_atlas_v8_voltage_buttons_safe · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/004b_gis_sld_atlas_v8_voltage_buttons_safe/manifest.yml:1-82 · blob fee860f63315133e3480810af8d47468ff7794ee · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 004b_gis_sld_atlas_v8_voltage_buttons_safe
target_app: gis-sld-financial-sandbox
description: Add real Atlas voltage toggle buttons using the same event listener pattern as existing map buttons.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
operations:
  - type: regex_replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    flags: s
    pattern: '<div style="position: absolute; top: 10px; right: 10px; z-index: 20; display: flex; gap: 8px;">\s*<button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>\s*<button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>\s*</div>'
    replace: |
      <div class="map-controls">
              <div class="map-toggle-row">
                  <button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>
                  <button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>
              </div>
              <div class="map-toggle-row voltage-toggle-row">
                  <button id="btn_atlas_66kv" class="map-toggle-btn active atlas-voltage-btn atlas-66kv" data-atlas-voltage="66kv">66 kV ON</button>
                  <button id="btn_atlas_132kv" class="map-toggle-btn active atlas-voltage-btn atlas-132kv" data-atlas-voltage="132kv">132 kV ON</button>
                  <button id="btn_atlas_275kv" class="map-toggle-btn active atlas-voltage-btn atlas-275kv" data-atlas-voltage="275kv">275 kV ON</button>
                  <button id="btn_atlas_400kv" class="map-toggle-btn active atlas-voltage-btn atlas-400kv" data-atlas-voltage="400kv">400 kV ON</button>
              </div>
          </div>
  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
    marker: '/* Map Elements */'
    insert: |
      .map-controls { position:absolute; top:10px; right:10px; z-index:20; display:flex; flex-direction:column; gap:8px; align-items:flex-end; }
      .map-toggle-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
      .voltage-toggle-row .map-toggle-btn { font-size:10px; padding:5px 8px; }
      .atlas-voltage-btn:not(.active) { color:#777; border-color:#333; opacity:0.65; }
      .atlas-66kv.active { border-color:#66ff66; color:#66ff66; }
      .atlas-132kv.active { border-color:#ffcc00; color:#ffcc00; }
      .atlas-275kv.active { border-color:#ff66ff; color:#ff66ff; }
      .atlas-400kv.active { border-color:#ff3333; color:#ff3333; }

  - type: replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    find: '    updateLegend();\n}'
    replace: '    updateLegend();\n    if (typeof updateAtlasV8GridToggleButtons === "function") updateAtlasV8GridToggleButtons();\n}'
    count: 1
  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: '// ============================================================\n// WIRE EVERYTHING UP'
    insert: |
      function updateAtlasV8GridToggleButtons() {
          const labels = { "66kv": "66 kV", "132kv": "132 kV", "275kv": "275 kV", "400kv": "400 kV" };
          Object.keys(labels).forEach(voltageKey => {
              const btn = $(`btn_atlas_${voltageKey}`);
              if (!btn) return;
              const visible = atlasV8GridLayerVisibility?.[voltageKey] !== false;
              btn.textContent = `${labels[voltageKey]} ${visible ? "ON" : "OFF"}`;
              btn.classList.toggle("active", visible);
          });
      }

      function wireAtlasV8GridToggleButtons() {
          document.querySelectorAll(".atlas-voltage-btn").forEach(btn => {
              btn.addEventListener("click", () => toggleAtlasV8GridLayer(btn.dataset.atlasVoltage));
          });
          updateAtlasV8GridToggleButtons();
      }

  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: '    $("btn_subs_toggle")?.addEventListener("click", toggleSubs);'
    insert: |

          wireAtlasV8GridToggleButtons();
checks:
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    text: 'btn_atlas_66kv'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    text: 'wireAtlasV8GridToggleButtons'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-map.js
    text: 'updateAtlasV8GridToggleButtons'

Manifest

A configuration file in the upgrades folder of GlobalGrid2050 covering solar, battery storage (BESS), 400kV and 66kV.

docs-configglobalgrid2050 / solar-bess-topology-v7/upgrades/004c_gis_sld_atlas_v8_voltage_buttons_no_map_patch/manifest.yml · lines 1–109 of 109 · Not reached from any entry point (candidate for review)

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: solar, battery storage (BESS), 400kV, 66kV, 275kV, 132kV.
Inputs & outputs
Voltage levels named: 400kV, 275kV, 132kV, 66kV.
What it achieves
Add real Atlas voltage toggle buttons without patching the map layer function.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · solar-bess-topology-v7/upgrades/004c_gis_sld_atlas_v8_voltage_buttons_no_map_patch · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 solar-bess-topology-v7/upgrades/004c_gis_sld_atlas_v8_voltage_buttons_no_map_patch/manifest.yml:1-109 · blob ed25b995bff77859be264a38fb328ed2f19344f2 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unreached_review
upgrade_id: 004c_gis_sld_atlas_v8_voltage_buttons_no_map_patch
target_app: gis-sld-financial-sandbox
description: Add real Atlas voltage toggle buttons without patching the map layer function. Uses existing toggleAtlasV8GridLayer logic and updates button states from UI listeners.
allowed_paths:
  - solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
  - solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
operations:
  - type: regex_replace
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    flags: s
    pattern: '<div style="position: absolute; top: 10px; right: 10px; z-index: 20; display: flex; gap: 8px;">\s*<button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>\s*<button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>\s*</div>'
    replace: |
      <div class="map-controls">
              <div class="map-toggle-row">
                  <button id="btn_subs_toggle" class="map-toggle-btn active">SUBS ON</button>
                  <button id="btn_basemap" class="map-toggle-btn">SATELLITE VIEW</button>
              </div>
              <div class="map-toggle-row voltage-toggle-row">
                  <button id="btn_atlas_66kv" class="map-toggle-btn active atlas-voltage-btn atlas-66kv" data-atlas-voltage="66kv">66 kV ON</button>
                  <button id="btn_atlas_132kv" class="map-toggle-btn active atlas-voltage-btn atlas-132kv" data-atlas-voltage="132kv">132 kV ON</button>
                  <button id="btn_atlas_275kv" class="map-toggle-btn active atlas-voltage-btn atlas-275kv" data-atlas-voltage="275kv">275 kV ON</button>
                  <button id="btn_atlas_400kv" class="map-toggle-btn active atlas-voltage-btn atlas-400kv" data-atlas-voltage="400kv">400 kV ON</button>
              </div>
          </div>
  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
    marker: '/* Map Elements */'
    insert: |
      .map-controls {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 20;
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
      }

      .map-toggle-row {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
      }

      .voltage-toggle-row .map-toggle-btn {
        font-size: 10px;
        padding: 5px 8px;
      }

      .atlas-voltage-btn:not(.active) {
        color: #777;
        border-color: #333;
        opacity: 0.65;
      }

      .atlas-66kv.active { border-color: #66ff66; color: #66ff66; }
      .atlas-132kv.active { border-color: #ffcc00; color: #ffcc00; }
      .atlas-275kv.active { border-color: #ff66ff; color: #ff66ff; }
      .atlas-400kv.active { border-color: #ff3333; color: #ff3333; }

  - type: insert_before
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: |
      // ============================================================
      // WIRE EVERYTHING UP
    insert: |
      function updateAtlasV8GridToggleButtons() {
          const labels = { "66kv": "66 kV", "132kv": "132 kV", "275kv": "275 kV", "400kv": "400 kV" };
          Object.keys(labels).forEach(voltageKey => {
              const btn = $(`btn_atlas_${voltageKey}`);
              if (!btn) return;
              const visible = atlasV8GridLayerVisibility?.[voltageKey] !== false;
              btn.textContent = `${labels[voltageKey]} ${visible ? "ON" : "OFF"}`;
              btn.classList.toggle("active", visible);
          });
      }

      function wireAtlasV8GridToggleButtons() {
          document.querySelectorAll(".atlas-voltage-btn").forEach(btn => {
              btn.addEventListener("click", () => {
                  toggleAtlasV8GridLayer(btn.dataset.atlasVoltage);
                  updateAtlasV8GridToggleButtons();
              });
          });
          updateAtlasV8GridToggleButtons();
      }

  - type: insert_after
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    marker: '    $("btn_subs_toggle")?.addEventListener("click", toggleSubs);'
    insert: |
      
          wireAtlasV8GridToggleButtons();
checks:
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    text: 'btn_atlas_66kv'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/index.html
    text: 'data-atlas-voltage="400kv"'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5-ui.js
    text: 'wireAtlasV8GridToggleButtons'
  - type: assert_contains
    file: solar-bess-topology-v7/gis-sld-financial-sandbox/gis-sld-v5.css
    text: '.map-controls'