Skip to content

[Explore Feed] Reactive load when tab and language changes#6628

Open
Williamrai wants to merge 2 commits into
mainfrom
ef-combine-language-and-tab
Open

[Explore Feed] Reactive load when tab and language changes#6628
Williamrai wants to merge 2 commits into
mainfrom
ef-combine-language-and-tab

Conversation

@Williamrai
Copy link
Copy Markdown
Collaborator

@Williamrai Williamrai commented May 22, 2026

What does this do?

  • reloads the home feed reactively when the language or selected tab changes, instead of manual calls.

Why is this needed?

Current code has _selectedTab and _wikiSIte as state but we load them manually. Whenever either changed, some caller had to remember to also call the right load/refresh function. This logic is spread across:

  • HomeViewModel.selectTab
  • HomeViewModel.reloadCurrentTab
  • HomeViewModel.updateLanguage
  • HomeFragment.selectTab
    So this PR makes loading a reaction to state not manual call.

Note:HomeFragment.customizeInterestsLauncher still need an explicit call since interest changed isn't observed as flow.

@Williamrai Williamrai requested review from cooltey and dbrant as code owners May 22, 2026 18:12
@Williamrai Williamrai changed the title [Explore Feed] [Explore Feed] Reactive load when tab and language changes May 22, 2026
@@ -156,7 +156,6 @@ class HomeFragment : Fragment() {
private val customizeInterestsLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
if (it.resultCode == RESULT_INTERESTS_UPDATED) {
Prefs.homeForYouModulesToday = ""
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This would still be manual call because right now we are not observing interest change flow.

@Williamrai Williamrai added the Minor Minor stuff label May 22, 2026
Copy link
Copy Markdown
Collaborator

@cooltey cooltey left a comment

Choose a reason for hiding this comment

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

It looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants