Skip to content

Scope past/active trip indicators to the selected schedule date - #118

Merged
stephenyeargin merged 3 commits into
mainfrom
fix-trip-schedule-date-indicators
Aug 23, 2026
Merged

Scope past/active trip indicators to the selected schedule date#118
stephenyeargin merged 3 commits into
mainfrom
fix-trip-schedule-date-indicators

Conversation

@stephenyeargin

Copy link
Copy Markdown
Member

Summary

  • On a route page, the "hide past trips" toggle and the tr-past-trip/tr-active-trip row styling compared trip times to the current clock time regardless of the selected schedule date. Viewing a non-today date produced misleading past/active indicators. Both now only apply when the selected date is today; the toggle is hidden on other dates.
  • Adds a "Not Running Today" badge on the trip page when the API reports scheduled_today: false, now that GET /trips/:id can return trips that aren't scheduled for the current service day (see Return trips from GET /trips/:id regardless of today's service calendar gtfs-rails-api#155).

Test plan

🤖 Generated with Claude Code

stephenyeargin and others added 2 commits August 22, 2026 21:51
The "hide past trips" toggle and the tr-past-trip/tr-active-trip row
styling compared trip times against the current clock time regardless
of which date was selected on a route page, so viewing a non-today
date produced misleading past/active indicators. These now only apply
when the selected schedule date is today; the toggle is hidden
entirely on other dates.

Also show a "Not Running Today" badge on the trip page when the API
reports scheduled_today: false, now that GET /trips/:id can return
trips that aren't scheduled for the current service day
(transitnownash/gtfs-rails-api#155).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Upgrade to bg-danger to match the Canceled/Skipped severity, and skip
the progress meter entirely since a trip with no service today has no
meaningful progress to show.

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

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

This PR updates route/trip UI logic so “past/active trip” indicators and the “hide past trips” toggle only apply when the selected schedule date is today, and it adds a “Not Running Today” badge on trip pages when the API returns scheduled_today: false.

Changes:

  • Gate “Hide past trips” toggle visibility and past-trip filtering to only when scheduleDate is today.
  • Gate tr-active-trip / tr-past-trip row styling to only when the schedule date is today.
  • Add “Not Running Today” badge on the trip page when trip.scheduled_today === false, and suppress “No Data” / progress bar in that case.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/controllers/Trip.jsx Adds “Not Running Today” badge based on scheduled_today, and hides some realtime UI when false.
src/components/TripTableRow.jsx Scopes active/past row styling to today via isScheduleDateToday.
src/components/TripTable.jsx Computes isScheduleDateToday, hides the toggle on non-today dates, and disables past-trip filtering on non-today dates.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 13 to +46
@@ -38,7 +41,9 @@ function TripTable({
<>
<div className="d-flex align-items-center mb-2">
<div className="flex-grow-1">
<HidePastTripsToggle hidePastTrips={hidePastTrips} onChange={handleCheckboxChange} />
{isScheduleDateToday && (
<HidePastTripsToggle hidePastTrips={hidePastTrips} onChange={handleCheckboxChange} />
)}
Comment on lines 60 to 76
@@ -70,7 +70,9 @@ function TripTableRow({
if (hidePastTrips) {
return;
}
rowClasses = 'tr-past-trip';
if (isScheduleDateToday) {
rowClasses = 'tr-past-trip';
}
}
Copilot review flagged that the new isScheduleDateToday gating wasn't
covered: the hide-past-trips toggle/filtering on a non-today
scheduleDate, and tr-active-trip/tr-past-trip styling suppression on
TripTableRow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@stephenyeargin
stephenyeargin merged commit bc867aa into main Aug 23, 2026
5 checks passed
@stephenyeargin
stephenyeargin deleted the fix-trip-schedule-date-indicators branch August 23, 2026 17:00
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.

2 participants