Repository navigation
Conversation
…l phases On iPad the split view showed the live Reader and Notifications in places the iPhone shows the Moved-to-Jetpack poster: - the compact tab bar, shown when the window is narrow, always had a live Reader, and a live Notifications list outside staticScreensWithReader - in the wide layout, Reader links selected the live Reader even when the sidebar has no Reader row - in the wide layout, Notifications entrances selected the live list in static screens and the simplified UI - the sidebar restored a saved Reader selection without checking whether the Reader is available Narrowing the window or opening a link got around the feature flags. The split view now follows the same rules as the iPhone: the Reader is live when isReaderAvailable() and Notifications when jetpackFeaturesEnabled(); otherwise they show the poster, as a tab or a sheet. WPTabBarController's shouldUseStaticReader is settable so appUITypeDidChange can update both tabs.
Collaborator
Generated by 🚫 Danger |
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the iPad split view so the Reader and Notifications follow the same Jetpack features removal rules as the iPhone. Before this change, narrowing the window, or opening some app URLs, got around the feature flags. Stacked on #26301.
Summary
In the WordPress app on iPad, these places showed the live Reader or Notifications where the iPhone shows the Moved-to-Jetpack poster:
showReader(path:)without the Reader (e.g. aviewpostapp URL or Spotlight)showNotificationsTabin static screens or simplified UIJetpack is unchanged: its app UI type is always
normal.Reader links (
/read/...) were not a way around the flag.UniversalLinkRouteralready blocks Jetpack-powered routes in static screens. Two callers skip the router, though:viewpostapp URLs and Spotlight.Root Cause
SplitViewRootPresentercreated its compact tab bar withstaticReader: false. It only showed the Notifications poster forstaticScreensWithReader. A comment called this pre-existing and "kept as is". ItsshowReaderandshowNotificationsTabonly checked forstaticScreensWithReader.Changes
SplitViewRootPresenter.swift: the compact tab bar,appUITypeDidChange(),showReader(path:)andshowNotificationsTaball useJetpackFeaturesRemovalCoordinator.isReaderAvailable()andjetpackFeaturesEnabled(), the same checks the rest of the app uses. The Notifications poster sheet now also shows the Reader poster.SidebarViewModel.swift:resetSelection()only restores a saved Reader selection whenisReaderAvailable().WPTabBarController:shouldUseStaticReaderis settable. LikeshouldUseStaticNotifications, it replaces only the Reader tab's first screen (Build the tab bar's tabs once #26301).Test plan
RootViewCoordinatorTests:normaltostaticScreens, and from static screens with Reader tosimplified, keeps the tabs and the selected tabshowReaderandshowNotificationsTabin static screens present the postershowReaderwith Reader selects the ReadershouldUseStaticReaderswaps the first screen both waysExecuted 40 tests, with 63 failures. The setter test can't compile there.RootViewCoordinatorTests,NotificationsViewControllerTestsandMovedToJetpackViewModelTestspass, with no skips:Executed 48 tests, with 0 failuresandTest run with 2 tests in 1 suite passed.staticScreens:wpdebug://viewpost?blogId=…&postId=…: the Reader poster sheet opens, and the live Reader does not/read/discoverlink still shows the router's Jetpack overlay, as beforestaticScreensWithReader): the narrow Reader is live and Notifications shows the poster. The sameviewpostURL opens the live Reader post in the wide layout.normal): the compact tab bar has the live Reader and the live list.viewpostURLNot tried: a physical device, and Spotlight results. Spotlight calls the same
showReader(path:)asviewpost, which is covered above and by the tests.Related issues
staticScreenseven after the flag arrives.