Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
…route asset schemas Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
…d modes Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Add a Schema subset for GET /v2/vehiclepositions and toVehicles() to map Golemio's vehicle-position features to the contract's VehiclePosition shape, dropping canceled runs. Add fetchVehicles to GolemioClient, mirroring fetchBoards (token header, 10s timeout, 429/non-2xx handling). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Sibling fetchBoards had test coverage exercising URL/query params and 429/401 error mapping through the mocked HttpClient; fetchVehicles had none. Mirror the same fixtures and idioms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Extract a pure planTick cadence helper (packages/worker/src/do/cadence.ts) and rework the session DO's poll loop to drive both departures (15s) and vehicles (5s) from it, storing subscribed routes and the next boards-due timestamp. The message handler gains SubscribeVehicles/UnsubscribeVehicles, broadcasting VehiclesUpdate filtered to the subscribed route set. Each fetch keeps its own mid-flight-change frame-drop guard and broad catch so one failing fetch can't suppress the other or freeze the alarm cadence. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
…cker Extend useDepartures with a second vehicleRoutes param, applying VehiclesUpdate frames into vehicles/vehiclesAt and subscribing/ unsubscribing over the socket with the same encoded-frame dedupe as the board selectors. Add loadMapKinds/saveMapKinds (default: all kinds but metro) and mapKindsStore/toggleMapKind for the map's kind filters, plus closestEntry (nearest StopIndexEntry by haversine) and lerp/lerpAngle (shortest-arc bearing interpolation) for the map view. Also fixes StopIndexEntry/StopPlatform test fixtures for the v2 routes/lat/lon fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
…open The board subscription's ws.onopen handler always sends Subscribe or Unsubscribe explicitly, since the session DO outlives individual sockets and silence would leave a stale subscription polling server-side. The vehicles frame added in the prior commit only sent SubscribeVehicles when vehicleRoutes was non-empty, never UnsubscribeVehicles when empty — so a tab that left the map view and reconnected (same session id, same DO with persisted vehicleRoutes) would leave a stale vehicles subscription polling every 5s. Make it symmetric with the board subscription. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
DeparturesUpdate and VehiclesUpdate each overwrote the shared status/reason from their own message, so a healthy message on one stream could flip a degraded other stream back to "live". Track boardsDegraded/vehiclesDegraded separately and derive status/reason from both. Also extract a pure decodeMapKinds codec from loadMapKinds so round-trip and unknown-value filtering can be unit tested under vitest's node environment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
…ess gate Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ
|
🚀 Preview deployed: https://preview-31.tablo.run |
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.
Map view with live vehicles (prototype)
A new
/mapview showing vehicles moving along their lines around the closest stop to the user.What it does
Architecture
VehiclePositionwire schema,SubscribeVehicles/VehiclesUpdateprotocol messages, stop index bumped to v2 (platform coords + per-node routes) deploying atomically with the bundle.routes-*.jsonand per-routeshapes/*.jsonassets (Douglas–Peucker simplified). Verified: 8490 stops, 837 routes.VehicleGateway(4.5s cache, single-flight, rate-limit cooldown, never-fails-stale) alongside the departure gateway on one shared Golemio client + rate limiter; DO cadence split into a pure, fully-testedplanTick.map-*.jschunk (278 KB gz) separate from the 300 KB entry. Presentation kept behind statelesslayers.tshelpers for a later design pass.Prototype notes (accepted gaps)
Per the agreed prototype framing (UI + architecture), the following are intentionally deferred:
/data/routes-*.jsonand/data/shapes/*.json— map assets are network-only for now.Verification
bun run typecheck✅bun run lint✅bun run test✅ (130/130)bun run build✅Spec:
docs/superpowers/specs/2026-07-20-map-view-design.mdPlan:
docs/superpowers/plans/2026-07-20-map-view.md🤖 Generated with Claude Code
https://claude.ai/code/session_01BGdH46ajdt2QkihjSHUdmZ