Skip to content

Add Pico Transit: MBTA/RIPTA schedule + realtime tool - #133

Closed
CJFData wants to merge 15 commits into
lightphone:mainfrom
CJFData:pico-transit
Closed

Add Pico Transit: MBTA/RIPTA schedule + realtime tool#133
CJFData wants to merge 15 commits into
lightphone:mainfrom
CJFData:pico-transit

Conversation

@CJFData

@CJFData CJFData commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Adds Pico Transit, a full transit-companion example tool built on the SDK (tool/) for MBTA and RIPTA:

  • Agency/line/route/direction/stop selection flow, plus "Explore Schedules" and "Leave Now" entry points
  • GTFS static ingestion (SQLite-backed) with conditional re-download (HEAD + ETag/Last-Modified) instead of always refetching the full feed
  • Live GTFS-Realtime (TripUpdates + VehiclePositions) for arrivals and a live Map screen
  • Map screen: dark CARTO tiles, density-based zoom-to-fit, mode-specific vehicle emojis, tap-to-reveal nearby stop labels, per-stop live vehicle caps, and an optional "Nearby Vehicles" toggle for secondary stops
  • Station deduplication via GTFS parent_station (shared between Map markers and stop search), resolving to real child stop_ids for schedule lookups
  • A Settings screen for a persisted default agency (skips the agency picker on future launches)
  • LightTopBar back navigation on every screen but Home
  • App display name: "Pico Transit"

Test plan

  • :tool:compileDebugKotlin — builds clean
  • :tool:testDebugUnitTest — 4/4 passing (GTFS station-dedup logic, verified against real MBTA data)
  • :tool:assembleDebug — builds a working debug APK
  • Manually exercised on the emulator: agency selection, Explore Schedules and Leave Now flows, live arrivals, the Map screen (back navigation, zoom-to-fit, station markers, live vehicles), and Settings/default-agency persistence

🤖 Generated with Claude Code

https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h

Christian and others added 8 commits July 30, 2026 06:26
Adds a full transit tool on top of the Light SDK scaffold:

- GTFS static ingestion (SQLite) with agency picker for MBTA/RIPTA
- Explore Schedules: line type -> route -> direction -> stop -> departures
  -> trip detail, with tap-to-connect to other routes at any stop
- Leave Now: geocoded/IP-approximated location search -> nearest stops ->
  live upcoming arrivals (GTFS-RT TripUpdates) with On Time/Late/Early status
- ETA radar screen: live/scheduled bus positions and nearby stops plotted
  by true bearing/distance around the selected stop, with proximity
  clustering to avoid stacked icons
- :netconfig module granting a narrowly-scoped cleartext exception for
  RIPTA's HTTP-only realtime feeds (see its build.gradle.kts for details
  and removal steps)
- Renamed the scaffold's com.thelightphone.sample package to
  com.thelightphone.transit and updated lighttool.toml's id/label
- Added tool/README.md with build/run/sideload instructions

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h
Updated the app name from 'Transit' to 'Pico Transit' in README.
- Map screen: dark CARTO tiles, density-based zoom-to-fit, mode-specific
  vehicle emojis, tap-to-reveal nearby stop labels, per-stop live vehicle
  cap, optional "Nearby Vehicles" toggle for secondary stops, edge-anchored
  compass, solid top scrim, and a custom touch handler so edge-swipe-back
  keeps working alongside marker taps.
- Deduplicate GTFS stations via parent_station (shared by Map markers and
  stop search) instead of a stop_name heuristic, resolving to real child
  stop_id(s) for schedule lookups.
- Add a back button (LightTopBar) to every screen but Home, including a
  Canvas-overlay treatment for the Map screen.
- Add a Settings screen for picking a default agency (DataStore-backed),
  auto-selected on launch, with conditional GTFS re-download via
  HEAD/ETag/Last-Modified so a fresh feed isn't always re-fetched.
- Rename the app display label to "Pico Transit".
- Strip "via ..." clauses from direction labels and label live ETAs
  explicitly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h
…scaffold screen

- Replace the stale "ETA Radar" description with what the Map screen
  actually does now (tap-to-reveal nearby stops, mode-specific vehicle
  emojis, live vehicles at true position, the Nearby Vehicles toggle).
- Document the Settings/default-agency feature, which wasn't mentioned
  anywhere.
- Make the root README consistently say "Pico Transit" instead of
  "Transit" in its body.
- Remove DetailScreen.kt, an unused SDK-scaffold leftover that's never
  instantiated anywhere in the app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h
…ehicle, dark map option

- Choose Stop (Explore Schedules) now sorts by real distance to you, matching
  the distance already shown per row, instead of route/stop_sequence order.
- Connections now also lists the next 3 departures at any stop within 100 feet
  of the current one (route, direction, distance, time), skipping any
  route+direction already offered at the current stop.
- Trip Detail shows a live mode emoji next to whichever stop the trip's
  vehicle is currently at or closest to, polling VehiclePositions every 10s.
  Derives the agency from the db file path (GtfsAgency.forDbFile) rather than
  threading it through every screen between here and where it was selected.
- Map screen switched to CARTO's brighter Voyager tiles by default for street
  legibility, with all text drawn directly on the map (compass, center label,
  bus markers) given the same white-fill/black-outline treatment already used
  for nearby-stop labels, so it stays legible over both styles.
- Added a Settings option to pick Dark Matter over Voyager instead, persisted
  the same way as the default agency. Also switched Settings to LightScrollView
  so a growing settings list doesn't run off the bottom of the screen (found
  while testing this addition).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h
Christian and others added 7 commits July 31, 2026 10:00
LICENSE-TRANSIT already existed (added in the first Transit commit) but was
never linked to from anywhere, so nothing made clear it separately covers
tool/ under its own copyright rather than the root LICENSE. Also add
Christian Ferreira's full name alongside the CJFData handle.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014sF9rJBmDSbG6LQKf2ua2h
Updated the phrasing from 'when's my bus' to 'where's my bus' for clarity.
- Replace emoji markers with SDK LightIcons for stops/vehicles, fix the
  back button being drawn over by unclipped Canvas content, tighten the
  fit-to-bounds zoom range, and shrink the top scrim now that it only
  needs to cover the attribution line.
- Fix tapped-stop and vehicle labels clipping at the screen edge by
  flipping to the opposite side of their icon when needed (shared
  resolveLabelSide helper), and stop them overlapping their own icon.
- Shorten vehicle trip descriptions to "<route> - Toward <destination>"
  now that the mode icon replaces the old text prefix; same icon now
  replaces the "Bus -" prefix on Upcoming Arrivals.
- Tint solid marker/vehicle/toggle icons black when Light map tiles are
  selected, so they stay legible against bright tiles.
- Add a Settings toggle ("Tap and hold a stop") that lets long-pressing
  any stop marker on the Map screen jump straight to its Upcoming
  Arrivals, off by default.
- Rename the Upcoming Arrivals "Map" link to show the stop name instead,
  relabel the stop-name line "Selected stop", and enlarge the map icon.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
pull_request_target grants privileged repo secrets/token access to
workflows triggered by fork PRs -- a guardrail GitHub blocks by default
for exactly that reason (the "pwn request" risk). This repo is
solo-maintained and isn't accepting outside fork contributions, so that
privileged-access trigger was never actually needed here; the standard
pull_request event checks out and runs against PR code just as well
without it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…verhaul

- Board/alight a trip from Trip Detail; HomeScreen shows live route, ETA,
  and stops remaining, plus an optional progress bar, while boarded
- "You've reached your stop" detection now also runs from HomeScreen, not
  just Trip Detail, via a shared checkReachedAlightStop
- Every screen gets a "Current Trip" header shortcut and a "Home" footer
  button that pops back to HomeScreen however many screens deep
- Warn (delete-icon indicator) when boarding a different trip would end
  tracking of the one already in progress
- Fix Map screen vehicle clutter: a station's platforms now share one
  display allotment instead of each platform getting its own
- Move "Track Tapped Stops" into Settings; unify every Settings toggle on
  the SDK's toggle-state icons instead of a two-row On/Off list
- Station-aware Connections screen (unions all platforms, not just one)
- New About screen: full icon/mode legend, boarding behavior, attribution
- Fix two crash-prone unguarded DB queries (UpcomingArrivals,
  StopConnections) surfaced by rapid back-navigation
- Drop dead ScheduleLocationScreen; update both READMEs to match

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@CJFData CJFData closed this Aug 2, 2026
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