Extract downloads menu item and screen UI from app to downloads module#8126
Draft
GerardPaligot wants to merge 1 commit intodevelopfrom
Draft
Extract downloads menu item and screen UI from app to downloads module#8126GerardPaligot wants to merge 1 commit intodevelopfrom
GerardPaligot wants to merge 1 commit intodevelopfrom
Conversation
Move DownloadsActivity, DownloadsViewModel, DownloadsAdapter and related UI classes from app to downloads-impl. Move DownloadsScreens to downloads-api. Introduce BrowserMenuPlugin interface in browser-api and PluginPoint in browser-ui so the downloads menu item is contributed via the plugin system instead of being hardcoded in BrowserMenuBottomSheet / BrowserPopupMenu. Replace SettingsDataStore-backed DownloadMenuStateProvider with a dedicated DataStore<Preferences> in downloads-impl. Move DownloadBadgePlugin and DownloadsNewTabShortcutPlugin to downloads-impl. Update TabSwitcherActivity to use GlobalActivityStarter instead of a direct DownloadsActivity reference. Update all related tests and remove stale string resources from app.
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.
Task/Issue URL
https://app.asana.com/1/137249556945/project/1202552961248957/task/1213721069856764
Description
Extract the downloads menu item and downloads screen UI from the
appmodule into thedownloadsmodule (downloads-apianddownloads-impl).What changed:
New plugin system for browser menu items:
BrowserMenuPlugininterface inbrowser-api— allows features to contribute menu items to the browser menuBrowserMenuPluginPointinbrowser-ui— Dagger multibinding plugin point atAppScopeBrowserMenuBottomSheetandBrowserPopupMenunow render plugins dynamically viarenderMenuPlugins()BrowserMenuViewStateno longer containsshowDownloadDot— highlight state comes from pluginsMoved to
downloads-impl:DownloadsActivity,DownloadsViewModel,DownloadsAdapter,DownloadViewItem,DownloadsItemListenerDownloadMenuStateProvider— rewritten to use a dedicatedDataStore<Preferences>instead ofSettingsDataStoreDownloadBadgePlugin— listens for download completionDownloadsMenuItemPlugin— newBrowserMenuPluginimplementation that contributes the downloads menu itemDownloadsNewTabShortcutPluginRealDownloadsFileActionsMoved to
downloads-api:DownloadsScreens— containsDownloadsScreenNoParamsfor navigationUpdated references:
TabSwitcherActivity— now usesGlobalActivityStarterinstead of directDownloadsActivityreferenceBrowserActivity— updated import forDownloadsScreenNoParamsBrowserTabFragment— usesDownloadsRimport alias for download string resourcesBrowserMenuHighlightState— combines plugin highlight flows instead of usingDownloadMenuStateProviderdirectlySteps to test this PR
UI changes
No visual changes — this is a pure code extraction/refactoring.