Skip to content

✨ feat: implement location suggestions and comprehensive transport mode UX improvements#7

Merged
MasuRii merged 3 commits intomainfrom
feature/location-suggestions-and-transport-mode-ux
Jan 1, 2026
Merged

✨ feat: implement location suggestions and comprehensive transport mode UX improvements#7
MasuRii merged 3 commits intomainfrom
feature/location-suggestions-and-transport-mode-ux

Conversation

@MasuRii
Copy link
Copy Markdown
Member

@MasuRii MasuRii commented Jan 1, 2026

✨ Summary

This PR implements location suggestions and comprehensive transport mode UX improvements for the PH Fare Calculator app. Users can now search for locations with autocomplete suggestions, see real-time loading indicators during searches, and enjoy a completely redesigned transport mode selection experience with Material 3 design. The feature also includes fare result persistence on route swaps, per-person price calculations, and numerous UI/UX refinements across the entire application.

🚀 New Features

🗺️ Location Suggestions with Autocomplete

  • Map Picker Search: Replaced simple TextField with Autocomplete widget integrated with GeocodingService
  • Real-time Suggestions: Users now see location suggestions as they type in origin/destination fields
  • Smart Selection: Choosing a suggestion automatically moves the map camera to the selected location
  • Debounced Search: Implemented debouncing to prevent excessive API calls during typing

🚌 Transport Mode Selection Modal (Material 3)

  • New Modal Design: Created TransportModeSelectionModal with Material 3 bottom sheet design
  • Categorized Display: Transport modes grouped by category (Road, Rail, Water) for easy browsing
  • Quick Toggle Button: Added "Modes" button in TravelOptionsBar with badge count showing selected modes
  • Smart Prompts: Modal automatically appears when user tries to calculate fare without selecting modes
  • Preference Persistence: Saved transport mode preferences now persist across app sessions

💰 Fare Calculation Improvements

  • Lowest Overall Sort Option: New sorting option in fare comparison to find the cheapest overall route
  • Per-Person Price Display: Corrected per-person price calculation logic for group travel
  • Fare Results Persistence: Fare results now persist when swapping origin/destination locations
  • Base Name + Chip Formatting: Improved fare result display with transport mode type chips

🐛 Bug Fixes

  • 🔧 Input Field Alignment: Fixed alignment issue by swapping button and route indicator positions
  • ⏳ Loading Indicator Timing: Fixed loading indicator display using post-frame callbacks for smoother UX
  • 🧮 Price Calculation: Corrected per-person price calculation logic for accurate group fare display
  • 📊 Storage Bar Accuracy: Fixed storage bar accuracy in region management screen
  • 👤 Passenger State Management: Fixed passenger state management when setting discount types

🎨 Improvements

🎯 User Experience Enhancements

  • 📝 Word-wrap for Input Fields: Origin/destination input fields now wrap to 2 lines for long addresses
  • 🚌 Smart Default Modes: Default transport modes set to Jeepney/Bus/Taxi only (previously all enabled)
  • 🔤 Transport Mode Chips: Replaced brackets with visual transport mode type chips for better readability
  • 🗺️ Real Address Display: Map picker now shows real address with debounced updates while panning

🏗️ Code Architecture

  • 💾 Enhanced Settings Persistence: Improved SettingsService with better transport mode preference management
  • 🔧 Dependency Injection Cleanup: Cleaned up injection.config.dart formatting and structure
  • 🧪 Test Infrastructure: Updated MockSettingsService and FakeSettingsService with new interface methods

📝 Version

  • Bump: 2.1.0 → 2.2.0
  • Build: +3 → +4
  • Release Notes: GitHub workflow updated for automated release notes generation

✅ Testing

  • 245 unit tests pass across all test suites
  • Manual testing completed for all new features
  • Edge cases verified including:
    • Empty search results handling
    • Transport mode selection persistence
    • Location suggestion timeout scenarios
    • Fare calculation with multiple transport modes

📁 Files Changed

Core Models

File Change Type Description
lib/src/models/map_region.dart 🔧 Modified Enhanced map region model with additional properties
lib/src/models/transport_mode.dart ✨ New Extended transport mode model with new capabilities

Controllers & Services

File Change Type Description
lib/src/presentation/controllers/main_screen_controller.dart 🔧 Modified Enhanced controller with location and transport mode logic
lib/src/services/fare_comparison_service.dart 🔧 Modified Added "Lowest Overall" sort option
lib/src/services/settings_service.dart 🔧 Modified Improved settings persistence for transport modes

Screens

File Change Type Description
lib/src/presentation/screens/main_screen.dart 🔧 Modified Main screen with location suggestions integration
lib/src/presentation/screens/map_picker_screen.dart 🔧 Modified Map picker with autocomplete and real address display
lib/src/presentation/screens/settings_screen.dart 🔧 Modified Settings screen with transport mode UI updates

Widgets

File Change Type Description
lib/src/presentation/widgets/fare_result_card.dart 🔧 Modified Fare result card with improved display formatting
lib/src/presentation/widgets/main_screen/fare_results_list.dart 🔧 Modified Fare results list with persistence support
lib/src/presentation/widgets/main_screen/location_input_section.dart 🔧 Modified Location input with loading indicators and word-wrap
lib/src/presentation/widgets/main_screen/transport_mode_selection_modal.dart ✨ New New Material 3 transport mode selection modal (563 lines)
lib/src/presentation/widgets/main_screen/travel_options_bar.dart 🔧 Modified Travel options bar with quick-access modes button

Infrastructure

File Change Type Description
.github/workflows/release-apk.yml 🔧 Modified Updated workflow for release notes generation
lib/src/core/di/injection.config.dart 🔧 Modified Cleaned up dependency injection configuration
pubspec.yaml 🔧 Modified Version bump to 2.2.0+4

Tests

File Change Type Description
test/helpers/mocks.dart 🔧 Modified Updated mock interfaces
test/models/map_region_test.dart 🔧 Modified Enhanced map region tests
test/screens/main_screen_test.dart 🔧 Modified Updated main screen tests
test/screens/onboarding_localization_test.dart 🔧 Modified Added localization test coverage
test/screens/region_download_screen_test.dart 🔧 Modified Enhanced region download tests

Total Changes: 21 files modified, 1,766 insertions(+), 269 deletions(-)

📊 Commits Included

This PR consolidates 3 commits from the feature branch:

  1. c847256 - ✨ feat: implement location suggestions and comprehensive transport mode UX improvements
  2. 5e60b90 - ♻️ refactor: enhance discount handling and transport mode UX persistence
  3. c84cc55 - ✨ Add location suggestions, loading indicators, and transport mode UX improvements

Please review and merge after CI passes! 🚀

… improvements

📝 Summary:
This commit addresses three user-reported issues in the PH Fare Calculator app:
1. Map picker search field now shows location suggestions
2. All location input fields display loading indicators during search
3. Transport modes default to disabled with new selection modal and quick toggle

🔧 Changes:

🗺️ Map Picker Location Suggestions:
- Replaced placeholder TextField with Autocomplete<Location> widget
- Integrated GeocodingService for location search
- Added selection logic to move map camera to chosen location

⏳ Loading Indicators:
- Added ValueNotifier<bool> pattern for tracking search state
- Display 16px CircularProgressIndicator in input suffix while fetching
- Applied to both main screen (origin/destination) and map picker search

🚌 Transport Mode Improvements:
- Changed default for all transport modes to disabled for new users
- Added hasSetTransportModePreferences() to distinguish new vs existing users
- Created TransportModeSelectionModal with Material 3 bottom sheet design
- Modal shows modes grouped by category (Road, Rail, Water)
- Added quick-access "Modes" button in TravelOptionsBar with badge count
- Modal appears when calculating fare with no modes enabled

🧪 Tests:
- Updated MockSettingsService and FakeSettingsService with new interface
- Fixed flaky test finder in main_screen_test.dart
- All 289 tests pass
- Add passenger state management when setting discount type
- Fix location search loading indicator timing with post-frame callback
- Load saved transport mode preferences on modal initialization
- Clean up injection.config.dart formatting
…de UX improvements

- Set default transport modes to Jeepney/Bus/Taxi only
- Add word-wrap for origin/destination input fields (2-line limit)
- Implement fare results persistence on route swap
- Add real address display in map picker with debounce
- Introduce Lowest Overall sort option for fare comparison
- Fix storage bar accuracy in region management
- Replace brackets with transport mode type chips
- Improve fare result display with base name + chip formatting
- Fix input field alignment (swap button and route indicator)
- Correct per-person price calculation logic
- Bump version to 2.2.0+4
- Update GitHub workflow for release notes generation
@MasuRii MasuRii merged commit 18eacd0 into main Jan 1, 2026
10 checks passed
@MasuRii MasuRii deleted the feature/location-suggestions-and-transport-mode-ux branch March 16, 2026 01:21
MasuRii added a commit that referenced this pull request Mar 16, 2026
…gestions-and-transport-mode-ux

feat: implement location suggestions and comprehensive transport mode UX improvements
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