adr/0005-redux-and-navigation.md
Date: 2024-10-17
Accepted
Redux needs to integrate navigation inside it's state so we can properly navigate with coordinators. This approach reduces redundancy by centralizing navigation handling in BrowserViewControllerState, ensuring that coordinators manage navigation consistently even when destinations overlap across different states.
We will adopt the following Redux + Navigation integration pattern across Firefox iOS:
NavigationBrowserAction type and a NavigationDestination enum to abstract navigation intents.HomepageState into a more global BrowserViewControllerState, reflecting that navigation is not specific to homepage.BrowserViewController now listens to state.navigationDestination and calls handleNavigation(to:) when non-nil.These changes formalize a pattern: navigation is expressed as Redux state or actions (intents), not direct view controller calls inside reducers or view logic.
BrowserViewControllerState could get bloated.