Adds a white-label configurable arrival/departure filter#1096
Open
diveshpatil9104 wants to merge 1 commit intoOneBusAway:mainfrom
Open
Adds a white-label configurable arrival/departure filter#1096diveshpatil9104 wants to merge 1 commit intoOneBusAway:mainfrom
diveshpatil9104 wants to merge 1 commit intoOneBusAway:mainfrom
Conversation
63e9337 to
0cc5dbb
Compare
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.
Summary
Adds a white-label configurable arrival/departure filter that lets users choose which departures to display: All, Real-Time Only, or Scheduled Only. Closes #597.
Problem: Transit agencies using the white-label framework wanted to control whether scheduled (non-real-time) arrivals are shown. Some agencies have unreliable schedule data, and displaying "arrives 5 min late" highlights poor service performance. They needed the ability to hide scheduled arrivals when real-time data is unavailable.
Solution: A global
ArrivalDepartureFiltersetting accessible from both the Settings page and a Departure Type menu on each stop view. Brands can configure the default viaCoreAppConfig.defaultArrivalDepartureFilter.Changes
StopPreferences.swift— AddedArrivalDepartureFilterenum (.all,.estimatedOnly,.scheduledOnly)CoreAppConfig.swift— AddeddefaultArrivalDepartureFilterproperty for white-label brand default + shared UserDefaults keyAppConfig.swift— Pass-through for new config parameterArrivalDeparture.swift— Addedfilter(by:)extension on[ArrivalDeparture]using thepredictedpropertyStopViewController.swift— Reads global filter from UserDefaults, applies to both time-sorted and route-sorted views, adds Departure Type submenuSettingsViewController.swift— Added Arrival Display section withAlertRowfor global filter preferenceArrivalDepartureFilterTests.swift— Unit tests for filter logic, enum, empty arrays, complementary counts, and UserDefaults round-tripsScreenshots / Demo
Implementation.mp4
Test Plan
ArrivalDepartureFilterTests,ArrivalDepartureFilterEnumTests,ArrivalDepartureFilterUserDefaultsTests)