Skip to content

Imartin/mbl 2793#2465

Closed
Arkariang wants to merge 4 commits intomasterfrom
imartin/MBL-2793
Closed

Imartin/mbl 2793#2465
Arkariang wants to merge 4 commits intomasterfrom
imartin/MBL-2793

Conversation

@Arkariang
Copy link
Copy Markdown
Contributor

@Arkariang Arkariang commented Jan 22, 2026

📲 What

  • Refactored SearchAndFilter to hold a parent composable
@Composable
fun SearchAndFilterScreen(
    env: Environment,
    filterMenuVM: FilterMenuViewModel,
    searchViewModel: SearchAndFilterViewModel,
    onBackClicked: () -> Unit = {},
    preLaunchedCallback: (project: Project, reftag: RefTag) -> Unit = { a, b -> }

This parent composable is able to be loaded in HomeScreen as navigation destination as the same time as keeping it on SearchAndFilter activity.

🤔 Why

  • New HomeScreen using bottomNavigation + navigation library is able to re-use SearchAndFilter already exiting UI + busines logic

🛠 How

  • Parent composable with VM's and callback actions as dependencies

👀 See

Screen_recording_20260121_165530.mp4

| | |

📋 QA

  • Make sure the search experience from Discovery has not suffered any regression. Just search a bit accessing it from Discovery screen.
  • Play around with it on HomeScreen :)

Story 📖

MBL-2793

…ng them dynamic

- Hoisted navigation Logic into parent composable, FloatingBottomNav only dependency is list<Tabs>
private val viewModel: HomeScreenViewModel by viewModels { viewModelFactory }

// Search related VM's
private lateinit var searchVMFactory: SearchAndFilterViewModel.Factory
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking on exploring the "Dependency Provider" Pattern on follow up tickets

data class HomeDependencies(
    val searchVM: () -> SearchAndFilterViewModel,
    val filterMenuVM: () -> FilterMenuViewModel,
    val environment: Environment
)

were the dependencies class will be added to local composition

val LocalHomeDeps = staticCompositionLocalOf<HomeDependencies> { 
    error("No Dependencies provided") 
}

aiming to avoid in the future overloading HomeActivity with tones of VM initialization and prop drilling them into the future navigation composables 🤔 .

For now this is good enough, but feel free to throw any ideas!!

@Arkariang Arkariang closed this Jan 26, 2026
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