Skip to content

feat: follow bus button on trip search results - #776

Merged
gorandalum merged 2 commits into
mainfrom
dalum/follow_bus_btn
Jul 20, 2026
Merged

feat: follow bus button on trip search results#776
gorandalum merged 2 commits into
mainfrom
dalum/follow_bus_btn

Conversation

@gorandalum

@gorandalum gorandalum commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-07-17 at 14 02 07

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
planner-web Ready Ready Preview, Comment Jul 20, 2026 6:10am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds “follow vehicle” support to trip search results by polling for vehicle positions per service journey and conditionally rendering a follow button in the trip leg UI.

Changes:

  • Added a new /api/departures/vehicles endpoint and BFF client wrapper to fetch vehicle positions for a list of service journey IDs.
  • Introduced client-side polling hooks to fetch service-journey vehicle snapshots and derive which legs currently have live vehicle data.
  • Rendered a “Follow {transportMode}” button in trip sections when live vehicle data is available, including new translation text.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/translations/pages/assistant.ts Adds translated label for the new “follow vehicle” action.
src/pages/api/departures/vehicles.ts New API route to fetch vehicle positions by service journey IDs.
src/page-modules/departures/server/vehicles/index.ts New server-side BFF client wrapper for the vehicles endpoint.
src/page-modules/departures/server/index.ts Composes the new vehicles client into the departure server client.
src/page-modules/departures/client/vehicles/index.ts Re-exports the new polling hook.
src/page-modules/departures/client/vehicles/get-service-journey-vehicles.ts Adds SWR polling hook for vehicle snapshots by service journey IDs.
src/page-modules/assistant/trip/trip-pattern-collapse/index.tsx Computes live-vehicle IDs for a trip pattern and passes to trip sections.
src/page-modules/assistant/details/use-live-vehicle-ids.ts New hook to derive the set of live-vehicle service journey IDs from legs.
src/page-modules/assistant/details/trip-section/index.tsx Conditionally renders the “Follow vehicle” button per leg.
src/page-modules/assistant/details-body/index.tsx Passes live-vehicle availability into trip sections in details view.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

import { ColorIcon } from '@atb/components/icon';
import { ColorIcon, MonoIcon } from '@atb/components/icon';
import { ButtonLink } from '@atb/components/button';
import { transportModeToTranslatedString } from '@atb/modules/transport-mode';
@gorandalum
gorandalum merged commit a8fce15 into main Jul 20, 2026
5 checks passed
@gorandalum
gorandalum deleted the dalum/follow_bus_btn branch July 20, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants