Skip to content

[Feat] Error 핸들링/Alert 추가#21

Merged
ParkSeongGeun merged 6 commits intodevfrom
feat/alert-19
Nov 15, 2025
Merged

[Feat] Error 핸들링/Alert 추가#21
ParkSeongGeun merged 6 commits intodevfrom
feat/alert-19

Conversation

@ParkSeongGeun
Copy link
Copy Markdown
Contributor

@ParkSeongGeun ParkSeongGeun commented Nov 15, 2025

#19

개요

  • Alert 관리 시스템 추가: 우선순위 기반 alert 표시 및 중복 방지
  • 권한 검증: 위치/블루투스 권한 거부 시 설정 이동 안내
  • 서울 외 지역 감지: API 응답 기반 서울 외 지역 접근 차단
  • API 에러 처리: 서버 문제 발생 시 사용자 알림

Summary by CodeRabbit

  • New Features

    • Added location-based nearest bus stop finder
    • Added real-time bus arrival information display
    • Added onboarding screens and help documentation
    • Added app information section with version and contact details
    • Added Bluetooth device connectivity for courtesy seat notifications
  • Tests

    • Added test coverage for location management and bus stop functionality

@ParkSeongGeun ParkSeongGeun self-assigned this Nov 15, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 15, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

This PR establishes foundational infrastructure for a Seoul-based bus tracking application by introducing location services, Bluetooth connectivity to bus-mounted devices, real-time bus arrival APIs, alert management, and a complete onboarding and home view. Includes comprehensive unit tests and configuration updates.

Changes

Cohort / File(s) Summary
Project Configuration
.gitignore, ComfortableMove/.gitignore, ComfortableMove/ComfortableMove.xcodeproj/project.pbxproj, ComfortableMove/ComfortableMove/Info.plist
Added Xcconfig ignore patterns; created project-wide ignores for macOS/Xcode/CocoaPods; added test target ComfortableMoveTest with build phases and configurations; added Info.plist keys for API/Bluetooth UUIDs, permissions, and transport security.
Asset Catalog Updates
ComfortableMove/ComfortableMove/App/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json, ComfortableMove/ComfortableMove/App/Resources/Assets.xcassets/Color/OnboardingGray.colorset/Contents.json, ComfortableMove/ComfortableMove/App/Resources/Assets.xcassets/Image/*.imageset/Contents.json
Updated app icon filenames; added OnboardingGray color asset; created Contents.json for HelpImage, HomeTitle, InfoImage, bluetooth, buttonImage, buttonTappedImage, distance image sets with multi-scale variants.
Core Managers
ComfortableMove/ComfortableMove/Core/Manager/APIManager.swift, ComfortableMove/ComfortableMove/Core/Manager/AlertManager.swift, ComfortableMove/ComfortableMove/Core/Manager/LocationManager.swift, ComfortableMove/ComfortableMove/Core/Manager/BusArrivalService.swift, ComfortableMove/ComfortableMove/Core/Manager/BusStopService.swift, ComfortableMove/ComfortableMove/Core/Manager/DistrictMapper.swift, ComfortableMove/ComfortableMove/Core/Manager/Bluetooth/BluetoothConfig.swift, ComfortableMove/ComfortableMove/Core/Manager/Bluetooth/BluetoothManager.swift
Created AlertManager with prioritized alert types and settings navigation; LocationManager for CLLocationManager integration with permission handling; BusArrivalService and BusStopService for async API calls to Korean bus/station endpoints; DistrictMapper for Korean-to-English bus number translation; BluetoothConfig and BluetoothManager for BLE device discovery and courtesy-seat message transmission.
Data Models
ComfortableMove/ComfortableMove/Core/Model/BusArrivalResponse.swift, ComfortableMove/ComfortableMove/Core/Model/BusStop.swift, ComfortableMove/ComfortableMove/Core/Model/StationByPosResponse.swift, ComfortableMove/ComfortableMove/Core/Model/StopWithRoutes.swift
Added BusArrivalResponse with route type classification; BusStop with Identifiable/Codable conformance; StationByPosResponse with nested MsgBody and StationItem; StopWithRoutes with nested RouteInfo and custom equality.
Configuration and AppConfig
ComfortableMove/ComfortableMove/App/Sources/AppConfig.swift
Added AppConfig singleton sourcing API_KEY from Info.plist.
UI Views – Home
ComfortableMove/ComfortableMove/Core/Home/HomeView.swift (removed), ComfortableMove/ComfortableMove/Core/Home/BusNumberRow.swift (removed), ComfortableMove/ComfortableMove/Core/Presentation/Home/HomeView.swift (added)
Removed legacy Core/Home views; added new Presentation/Home/HomeView orchestrating LocationManager, BluetoothManager, and AlertManager with async station/arrival fetching, route selection, courtesy-seat notifications, and alert handling.
UI Views – Onboarding & Help
ComfortableMove/ComfortableMove/Core/Splash/OnBoardingView.swift (removed), ComfortableMove/ComfortableMove/Core/Presentation/Splash/OnBoardingView.swift (added), ComfortableMove/ComfortableMove/Core/Presentation/Splash/SplashView.swift, ComfortableMove/ComfortableMove/Core/Presentation/Help/HelpPageView.swift, ComfortableMove/ComfortableMove/Core/Presentation/Help/InfoView.swift
Moved OnBoardingView from Core/Splash to Core/Presentation/Splash with multi-page TabView and dot indicators; updated SplashView background color; added HelpPageView for dismissible overlay; added InfoView with version/contact/policy rows.
Test Suite
ComfortableMove/ComfortableMoveTest/BusStopManagerTests.swift, ComfortableMove/ComfortableMoveTest/LocationManagerTests.swift
Added unit tests for BusStopManager (state, nearest stop finding, consistency, performance) and LocationManager (state, callbacks, refresh, error handling).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor User
    participant HomeView
    participant LocationManager
    participant BusStopService
    participant BusArrivalService
    participant AlertManager
    participant BluetoothManager
    
    User->>HomeView: App opens or requests refresh
    HomeView->>LocationManager: requestPermission() / refreshLocation()
    LocationManager->>User: Request location permission
    User-->>LocationManager: Grant permission
    LocationManager->>LocationManager: Start tracking location
    LocationManager-->>HomeView: currentLocation updated
    
    HomeView->>BusStopService: getNearbyStations(location)
    BusStopService-->>HomeView: [StationItem] or error
    alt Success
        HomeView->>HomeView: Find nearest stop, find arrivals
        HomeView->>BusArrivalService: getStationArrivalInfo(arsId)
        BusArrivalService-->>HomeView: [BusArrivalItem] or error
    else OutOfSeoul / API Error
        HomeView->>AlertManager: showAlert(outOfSeoul/apiError)
        AlertManager-->>HomeView: Display alert
    end
    
    User->>HomeView: Select bus route
    HomeView->>HomeView: Update selected route state
    User->>HomeView: Tap "send courtesy-seat notification"
    HomeView->>BluetoothManager: sendCourtesySeatNotification(busNumber)
    BluetoothManager->>BluetoothManager: Scan for bus device
    BluetoothManager->>BluetoothManager: Connect & write message
    BluetoothManager-->>HomeView: Success/failure callback
    HomeView->>AlertManager: showAlert(success or error)
    HomeView->>HomeView: Reset selection
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas requiring extra attention:
    • BluetoothManager.swift — Multi-delegate pattern (CBCentralManagerDelegate, CBPeripheralDelegate) with state machine across scanning/connecting/writing; error paths and timeout logic need validation.
    • HomeView.swift (Presentation) — Dense async/await flows with three managers interacting; state transitions (location→station→arrivals→Bluetooth) and error handling across multiple alert types.
    • BusArrivalResponse.swift — Route type classification logic (BusRouteType.from) with heuristics for Korean bus number patterns; ensure all bus type mappings are correct.
    • LocationManager.swift — Permission state machine (notDetermined/authorized/denied) and one-time callback logic; verify CLLocationManager delegate lifecycle.
    • Info.plist configuration keys — Verify all mandatory keys (API_KEY, Bluetooth UUIDs) are provided; fatalError fallback in BluetoothConfig and AppConfig.

Possibly related issues

  • Error 핸들링/Alert 추가 #19 — AlertManager with prioritized alert types (outOfSeoul, apiError, bluetoothUnsupported/unauthorized, locationUnauthorized) and settings navigation directly addresses error-handling and alert system requirements.

Possibly related PRs

Suggested reviewers

  • jinny3824

Poem

🐰 A rabbit hops through Seoul's busy streets,
With Bluetooth hops and location beats,
Bus stops now visible, alerts so clear,
Courtesy messages floating near!
From splash to home, the UI's grown,
Tests passing strong in hopper's zone! 🚌✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '[Feat] Error 핸들링/Alert 추가' directly and accurately reflects the main objective of the changeset: adding error handling and alert management to the application.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/alert-19

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ParkSeongGeun ParkSeongGeun changed the base branch from main to dev November 15, 2025 10:50
@ParkSeongGeun ParkSeongGeun merged commit 719e635 into dev Nov 15, 2025
1 check passed
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