Android Widget - Limit train changes#548
Conversation
Co-authored-by: Guy Tepper <guytepper@gmail.com>
Co-authored-by: Guy Tepper <guytepper@gmail.com>
…er-rail-app into widget_limit_train_changes
There was a problem hiding this comment.
Pull request overview
This PR adds a user-configurable filter to limit the maximum number of train changes displayed in the Android widget. Users can select "No limit", "Direct trains only", or "Up to 1 change" through a collapsible "Advanced" section in the widget configuration.
Changes:
- Added UI for configuring maximum train changes filter in widget settings
- Implemented filtering logic in the repository layer to apply the changes limit
- Enhanced the data model to track the number of changes per train route
- Updated click targets in widget layouts to improve touch area for route reversal
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| android/app/src/main/res/values/strings.xml | Added English strings for advanced section and max changes options |
| android/app/src/main/res/values-ru/strings.xml | Added Russian translations for new strings |
| android/app/src/main/res/values-iw/strings.xml | Added Hebrew translations for new strings |
| android/app/src/main/res/layout/widget_compact_4x2.xml | Added ID to destination container and padding for improved click target |
| android/app/src/main/res/layout/widget_compact_2x2.xml | Added ID to destination container and padding for improved click target |
| android/app/src/main/res/layout/activity_widget_config.xml | Added collapsible advanced section with max changes spinner |
| android/app/src/main/java/com/betterrail/widget/state/WidgetState.kt | Fixed arrival time display for error states in 4x2 widget |
| android/app/src/main/java/com/betterrail/widget/repository/TrainScheduleRepository.kt | Applied changes filter to API responses before caching |
| android/app/src/main/java/com/betterrail/widget/repository/ModernWidgetPreferencesRepository.kt | Added persistence for maxChanges preference and removed unused batch save |
| android/app/src/main/java/com/betterrail/widget/repository/ModernCacheRepository.kt | Enhanced cache validation to handle empty filtered results |
| android/app/src/main/java/com/betterrail/widget/data/TrainModels.kt | Added numberOfChanges field to WidgetTrainItem and maxChanges to WidgetData |
| android/app/src/main/java/com/betterrail/widget/api/RailApiService.kt | Enhanced API parsing to calculate numberOfChanges and format changes text |
| android/app/src/main/java/com/betterrail/widget/ModernBaseWidgetProvider.kt | Updated click targets to use destination container for better UX |
| android/app/src/main/java/com/betterrail/widget/BaseWidgetConfigActivity.kt | Added UI logic for advanced section and max changes spinner |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@guytepper בזמנך הפנוי 🙏🏻 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46db47c85b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Guy Tepper <guytepper@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.