[REFACTOR] Navigation Structure/Logic Improvement#99
Conversation
* Improve navigation structure/logic for the navigation via BottomNavBar.
- Apply Nested-Navigation graph for increased scalability, encapsulation of related screens, and better BackStackEntry Management.
- For the robust navigation handling for destinations accessed via BottomNavBar, Each BottomNavBar triggers the navigation to the corresponding NavGraph, with appropriate nav configuration (Save states for related instances, and restore it on later visit; Prevent multiple instantiation of same object per every screen visit)
- Implement Custom-defined BottomNavigationState composable to perform chronological back-button action handling.
- Refactor category-specific NavDestination into one, generalized NavDestination that accepts the category as a parameter.
* Improve navigation structure/logic for the navigation via BottomNavBar.
- Modify Lifecycle-bind event triggering logic to respect both Composition Lifecycle and Activity Lifecycle.
- Define Custom OnForegroundFocusEffect to seamlessly respond to both Composition and Activity Lifecycle.
(Instant event triggering on Screen becomes initially visible (Composition Lifecycle), LifecycleObserver to trigger event based on Application/Activity Lifecycle.
* Improve navigation structure/logic for the navigation via BottomNavBar.
- Remove unused import directives
- Completion of 1.7.1 Epic. Build configuration has been updated.
* Version Code: 38
* Version Name: 1.7.1 RC 1
There was a problem hiding this comment.
Code Review
This pull request refactors the navigation architecture by introducing nested navigation graphs and a custom BottomNavigationState to manage tab history and back-stack synchronization. It also implements an OnForegroundFocusEffect utility to handle lifecycle-aware UI events across several feature screens, including Home, Bookmark, and Major Notices. Review feedback highlights a potential state inconsistency in the preference navigation logic and suggests refactoring duplicated navigation code for better maintainability.
β¦ed NavGraph to perform navigation - Replace navigation via direct navController access to dedicated navigation function performs navigation via BottomNavState to ensure SSOT - Implement separate NavRoute resolver to resolve corresponding NavDestination for NoticeDetail and BookmarkDetail/Edit.
|
/gemini summary |
Summary of ChangesThis pull request refactors the application's navigation architecture to mitigate memory risks and improve resource efficiency. By transitioning to a nested navigation graph structure and implementing custom state management for the bottom navigation bar, the changes ensure more deterministic behavior and reduced object allocations. Additionally, new lifecycle-aware effects were introduced to standardize how data is refreshed when screens regain focus. Highlights
Activity
|
π Summary (κ°μ)
π Related Issue (κ΄λ ¨ μ΄μ)
π Type of Change (λ³κ²½ μ¬ν)
FEAT: New feature (μλ‘μ΄ κΈ°λ₯)FIX: Bug fix (λ²κ·Έ μμ )REFACTOR: Code refactoring (no functional change) (μ½λ 리ν©ν λ§)DESIGN: UI/UX changes (λμμΈ λ³κ²½)!HOTFIX: Critical fix (μΉλͺ μ μΈ λ²κ·Έ μμ )CHORE: Build/Config/CI (λΉλ/μ€μ /CI)β¨ Key Changes (ν΅μ¬ λ³κ²½ μ¬ν)
saveState/restoreStateandlaunchSingleTopoptions.BottomBarStateobject to achieve chronological back-action handling throughout the navigation.OnForegroudFocusEffectto achieve robust management of Lifecycle Event-bind event triggering, respecting both Composition Lifecycle and Application/Activity Lifecycle.π§ͺ Test Plan (ν μ€νΈ κ³ν)
π Quantitative Analysis (μ λλΆμ)
Method
HomeDashboardandNoticeByMajorusing BottomNavBar, 10 timesResult
HomeViewModelActive InstancesNoticeByMajorViewModelActive Instancesβ Checklist (체ν¬λ¦¬μ€νΈ)