In this section
- GlobalGrid2050 Fix V6 V7 GIS Single-Line Diagram (SLD) Print Simple Safe electrical · globalgrid2050 / scripts/fix_v6_v7_gis_sld_print_simple_safe.py lines 1–214
- GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Mwp Sizing Visibility electrical · globalgrid2050 / scripts/fix_v7_gis_sld_mobile_mwp_sizing_visibility.py lines 1–149
- GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tool Overlay Spacing electrical · globalgrid2050 / scripts/fix_v7_gis_sld_mobile_tool_overlay_spacing.py lines 1–94
- GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tools Energy Layer Clearance electrical · globalgrid2050 / scripts/fix_v7_gis_sld_mobile_tools_energy_layer_clearance.py lines 1–151
GlobalGrid2050 Fix V6 V7 GIS Single-Line Diagram (SLD) Print Simple Safe
A Python command-line tool in the scripts folder that reads substations, overhead lines (OHL), 66kV and 132kV.
electricalglobalgrid2050 / scripts/fix_v6_v7_gis_sld_print_simple_safe.py · lines 1–214 of 214 · Entry point · pattern patch_folder (shared by 3 files)
- What it does
- It loads substations, overhead lines (OHL), 66kV and 132kV. Defines read, write, patch_folder, main. Uses libraries __future__, datetime, pathlib. Side effects: changes the web page (DOM); reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'sld'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: substations, overhead lines (OHL), 66kV, 132kV, 400kV, 275kV.
- Inputs & outputs
- Voltage levels named: 400kV, 275kV, 132kV, 66kV.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Fix V6 V7 GIS Single-Line Diagram (SLD) Print Simple Safe Workflow (globalgrid2050).
- What it achieves
- It patches folder (`patch_folder`) and is built from the read step (`read`) and the write step (`write`). Fix V6 and V7 GIS SLD printing by removing the hanging print preparation routine.
- Why it matters
- Run by GlobalGrid2050 Fix V6 V7 GIS Single-Line Diagram (SLD) Print Simple Safe Workflow.
- Application
- globalgrid2050 · scripts · Python CLI
- Uses
- __future__, datetime, pathlib
- Used by
- run by GlobalGrid2050 Fix V6 V7 GIS Single-Line Diagram (SLD) Print Simple Safe Workflow (workflow run)
- Produces
- read, write, patch_folder, main
- Defines here
- read, write, patch_folder, main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/fix_v6_v7_gis_sld_print_simple_safe.py:1-214 · blob 84edea474345eaf80774439d7b798ff2dacb6f39 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
"""
Fix V6 and V7 GIS SLD printing by removing the hanging print preparation routine.
Purpose:
- Restore print button to immediate window.print().
- Keep clean default map layers.
- Set public substations default OFF in state.
- Disable the previous JS print map pack without deleting history.
- Add simple CSS so the existing map prints as a large non truncated report figure.
"""
from __future__ import annotations
import datetime as dt
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
REPORTS = ROOT / "gridbot_reports"
REPORT = REPORTS / "fix_v6_v7_gis_sld_print_simple_safe.md"
TARGETS = [
ROOT / "solar-bess-topology-v6" / "gis-sld-financial-sandbox",
ROOT / "solar-bess-topology-v7" / "gis-sld-financial-sandbox",
]
PREP_EVENT = '$("btn_print_report")?.addEventListener("click", prepareGisSldPrintReport);'
SIMPLE_EVENT = '$("btn_print_report")?.addEventListener("click", () => window.print());'
PACK_AUTORUN = "setTimeout(enforceCleanDefaultMapLayers, 1200);"
PACK_AUTORUN_DISABLED = "// setTimeout(enforceCleanDefaultMapLayers, 1200); // disabled by simple safe print fix"
CSS_MARKER = "/* GLOBALGRID2050 SIMPLE SAFE PRINT MAP FIX */"
CSS_PATCH = r'''
/* GLOBALGRID2050 SIMPLE SAFE PRINT MAP FIX */
@media print {
/* The report prints first. The live map prints as one large page figure after report content. */
.panel-right {
display: block !important;
position: static !important;
width: 100% !important;
height: auto !important;
min-height: 0 !important;
overflow: visible !important;
page-break-before: always !important;
break-before: page !important;
page-break-inside: avoid !important;
break-inside: avoid !important;
padding: 0 !important;
margin: 0 !important;
border: 0 !important;
background: #ffffff !important;
}
.panel-right::before {
content: "Map Figure: Current GIS SLD View";
display: block !important;
font-size: 12pt !important;
font-weight: 700 !important;
color: #111111 !important;
border-bottom: 1px solid #999999 !important;
padding: 0 0 3mm 0 !important;
margin: 0 0 4mm 0 !important;
}
#map {
display: block !important;
position: relative !important;
width: 100% !important;
height: 230mm !important;
min-height: 230mm !important;
max-height: 230mm !important;
overflow: hidden !important;
border: 1px solid #999999 !important;
background: #ffffff !important;
page-break-inside: avoid !important;
break-inside: avoid !important;
}
.map-controls,
.map-tool-overlay,
.crosshair,
#fetch_status,
.maplibregl-control-container,
.maplibregl-ctrl,
.maplibregl-ctrl-group,
.legend {
display: none !important;
}
.print-map-pack,
.print-map-page,
.print-map-page-landscape {
display: none !important;
}
}
'''
def read(path: Path) -> str:
return path.read_text(encoding="utf-8")
def write(path: Path, text: str) -> None:
path.write_text(text, encoding="utf-8")
def patch_folder(folder: Path) -> list[str]:
actions: list[str] = []
state_js = folder / "gis-sld-v5-state.js"
map_js = folder / "gis-sld-v5-map.js"
ui_js = folder / "gis-sld-v5-ui.js"
css = folder / "gis-sld-v5.css"
for path in [state_js, map_js, ui_js, css]:
if not path.exists():
raise SystemExit(f"Missing file: {path.relative_to(ROOT)}")
state_text = read(state_js)
if "subsVisible: true" in state_text:
state_text = state_text.replace("subsVisible: true", "subsVisible: false", 1)
write(state_js, state_text)
actions.append(f"set public substations default OFF in {state_js.relative_to(ROOT)}")
else:
actions.append(f"public substations already default OFF in {state_js.relative_to(ROOT)}")
map_text = read(map_js)
replacements = {
'"66kv": true': '"66kv": false',
'"132kv": true': '"132kv": false',
'"275kv": true': '"275kv": false',
'"400kv": true': '"400kv": false',
}
changed_map = False
for old, new in replacements.items():
if old in map_text:
map_text = map_text.replace(old, new)
changed_map = True
if changed_map:
write(map_js, map_text)
actions.append(f"confirmed Atlas overhead lines default OFF in {map_js.relative_to(ROOT)}")
else:
actions.append(f"Atlas overhead lines already default OFF in {map_js.relative_to(ROOT)}")
ui_text = read(ui_js)
if PREP_EVENT in ui_text:
ui_text = ui_text.replace(PREP_EVENT, SIMPLE_EVENT, 1)
actions.append(f"restored simple print event in {ui_js.relative_to(ROOT)}")
elif SIMPLE_EVENT in ui_text:
actions.append(f"simple print event already present in {ui_js.relative_to(ROOT)}")
else:
raise SystemExit(f"No recognised print event found in {ui_js.relative_to(ROOT)}")
if PACK_AUTORUN in ui_text:
ui_text = ui_text.replace(PACK_AUTORUN, PACK_AUTORUN_DISABLED, 1)
actions.append(f"disabled print pack autorun in {ui_js.relative_to(ROOT)}")
write(ui_js, ui_text)
css_text = read(css)
if CSS_MARKER not in css_text:
css_text = css_text.rstrip() + CSS_PATCH + "\n"
write(css, css_text)
actions.append(f"added simple safe print CSS in {css.relative_to(ROOT)}")
else:
actions.append(f"simple safe print CSS already present in {css.relative_to(ROOT)}")
return actions
def main() -> int:
actions: list[str] = []
for folder in TARGETS:
actions.extend(patch_folder(folder))
REPORTS.mkdir(parents=True, exist_ok=True)
timestamp = dt.datetime.now(dt.timezone.utc).isoformat()
report = "\n".join([
"# Fix V6 V7 GIS SLD Print Simple Safe",
"",
f"UTC created: {timestamp}",
"",
"## Purpose",
"",
"Fix print getting stuck on PREPARING by removing the asynchronous print preparation routine and restoring immediate browser print.",
"",
"## Changes",
"",
"- Print button calls `window.print()` directly again.",
"- Public substations default OFF.",
"- Atlas overhead line layers default OFF.",
"- Previous print map pack output is hidden in print.",
"- Live map prints as one large A4 portrait figure after the report.",
"",
"## Actions",
"",
*[f"- {a}" for a in actions],
"",
"## Manual acceptance test",
"",
"1. Open V6 or V7 GIS SLD.",
"2. Confirm SUBS default OFF and overhead line buttons default OFF.",
"3. Press PRINT.",
"4. Confirm browser print opens immediately.",
"5. Confirm map prints as a large figure and is not stuck on PREPARING.",
"",
])
write(REPORT, report)
print(f"Simple safe print fix complete. Report: {REPORT.relative_to(ROOT)}")
return 0
if __name__ == "__main__":
raise SystemExit(main())GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Mwp Sizing Visibility
A Python command-line tool in the scripts folder.
electricalglobalgrid2050 / scripts/fix_v7_gis_sld_mobile_mwp_sizing_visibility.py · lines 1–149 of 149 · Entry point
- What it does
- It loads data. Defines main. Uses libraries __future__, datetime, pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'sld'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Mwp Sizing Visibility Workflow (globalgrid2050).
- What it achieves
- Fix V7 GIS SLD mobile MWp DC sizing control visibility.
- Why it matters
- Run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Mwp Sizing Visibility Workflow.
- Application
- globalgrid2050 · scripts · Python CLI
- Uses
- __future__, datetime, pathlib
- Used by
- run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Mwp Sizing Visibility Workflow (workflow run)
- Produces
- main
- Defines here
- main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/fix_v7_gis_sld_mobile_mwp_sizing_visibility.py:1-149 · blob b9840bc268f27dfa11c229086eeea673d02a5ccb · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
"""
Fix V7 GIS SLD mobile MWp DC sizing control visibility.
Issue:
- The MWp DC input and SIZE MWp button exist in the map tools overlay.
- On mobile they can be hidden, squeezed or pushed out of the visible area by the tools row.
Fix:
- Make the MWp sizing row a full-width dedicated row on mobile.
- Keep the input and SIZE MWp button visible when tools are ON.
- Keep it hidden when tools are OFF, preserving declutter behaviour.
"""
from __future__ import annotations
import datetime as dt
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CSS = ROOT / "solar-bess-topology-v7" / "gis-sld-financial-sandbox" / "gis-sld-v5.css"
REPORTS = ROOT / "gridbot_reports"
REPORT = REPORTS / "fix_v7_gis_sld_mobile_mwp_sizing_visibility.md"
MARKER = "/* GLOBALGRID2050 V7 MOBILE MWp SIZING VISIBILITY FIX */"
PATCH = r'''
/* GLOBALGRID2050 V7 MOBILE MWp SIZING VISIBILITY FIX */
@media (max-width: 900px) {
.map-tool-overlay {
align-items: stretch !important;
}
.map-tool-overlay > .map-toggle-row {
width: 100% !important;
justify-content: center !important;
align-items: center !important;
}
.map-size-row {
display: flex !important;
width: 100% !important;
justify-content: center !important;
align-items: center !important;
gap: 8px !important;
margin-top: 4px !important;
padding: 0 4px !important;
}
.map-size-input {
display: inline-block !important;
visibility: visible !important;
width: 96px !important;
min-width: 96px !important;
max-width: 96px !important;
height: 36px !important;
font-size: 13px !important;
text-align: center !important;
}
#btn_map_apply_size {
display: inline-flex !important;
visibility: visible !important;
align-items: center !important;
justify-content: center !important;
min-width: 94px !important;
height: 36px !important;
color: #ffffff !important;
}
.map-size-status {
display: block !important;
flex-basis: 100% !important;
text-align: center !important;
padding: 2px 0 0 0 !important;
font-size: 10px !important;
}
.map-tool-overlay.tools-collapsed .map-size-row,
.map-tool-overlay.tools-collapsed .map-size-input,
.map-tool-overlay.tools-collapsed #btn_map_apply_size,
.map-tool-overlay.tools-collapsed .map-size-status {
display: none !important;
}
}
@media (max-width: 520px) {
.map-size-row {
flex-wrap: wrap !important;
}
.map-size-input {
width: 104px !important;
min-width: 104px !important;
max-width: 104px !important;
}
#btn_map_apply_size {
min-width: 110px !important;
}
}
'''
def main() -> int:
if not CSS.exists():
raise SystemExit(f"Missing CSS file: {CSS.relative_to(ROOT)}")
text = CSS.read_text(encoding="utf-8")
actions = []
if MARKER not in text:
text = text.rstrip() + PATCH + "\n"
CSS.write_text(text, encoding="utf-8")
actions.append("added mobile MWp sizing visibility override")
else:
actions.append("mobile MWp sizing visibility fix already present")
REPORTS.mkdir(parents=True, exist_ok=True)
REPORT.write_text("\n".join([
"# Fix V7 GIS SLD Mobile MWp Sizing Visibility",
"",
f"UTC created: {dt.datetime.now(dt.timezone.utc).isoformat()}",
"",
"## Purpose",
"",
"Make the MWp DC input and SIZE MWp button visible on mobile by giving the sizing control its own full-width tools row.",
"",
"## Actions",
"",
*[f"- {a}" for a in actions],
"",
"## Manual acceptance test",
"",
"1. Open V7 GIS SLD on mobile.",
"2. Toggle TOOLS ON.",
"3. Confirm MWp DC input and SIZE MWp button are visible below the first tools row.",
"4. Enter 20 or 200 and press SIZE MWp.",
"5. Confirm the array resizes by whole block steps.",
"6. Toggle TOOLS OFF and confirm the sizing controls hide with the rest of the tools.",
"",
]), encoding="utf-8")
print("V7 mobile MWp sizing visibility fix complete.")
return 0
if __name__ == "__main__":
raise SystemExit(main())GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tool Overlay Spacing
A Python command-line tool in the scripts folder that reads solar, battery storage (BESS) and wind.
electricalglobalgrid2050 / scripts/fix_v7_gis_sld_mobile_tool_overlay_spacing.py · lines 1–94 of 94 · Entry point
- What it does
- It loads solar, battery storage (BESS) and wind. Defines main. Uses libraries __future__, datetime, pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'sld'): 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), wind.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tool Overlay Spacing Workflow (globalgrid2050).
- What it achieves
- Lower the V7 GIS SLD mobile map tools overlay so it no longer overlaps solar, wind, BESS and voltage layer toggles.
- Why it matters
- Run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tool Overlay Spacing Workflow.
- Application
- globalgrid2050 · scripts · Python CLI
- Uses
- __future__, datetime, pathlib
- Used by
- run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tool Overlay Spacing Workflow (workflow run)
- Produces
- main
- Defines here
- main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/fix_v7_gis_sld_mobile_tool_overlay_spacing.py:1-94 · blob e7b2324f8f6975d5ff22e8a4e6e2b9f2e9bafc3b · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
"""
Lower the V7 GIS SLD mobile map tools overlay so it no longer overlaps
solar, wind, BESS and voltage layer toggles.
"""
from __future__ import annotations
import datetime as dt
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CSS = ROOT / "solar-bess-topology-v7" / "gis-sld-financial-sandbox" / "gis-sld-v5.css"
REPORTS = ROOT / "gridbot_reports"
REPORT = REPORTS / "fix_v7_gis_sld_mobile_tool_overlay_spacing.md"
MARKER = "/* GLOBALGRID2050 V7 MOBILE TOOL OVERLAY SPACING FIX */"
PATCH = r'''
/* GLOBALGRID2050 V7 MOBILE TOOL OVERLAY SPACING FIX */
@media (max-width: 900px) {
.map-tool-overlay {
top: 210px !important;
left: 10px;
right: 10px;
max-width: none;
}
.panel-right.map-expanded .map-tool-overlay,
body.map-expanded .map-tool-overlay {
top: 210px !important;
}
}
@media (max-width: 520px) {
.map-tool-overlay {
top: 225px !important;
}
.panel-right.map-expanded .map-tool-overlay,
body.map-expanded .map-tool-overlay {
top: 225px !important;
}
.map-tool-overlay.tools-collapsed {
top: 255px !important;
}
}
'''
def main() -> int:
if not CSS.exists():
raise SystemExit(f"Missing CSS file: {CSS.relative_to(ROOT)}")
text = CSS.read_text(encoding="utf-8")
actions = []
if MARKER not in text:
text = text.rstrip() + PATCH + "\n"
CSS.write_text(text, encoding="utf-8")
actions.append("added mobile overlay spacing override")
else:
actions.append("mobile overlay spacing override already present")
REPORTS.mkdir(parents=True, exist_ok=True)
REPORT.write_text("\n".join([
"# Fix V7 GIS SLD Mobile Tool Overlay Spacing",
"",
f"UTC created: {dt.datetime.now(dt.timezone.utc).isoformat()}",
"",
"## Purpose",
"",
"Move the map tools overlay lower on mobile so the solar, wind, BESS and voltage toggles remain visible and usable.",
"",
"## Actions",
"",
*[f"- {a}" for a in actions],
"",
"## Manual acceptance test",
"",
"1. Open V7 GIS SLD on mobile.",
"2. Confirm the voltage toggles and operating asset toggles remain visible.",
"3. Confirm the tools row sits lower and no longer blocks the solar, wind or BESS toggles.",
"4. Toggle TOOLS OFF and ON and confirm layout remains usable.",
"",
]), encoding="utf-8")
print("V7 mobile tool overlay spacing fix complete.")
return 0
if __name__ == "__main__":
raise SystemExit(main())GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tools Energy Layer Clearance
A Python command-line tool in the scripts folder that reads wind, solar and battery storage (BESS).
electricalglobalgrid2050 / scripts/fix_v7_gis_sld_mobile_tools_energy_layer_clearance.py · lines 1–151 of 151 · Entry point
- What it does
- It loads wind, solar and battery storage (BESS). Defines main. Uses libraries __future__, datetime, pathlib. Side effects: reads or writes files.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'sld'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: wind, solar, battery storage (BESS).
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tools Energy Layer Clearance Workflow (globalgrid2050).
- What it achieves
- On mobile, TOOLS ON/OFF and MWp sizing controls overlap the operating asset row. - This blocks SOLAR OP, ONSHORE WIND, OFFSHORE WIND and BESS OP toggles.
- Why it matters
- Run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tools Energy Layer Clearance Workflow.
- Application
- globalgrid2050 · scripts · Python CLI
- Uses
- __future__, datetime, pathlib
- Used by
- run by GlobalGrid2050 Fix V7 GIS Single-Line Diagram (SLD) Mobile Tools Energy Layer Clearance Workflow (workflow run)
- Produces
- main
- Defines here
- main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 scripts/fix_v7_gis_sld_mobile_tools_energy_layer_clearance.py:1-151 · blob da482eb13a46cbbf73035b21a6c545d7c32c0cf5 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env python3
"""
Fix V7 GIS SLD mobile tools overlay clearance.
Issue:
- On mobile, TOOLS ON/OFF and MWp sizing controls overlap the operating asset row.
- This blocks SOLAR OP, ONSHORE WIND, OFFSHORE WIND and BESS OP toggles.
Fix:
- Push map tool overlay below the voltage and operating asset control rows.
- Apply the same lower position for both TOOLS ON and TOOLS OFF states.
- Keep MWp sizing inside the tools group and hidden when collapsed.
- Preserve clickable access to operating asset toggles.
"""
from __future__ import annotations
import datetime as dt
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CSS = ROOT / "solar-bess-topology-v7" / "gis-sld-financial-sandbox" / "gis-sld-v5.css"
REPORTS = ROOT / "gridbot_reports"
REPORT = REPORTS / "fix_v7_gis_sld_mobile_tools_energy_layer_clearance.md"
MARKER = "/* GLOBALGRID2050 V7 MOBILE TOOLS ENERGY LAYER CLEARANCE FIX */"
PATCH = r'''
/* GLOBALGRID2050 V7 MOBILE TOOLS ENERGY LAYER CLEARANCE FIX */
@media (max-width: 900px) {
.map-controls {
z-index: 30 !important;
}
.asset-toggle-row,
.voltage-toggle-row {
position: relative !important;
z-index: 35 !important;
pointer-events: auto !important;
}
.asset-toggle-row .map-toggle-btn,
.voltage-toggle-row .map-toggle-btn {
pointer-events: auto !important;
}
.map-tool-overlay,
.map-tool-overlay.tools-collapsed,
.panel-right.map-expanded .map-tool-overlay,
.panel-right.map-expanded .map-tool-overlay.tools-collapsed,
body.map-expanded .map-tool-overlay,
body.map-expanded .map-tool-overlay.tools-collapsed {
top: 265px !important;
left: 10px !important;
right: 10px !important;
z-index: 24 !important;
max-width: none !important;
align-items: stretch !important;
pointer-events: none !important;
}
.map-tool-overlay .map-toggle-btn,
.map-tool-overlay input,
.map-tool-overlay span {
pointer-events: auto !important;
}
.map-tool-overlay > .map-toggle-row {
justify-content: center !important;
}
.map-tool-overlay.tools-collapsed {
width: auto !important;
}
.map-tool-overlay.tools-collapsed #btn_map_tools_toggle {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
}
.map-tool-overlay.tools-collapsed .map-size-row,
.map-tool-overlay.tools-collapsed .map-tool-row-secondary,
.map-tool-overlay.tools-collapsed button:not(#btn_map_tools_toggle) {
display: none !important;
}
}
@media (max-width: 520px) {
.map-tool-overlay,
.map-tool-overlay.tools-collapsed,
.panel-right.map-expanded .map-tool-overlay,
.panel-right.map-expanded .map-tool-overlay.tools-collapsed,
body.map-expanded .map-tool-overlay,
body.map-expanded .map-tool-overlay.tools-collapsed {
top: 285px !important;
}
.map-tool-overlay > .map-toggle-row:first-child {
display: flex !important;
flex-wrap: wrap !important;
justify-content: center !important;
}
}
'''
def main() -> int:
if not CSS.exists():
raise SystemExit(f"Missing CSS file: {CSS.relative_to(ROOT)}")
text = CSS.read_text(encoding="utf-8")
actions = []
if MARKER not in text:
text = text.rstrip() + PATCH + "\n"
CSS.write_text(text, encoding="utf-8")
actions.append("added mobile tools clearance override so energy layer buttons remain clickable")
else:
actions.append("mobile tools clearance override already present")
REPORTS.mkdir(parents=True, exist_ok=True)
REPORT.write_text("\n".join([
"# Fix V7 GIS SLD Mobile Tools Energy Layer Clearance",
"",
f"UTC created: {dt.datetime.now(dt.timezone.utc).isoformat()}",
"",
"## Purpose",
"",
"Move the mobile tools overlay lower in both TOOLS ON and TOOLS OFF states so operating asset toggles can be selected.",
"",
"## Actions",
"",
*[f"- {a}" for a in actions],
"",
"## Manual acceptance test",
"",
"1. Open V7 GIS SLD on mobile.",
"2. Confirm SOLAR OP, ONSHORE WIND, OFFSHORE WIND and BESS OP are visible and clickable.",
"3. Toggle TOOLS OFF and confirm the collapsed tools button does not cover energy layer buttons.",
"4. Toggle TOOLS ON and confirm the expanded tools group sits lower.",
"5. Confirm MWp sizing input still appears with TOOLS ON and hides with TOOLS OFF.",
"",
]), encoding="utf-8")
print("V7 mobile tools energy layer clearance fix complete.")
return 0
if __name__ == "__main__":
raise SystemExit(main())