mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.14k stars 2.91k forks source link

Investigate context menu present from coordinator #16220

Open data-sync-user opened 1 year ago

data-sync-user commented 1 year ago

Context menu (which is a photon menu) are presented on long pressed in Bookmarks, History, Download and Reader mode panels. Example code:

func presentContextMenu(for site: Site, with indexPath: IndexPath, completionHandler: @escaping () -> PhotonActionSheet?) {
    guard let contextMenu = completionHandler() else { return }

    present(contextMenu, animated: true, completion: nil)
}

We also present PhotonActionSheet from Bookmarks panel with:

func presentInFolderActions() {
    let viewModel = PhotonActionSheetViewModel(actions: [[getNewBookmarkAction(),
                                                          getNewFolderAction(),
                                                          getNewSeparatorAction()]],
                                               modalStyle: .overFullScreen)
    let sheet = PhotonActionSheet(viewModel: viewModel)
    sheet.modalTransitionStyle = .crossDissolve
    present(sheet, animated: true)
}

Could we introduce coordinators for those, so different contextual menus can be presented in a standard way across the app, and not handled by VCs directly.

We can maybe have a specific class/handler for those, or another coordinator?

┆Issue is synchronized with this Jira Spike

github-actions[bot] commented 4 weeks ago

This issue has been automatically marked as stale. Has the issue been fixed, or does it still require the community's attention? Please leave any comment to keep this issue opened. It will be closed automatically if no further update occurs in the next 30 days. Thank you for your contributions!