[codex] Add Chattanooga and Bend city config#90
Merged
Conversation
Attach the OpenStreetMap US trails vector tileset at runtime (mirroring the MTB tileset pattern) and expose it as a 'Nationwide trails' toggle in the MTB tab. Filters the OSM 'trail' layer to bike-relevant ways (bicycle permitted, mtb:scale present, or cycleway) and colors lines by mtb:scale difficulty with a white casing. Hidden by default; toggles independently via the layer-toggle event. Attribution and zoom bounds come from the TileJSON automatically.
Render the trail_poi source-layer as a single symbol layer (minzoom 12) using built-in Maki sprite icons: trailhead parking (amenity=parking) and information points (tourism=information). Shares the 'Nationwide trails' toggle via setOsmTrailsVisible. No custom sprite/spreet step needed.
Merge origin/main (OSS hygiene phases 1–2) into the branch and add trail interactivity plus PR review fixes: - Clickable trails: a transparent wide hit layer (OSM_TRAILS_HIT_LAYER_ID) makes the thin lines tappable; clicking opens a popup built from the feature's OSM tags (name, type, difficulty, surface, bike access) with a "View on OpenStreetMap" link. OSM values are HTML-escaped (user-generated content). - Filter fix (review): the mtb:scale / cycleway branch now excludes ways that deny bikes (bicycle=no/private) or restrict access (access=no/private); explicit bicycle=yes/designated/permissive still wins. - Early-toggle fix (review): remember desired visibility in a ref and replay it after the layers attach, so toggling before style load isn't lost. - Fix missing OSM_TRAILS_HIT_LAYER_ID export that broke the production build. Tests: 343 pass (added popup-builder + filter-exclusion + hit-layer coverage).
Restyle the click popup: a colored difficulty badge (easy/intermediate/ advanced/expert from mtb:scale, raw scale no longer shown), the trail type as a subtitle, and aligned surface/bikes/operator rows above the OpenStreetMap link. Split the popup builder into osmTrailType/osmTrailDifficulty/osmTrailDetailRows and add osm-trail-* styles in map.css.
Correctness:
- Curated trails win over OSM popups: OSM hit layer now inserts beneath the
curated MTB layers (beforeId) and both click handlers bail on
e.defaultPrevented, so a click in both datasets no longer fires twice.
- Lazy Mapbox token in add_trail_elevation.py: resolved on first tile fetch, not
at import, so validate_trails.py can import the decoder helpers without a token.
- Difficulty badge and line color now derive from one shared MTB_SCALE_RATING map
(covers +/- scale refinements), so e.g. mtb:scale=4+ is Expert in both.
- Escape/encode the OSM "View on OpenStreetMap" href (defense-in-depth).
- Compute-then-dispatch the osmTrails toggle so React StrictMode's double-invoked
setState updater can't double-fire the layer-toggle event.
Cleanup:
- OSM line layers gated to minzoom 9 (nationwide geometry was rendering from z8).
- Reuse the shared escapeXml; drop the duplicate escapeHtml.
- Extract MapLayersSection + ToggleRow; both tabs' "Map Layers" rows reuse them.
- Collapse the three near-identical line addLayer blocks into a base spec + loop;
POI icon / trail color are now typed expression consts.
- OsmTrailProps is an interface; titleCase is Unicode-aware (\p{L}).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kwiens
marked this pull request as ready for review
June 21, 2026 16:04
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…-config # Conflicts: # src/components/Map.tsx # src/components/MapMarkers.tsx # src/components/sidebar/BikeRentalList.tsx # src/data/gbfs.ts # src/utils/map.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds stored city configuration for Chattanooga and Bend without forking the app. The active city is selected with
NEXT_PUBLIC_CITY_ID, defaulting to Chattanooga, so future forks can still specialize behavior by swapping or overriding config.Changes
src/data/cities/*modules for shared city data, Chattanooga data, and Bend starter data.chattanoogaandbendcity records.Review Fixes
src/data/geo_data.tsresolves in a clean checkout.Verification
pnpm test:runpassed.pnpm lintpassed with existing Biome warnings only.pnpm devserved/with the Chattanooga manifest.NEXT_PUBLIC_CITY_ID=bend pnpm devserved/, rendered Bend content on/about, and returned the Bend manifest.