Shows checker regions on a map so users see where the platform checkers (and their own) stand when picking regions for a monitor. The map uses the self-hosted ZB-Server Maps (https://maps.zb-server.de, MapLibre GL, light and dark style).
Locations: migration 00058 adds optional latitude/longitude to regions (both or neither, range checked). POST …/regions accepts them. PATCH /api/v1/org/regions/:id (own regions) and PATCH /api/v1/admin/regions/:id (platform regions only) set them, and nulls remove them. Both are audited and documented in the OpenAPI spec.
Regions page / admin panel: a map of all located regions plus a "Location" column. "Set" opens a small form per manageable region, and a click on the map (or typing) fills the coordinates. The create form takes coordinates the same way.
Monitor form: a map above the region checkboxes when any region has a location. Clicking a marker ticks or unticks the region; the checkbox stays the source of truth. Filled = selected, grey = no live checker.
Public region list:GET /api/v1/public/regions answers without authentication and with CORS *, for the front page: {"regions":[{"key","name","latitude","longitude","online"}]}. It lists platform regions only (never org regions or ids), and each instance caches the answer for 30 s (Cache-Control: public, max-age=60).
Mobile: on touch screens one finger scrolls the page and two move the map (cooperative gestures, translated hints). Pins are larger, a tap leaves no sticky highlight, and the regions table hides key and owner on phones.
MapLibre (about 800 KB) loads only on pages with a map. If the map server is unreachable the map stays hidden and the list works as before.
Test plan
TestRegionLocations: create with location, PATCH set and remove, validation, another org or a platform region → 404, non-admin → 403, admin may only change platform regions, markers rendered in the monitor form and on the regions page
TestScripts/regionmap.html (headless Chromium, MapLibre stub): markers, fit, marker ↔ checkbox, map click fills the right form, remove sends nulls
TestRegionLocations/public_list: anonymous, CORS, platform regions only, no ids
Mobile at 360/390/768 px with touch: tapping pins and checkboxes stays in sync, no horizontal scroll, two-finger hint shown
TestScripts/regionmap_offline.html: the map stays hidden when MapLibre cannot load
Dev stack on :8080 with real tiles: set a location via the admin map, select regions via markers, light and dark, 375 px without horizontal scroll
## Summary
Shows checker regions on a map so users see where the platform checkers (and their own) stand when picking regions for a monitor. The map uses the self-hosted ZB-Server Maps (`https://maps.zb-server.de`, MapLibre GL, light and dark style).
- **Locations:** migration `00058` adds optional `latitude`/`longitude` to `regions` (both or neither, range checked). `POST …/regions` accepts them. `PATCH /api/v1/org/regions/:id` (own regions) and `PATCH /api/v1/admin/regions/:id` (platform regions only) set them, and nulls remove them. Both are audited and documented in the OpenAPI spec.
- **Regions page / admin panel:** a map of all located regions plus a "Location" column. "Set" opens a small form per manageable region, and a click on the map (or typing) fills the coordinates. The create form takes coordinates the same way.
- **Monitor form:** a map above the region checkboxes when any region has a location. Clicking a marker ticks or unticks the region; the checkbox stays the source of truth. Filled = selected, grey = no live checker.
- **Public region list:** `GET /api/v1/public/regions` answers without authentication and with CORS `*`, for the front page: `{"regions":[{"key","name","latitude","longitude","online"}]}`. It lists platform regions only (never org regions or ids), and each instance caches the answer for 30 s (`Cache-Control: public, max-age=60`).
- **Mobile:** on touch screens one finger scrolls the page and two move the map (cooperative gestures, translated hints). Pins are larger, a tap leaves no sticky highlight, and the regions table hides key and owner on phones.
- MapLibre (about 800 KB) loads only on pages with a map. If the map server is unreachable the map stays hidden and the list works as before.
## Test plan
- [x] `TestRegionLocations`: create with location, PATCH set and remove, validation, another org or a platform region → 404, non-admin → 403, admin may only change platform regions, markers rendered in the monitor form and on the regions page
- [x] `TestScripts/regionmap.html` (headless Chromium, MapLibre stub): markers, fit, marker ↔ checkbox, map click fills the right form, remove sends nulls
- [x] `TestRegionLocations/public_list`: anonymous, CORS, platform regions only, no ids
- [x] Mobile at 360/390/768 px with touch: tapping pins and checkboxes stays in sync, no horizontal scroll, two-finger hint shown
- [x] `TestScripts/regionmap_offline.html`: the map stays hidden when MapLibre cannot load
- [x] Dev stack on :8080 with real tiles: set a location via the admin map, select regions via markers, light and dark, 375 px without horizontal scroll
- [x] `go test ./...`, golangci-lint 0 issues
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Regions get an optional location. Platform admins set it for platform
regions and org admins for their own, by clicking the map on the regions
page or entering the coordinates; PATCH /org/regions/:id and
/admin/regions/:id set or remove it.
The monitor form shows the located regions on a map from the
self-hosted ZB-Server Maps: a click on a marker ticks or unticks the
region, and the checkbox list stays the source of truth. MapLibre loads
only on pages with a map, and the map stays hidden if the map server
cannot be reached.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Pins carry the region's name, turn dark when the region is selected and
show a green dot while a checker of the region is live. Hovering a pin
highlights its row in the list and the other way round, and a region
ticked in the list pans into view. Scrolling the page no longer zooms
the map, and the attribution stays compact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
GET /api/v1/public/regions lists the platform regions with their
location and whether a checker is online, without authentication and to
any origin, for the website's front page. Each instance answers from
memory for 30 seconds; organizations' own regions are never listed.
On touch screens one finger scrolls the page and two move the map, the
pins are larger, and a tap no longer leaves rows highlighted. The
gesture hints are translated, and the regions table drops the key and
owner columns on phones so the location fits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
merged commit 918c71f283 into main2026-11-28 19:50:36 +00:00
Sebi
deleted branch feat/region-map2026-11-28 19:50:40 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Shows checker regions on a map so users see where the platform checkers (and their own) stand when picking regions for a monitor. The map uses the self-hosted ZB-Server Maps (
https://maps.zb-server.de, MapLibre GL, light and dark style).00058adds optionallatitude/longitudetoregions(both or neither, range checked).POST …/regionsaccepts them.PATCH /api/v1/org/regions/:id(own regions) andPATCH /api/v1/admin/regions/:id(platform regions only) set them, and nulls remove them. Both are audited and documented in the OpenAPI spec.GET /api/v1/public/regionsanswers without authentication and with CORS*, for the front page:{"regions":[{"key","name","latitude","longitude","online"}]}. It lists platform regions only (never org regions or ids), and each instance caches the answer for 30 s (Cache-Control: public, max-age=60).Test plan
TestRegionLocations: create with location, PATCH set and remove, validation, another org or a platform region → 404, non-admin → 403, admin may only change platform regions, markers rendered in the monitor form and on the regions pageTestScripts/regionmap.html(headless Chromium, MapLibre stub): markers, fit, marker ↔ checkbox, map click fills the right form, remove sends nullsTestRegionLocations/public_list: anonymous, CORS, platform regions only, no idsTestScripts/regionmap_offline.html: the map stays hidden when MapLibre cannot loadgo test ./..., golangci-lint 0 issues🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3