Skip to content

Unify MAP_POPUP_MAX_WIDTH_PX via codegen from defaults.py#266

Merged
jimchurches merged 1 commit into
beta-nextfrom
265-unify-map-popup-max-width
Jun 1, 2026
Merged

Unify MAP_POPUP_MAX_WIDTH_PX via codegen from defaults.py#266
jimchurches merged 1 commit into
beta-nextfrom
265-unify-map-popup-max-width

Conversation

@jimchurches
Copy link
Copy Markdown
Owner

Summary

MAP_POPUP_MAX_WIDTH_PX was hardcoded in three stacks (Python defaults, React popup sizing, HTML export viewer JS) with manual sync comments. This change generates TS, CSS, and export JS from the single Python constant in defaults.py.

Changes

  • Codegen: scripts/generate_basemap_assets.py now also emits:
    • map_popup_constants.generated.ts (React import)
    • map_popup_constants.generated.css (--pebird-map-popup-max-width)
    • leaflet_map_export_constants.generated.js (export viewer)
  • React: AllLocationsMapPopupSizing.ts imports generated TS; CSS imports generated variable file
  • Export: leaflet_map_html_export.py concatenates generated JS constants with leaflet_map_export.js
  • CI: --check validates all four generated outputs (basemaps + popup constants)

Testing

  • python3 -m ruff check explorer/
  • python3 scripts/generate_basemap_assets.py --check
  • python3 -m pytest tests/ -q — 636 passed, 7 skipped

Notes

To change popup width, edit MAP_POPUP_MAX_WIDTH_PX in explorer/app/streamlit/defaults.py, then run:

python3 scripts/generate_basemap_assets.py

(build_all_locations_map_frontend.py runs this automatically before npm build.)

Issues

Fixes #265

Made with Cursor

…lts.py

Extend generate_basemap_assets.py to emit TS, CSS, and export JS constants
from MAP_POPUP_MAX_WIDTH_PX; HTML export concatenates the generated snippet;
CI --check covers all generated map assets.

Refs: #265
Co-authored-by: Cursor <cursoragent@cursor.com>
@jimchurches jimchurches merged commit 34196af into beta-next Jun 1, 2026
7 checks passed
@jimchurches jimchurches deleted the 265-unify-map-popup-max-width branch June 1, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant