wordpress-mobile / wordpress-mobile/WordPress-Android

Bug: Self-hosted sites Reader Tab does not default to Discover

Open
#14,565 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

[Pri] Medium [Type] Bug Reader
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

Expected behavior

When logging in with a self-hosted and tapping the “Reader” tab, the default tab should be “Discover”.

Actual behavior

When logging in with a self-hosted and tapping the “Reader” tab, the default tab is "Following"

Notes from Slack Chat

  • The "following" readerTag is manually created as the defaultInMemory value for self-hosted sites in LoadReaderTabsUseCase (see here)
  • Expecting appPrefsWrapper.getReaderTag()? to return null and tagList.find { it.isDefaultSelectedTab() } to set the Discover tab (see here)
  • The onTagChanged event is raised from
_uiState.value = ContentUiState(
        tagList.map { it.label },
        tagList,
        searchIconVisible = isSearchSupported(),
        settingsIconVisible = isSettingsSupported()
)

However this event is raised multiple times and not before the default is set from ReaderViewModel.start.loadtabscall

I pushed my log line branch issue/14565-reader-tab-not-default-to-discover-logs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LoadReaderTabsUseCase.kt, especially the self-hosted defaultInMemory readerTag, then trace ReaderViewModel.start.loadtabs and the onTagChanged event described in ReaderViewModel.kt. Done means opening Reader on a self-hosted site selects Discover by default rather than Following, without changing the expected behavior for other sites.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.