Skip to content

Make Veo dockless rentals user-friendly#92

Merged
kwiens merged 2 commits into
mainfrom
feat/veo-rental-ux
Jun 21, 2026
Merged

Make Veo dockless rentals user-friendly#92
kwiens merged 2 commits into
mainfrom
feat/veo-rental-ux

Conversation

@kwiens

@kwiens kwiens commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Problem

Bend uses Veo, a dockless (free-bike) GBFS provider — unlike Chattanooga's station-based feed, it returns one record per physical vehicle (~208). The station-shaped UI rendered all 208 as serial-numbered sidebar cards (Veo 1014956) with identical noise badges (Shared Vehicle / Use Veo app / When available), and the vehicle_types + system_pricing_plans feeds we'd already wired into the Bend config were never fetched.

Changes

Enrich each vehicle (src/data/gbfs.ts)

  • Fetch the optional vehicle_types + system_pricing_plans feeds (in parallel, degrade gracefully on failure) and resolve real values per vehicle:
    • type → "E-bike" (form-factor × propulsion)
    • price → "$1 to unlock + $0.39/min" (was a hardcoded "Use Veo app")
    • the rental_uris deep link (previously parsed only for a serial, then discarded)

Enrich the map popup (MapMarkers.tsx) — adds the remaining range and a "Rent in Veo app →" button. Station popups (Chattanooga) are unchanged.

Collapse the sidebar (BikeRentalList.tsx) — for free-bike providers the 208 cards become one fleet summary card (count, type breakdown, shared price); clicking it fits the map to the fleet bounds. Station providers keep the per-station list.

Review

Built under /code-review max (recall-focused). 14 findings surfaced and fixed before this PR, including:

  • Security: the feed-derived rental URL went into an href with only HTML-escaping — now restricted to http(s) so a javascript: link can't execute.
  • Pricing edge cases: int-aware currency formatting ($1.50, not $1.5), lowest-start paid tier (skips a free intro tier), billing interval, single-shared-price-or-none (no misleading "dominant" price for mixed fleets).
  • vehicleTypeLabel electric check by explicit set (no longer mislabels combustion/hybrid).
  • Summary-card navigation fits real fleet bounds (guarded against non-finite coords) instead of flying to an arbitrary centroid point.
  • Reuse of METERS_PER_MILE/formatDistance; cached Intl.NumberFormat; memoized summary.

Out of scope (by design)

Map-marker clustering (the 208 pins) was explicitly deferred — this PR only collapses the sidebar + enriches data.

Testing

pnpm test:run361 passing (+11 new for the GBFS enrichment), pnpm lint + tsc clean.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bikemap Ready Ready Preview Jun 21, 2026 7:00pm

Request Review

The Bend Veo feed returns one record per physical vehicle (~208), which the
station-shaped UI rendered as 208 serial-numbered sidebar cards with identical
noise badges, while the vehicle_types and system_pricing_plans feeds we'd
configured went unused.

- Resolve each vehicle's real type ("E-bike") and price ("$1 to unlock +
  $0.39/min") from the vehicle_types + system_pricing_plans feeds; surface the
  remaining range and a "Rent in <provider> app" deep link in the popup.
- Collapse the per-vehicle sidebar list into one fleet summary card for
  free-bike providers (count, type breakdown, shared price); clicking it fits
  the map to the fleet bounds. Station providers (Chattanooga) are unchanged.
- Enrichment feeds are optional and degrade gracefully; the rental deep link is
  restricted to http(s) so it's safe in an href. Reuses METERS_PER_MILE /
  formatDistance from utils/format.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Resolve map.css conflict: keep the new .rental-link styles; drop the
.osm-trail-* block, which main refactored away (PR #87) and which the
merged osm-trails popup no longer references.
@kwiens
kwiens merged commit 097479e into main Jun 21, 2026
3 checks passed
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