Skip to content

Move downloads screen and menu item from app to downloads module#8043

Draft
GerardPaligot wants to merge 8 commits intodevelopfrom
feature/maintenance/move-downloads-to-module
Draft

Move downloads screen and menu item from app to downloads module#8043
GerardPaligot wants to merge 8 commits intodevelopfrom
feature/maintenance/move-downloads-to-module

Conversation

@GerardPaligot
Copy link
Contributor

Task/Issue URL: https://app.asana.com/1/137249556945/project/1202552961248957/task/1213721069856764

Description

Moves the downloads screen, menu item, and download badge/state management from the app module into the downloads-api and downloads-impl modules, following the standard -api/-impl module architecture.

What moved:

Component From To
DownloadsScreenNoParams app/.../DownloadsScreens.kt downloads-api
DownloadsMenuPlugin interface (new) downloads-api
DownloadMenuStateProvider interface app/.../menu/DownloadMenuStateProvider.kt downloads-api
DownloadsActivity + ViewModel + Adapter + ViewItems app/.../downloads/ downloads-impl
RealDownloadsMenuPlugin (new) downloads-impl
RealDownloadMenuStateProvider app/.../menu/DownloadMenuStateProvider.kt downloads-impl
DownloadBadgePlugin app/.../menu/DownloadBadgePlugin.kt downloads-impl
DownloadsNewTabShortcutPlugin app/.../downloads/ downloads-impl
All downloads layouts, drawables, menus app/src/main/res/ downloads-impl/src/main/res/

Browser menu integration:

  • Replaced hardcoded MenuItemView with a FrameLayout container in all 3 browser menu layouts
  • BrowserTabFragment now uses PluginPoint<DownloadsMenuPlugin> to populate the container
  • Download dot indicator is managed entirely within the downloads module via DownloadMenuStateProvider
  • showDownloadDot removed from BrowserMenuViewState

Navigation:

  • BrowserActivity and TabSwitcherActivity use GlobalActivityStarter + DownloadsScreenNoParams instead of direct DownloadsActivity.intent() calls

Steps to test this PR

Downloads screen

  • Open browser menu → tap Downloads → verify Downloads screen opens
  • Verify downloads list shows previously downloaded files
  • Download a new file → verify it appears in the list
  • Delete a download → verify it is removed
  • Share a download → verify share sheet appears

Download badge (dot indicator)

  • Download a file → open browser menu → verify blue dot appears on Downloads menu item
  • Tap Downloads to open the screen → close it → open browser menu again → verify dot is gone
  • Repeat in both popup menu (landscape/tablet) and bottom sheet menu (portrait phone)

New Tab shortcut

  • Verify Downloads shortcut appears on New Tab page (if enabled)
  • Tap it → verify Downloads screen opens

Tab switcher

  • Open tab switcher → tap Downloads option → verify Downloads screen opens

Browser menu variants

  • Verify Downloads menu item appears in bottom sheet menu (portrait)
  • Verify Downloads menu item appears in popup menu (landscape/tablet)
  • Verify Downloads menu item appears in DuckAI tab menu
  • Verify Downloads menu item appears in New Tab Page menu

UI changes

No visual changes — this is a pure refactor moving code between modules.

Move DownloadsScreenNoParams ActivityParams from app to downloads-api
and add DownloadsMenuPlugin interface for browser menu integration.
Move DownloadsActivity, DownloadsViewModel, DownloadsAdapter, and
supporting classes from app to downloads-impl/ui package. Move layout
resources, menu, drawables, and string resources. Move test file.
Add DownloadsMenuPlugin implementation and plugin point.
…odule

- Move DownloadMenuStateProvider interface to downloads-api
- Move RealDownloadMenuStateProvider and DownloadBadgePlugin to downloads-impl
- Integrate DownloadsMenuPlugin into browser menu via PluginPoint
- Replace MenuItemView with FrameLayout container in browser menu layouts
- Remove showDownloadDot from BrowserMenuViewState
- Update BrowserTabFragment to use DownloadsMenuPlugin for menu setup
- Update BrowserActivity and TabSwitcherActivity to use DownloadsScreenNoParams
- Remove DownloadsActivity registration from app AndroidManifest
- Delete all downloads UI files, resources, and tests from app module
- Add navigation-api, new-tab-page-api, feature-toggles-api deps to downloads-impl
@GerardPaligot GerardPaligot changed the base branch from develop to feature/gerard/browser-menu-download March 20, 2026 14:54
@GerardPaligot GerardPaligot changed the base branch from feature/gerard/browser-menu-download to develop March 20, 2026 14:54
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