MediaWiki talk:Common.js
Discussion page of MediaWiki:Common.js
More actions
Talk
Discussion for: MediaWiki:Common.js • View • Links • Related changes
Use this page for verification notes, disputes, and action items. Keep narrative content on the article.
Purpose
Coordination + change tracking for MediaWiki:Common.js (site-wide JavaScript). Keep implementation on the JS page. Use this page for tasks, regression notes, and decisions.
Current Libraries
* Leaflet 1.9.4
- Leaflet.markercluster 1.4.1
- Turf.js 6
Known issues / watchlist
* Fullscreen expand button — not yet functional
- Hulls require 3+ accessions per Growing Area to display
- Region labels removed (were overlapping with sparse data)
Open tasks
* [ ] Fix fullscreen map overlay
- [ ] Side panel navigation (click area → filtered accession list)
- [ ] Add a small "Discuss" link/button to key infoboxes (later)
Changelog
2026-01-14
- Talk page auto-preload
- Change: Added automatic preload for new talk pages based on subject page category
- Reason: Consistent talk page structure without manual setup
- Result: Creating Talk:India auto-loads Country template; Talk:Koch Bihar auto-loads Growing Area template, etc.
- Dependencies: Requires Template:Talk preload/* subpages to exist
2026-01-13
- Marker clustering
- Change: Added Leaflet.markercluster with worst-status bubble-up
- Reason: Overlapping pins at zoomed-out view
- Result: Clusters show count + color of worst status inside
- Hull boundaries
- Change: Added Turf.js auto-generated convex/concave hulls for Growing Areas
- Reason: Visual indication of area coverage without manual GeoJSON
- Result: Dashed polygons appear at zoom 6-12, colored by worst status
- Hull buffer
- Change: Added 3km buffer around all hulls
- Reason: Linear accession distributions created thin/weird shapes
- Result: Capsule-shaped boundaries that look like proper areas
- Labels removed
- Change: Removed permanent region/area labels, kept hover tooltips only
- Reason: Visual clutter with sparse/clustered data
- Result: Cleaner map, area info on hover/click
- Satellite layer
- Change: Added Esri World Imagery as third base layer option
- Reason: Useful for seeing actual terrain/cultivation areas
- Result: 3-button toggle (basic/terrain/satellite)
2026-01-12
- CSV URL encoding fix
- Change: Added encoding for dashes (-2D) and colons (-3A) in buildCSVUrl()
- Reason: Accession IDs with dashes/colons broke SMW CSV export URLs
- Result: Maps display pins correctly
Decisions
- Auto-generated hulls vs manual GeoJSON (2026-01-13)
- Chose auto-generated — updates automatically as accessions added, dashed style communicates "approximate"
- Interaction-only labels (2026-01-13)
- Removed permanent labels — too cluttered with sparse data, hover tooltips sufficient
- 3km hull buffer (2026-01-13)
- Prevents linear point distributions from creating thin unusable polygons