diff --git a/firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift b/firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift index 01b3d65d8294..6c56f9cad72b 100644 --- a/firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift +++ b/firefox-ios/Client/FeatureFlags/NimbusFlaggableFeature.swift @@ -31,8 +31,6 @@ enum NimbusFeatureFlagID: String, CaseIterable { case reduxSearchSettings case reportSiteIssue case searchHighlights - case shareSheetChanges - case shareToolbarChanges case splashScreen case tabTrayRefactor case zoomFeature @@ -81,8 +79,6 @@ struct NimbusFlaggableFeature: HasNimbusSearchBar { .feltPrivacySimplifiedUI, .feltPrivacyFeltDeletion, .searchHighlights, - .shareSheetChanges, - .shareToolbarChanges, .splashScreen, .tabTrayRefactor, .zoomFeature: diff --git a/firefox-ios/Client/Frontend/Browser/MainMenuActionHelper.swift b/firefox-ios/Client/Frontend/Browser/MainMenuActionHelper.swift index cf2040439c3c..26a9cec20294 100644 --- a/firefox-ios/Client/Frontend/Browser/MainMenuActionHelper.swift +++ b/firefox-ios/Client/Frontend/Browser/MainMenuActionHelper.swift @@ -263,23 +263,14 @@ class MainMenuActionHelper: PhotonActionSheetProtocol, let shortAction = getShortcutAction() append(to: §ion, action: shortAction) - // Feature flag for share sheet changes where we moved send to device and copy - // away from hamburger menu to the actual system share sheet. When share sheet - // changes flag is on we do not append items to the hamburger menu - if !featureFlags.isFeatureEnabled(.shareSheetChanges, checking: .buildOnly) { - let copyAction = getCopyAction() - append(to: §ion, action: copyAction) - - let sendToDeviceAction = getSendToDevice() - append(to: §ion, action: sendToDeviceAction) - } + let copyAction = getCopyAction() + append(to: §ion, action: copyAction) - // Feature flag for toolbar share action changes where if the toolbar is showing - // share action button then we do not show the share button in hamburger menu - if !featureFlags.isFeatureEnabled(.shareToolbarChanges, checking: .buildOnly) { - let shareAction = getShareAction() - append(to: §ion, action: shareAction) - } + let sendToDeviceAction = getSendToDevice() + append(to: §ion, action: sendToDeviceAction) + + let shareAction = getShareAction() + append(to: §ion, action: shareAction) } return section diff --git a/firefox-ios/Client/Frontend/Share/ShareExtensionHelper.swift b/firefox-ios/Client/Frontend/Share/ShareExtensionHelper.swift index 71204a99169e..eef5ba45edcc 100644 --- a/firefox-ios/Client/Frontend/Share/ShareExtensionHelper.swift +++ b/firefox-ios/Client/Frontend/Share/ShareExtensionHelper.swift @@ -17,19 +17,8 @@ class ShareExtensionHelper: NSObject, FeatureFlaggable { private let pocketIconExtension = "com.ideashower.ReadItLaterPro.AddToPocketExtension" private let pocketActionExtension = "com.ideashower.ReadItLaterPro.Action-Extension" - var areShareSheetChangesEnabled: Bool { - return featureFlags.isFeatureEnabled(.shareSheetChanges, checking: .buildOnly) && !url.isFileURL - } - - /// Exclude 'Add to Reading List' which currently uses Safari. If share sheet changes are enabled exclude - /// Copy from system to provide custom activity private var excludingActivities: [UIActivity.ActivityType] { - guard areShareSheetChangesEnabled else { - return [UIActivity.ActivityType.addToReadingList] - } - - return [UIActivity.ActivityType.addToReadingList, - UIActivity.ActivityType.copyToPasteboard] + return [UIActivity.ActivityType.addToReadingList] } // Can be a file:// or http(s):// url @@ -50,9 +39,8 @@ class ShareExtensionHelper: NSObject, FeatureFlaggable { if #available(iOS 16.4, *), let webView = webView { activityItems.append(webView) } - let appActivities = getApplicationActivities() let activityViewController = UIActivityViewController(activityItems: activityItems, - applicationActivities: appActivities) + applicationActivities: nil) activityViewController.excludedActivityTypes = excludingActivities @@ -109,21 +97,6 @@ class ShareExtensionHelper: NSObject, FeatureFlaggable { return activityItems } - - private func getApplicationActivities() -> [UIActivity]? { - guard areShareSheetChangesEnabled else { - return nil - } - - var appActivities = [UIActivity]() - let copyLinkActivity = CopyLinkActivity(activityType: .copyLink, url: url) - appActivities.append(copyLinkActivity) - - let sendToDeviceActivity = SendToDeviceActivity(activityType: .sendToDevice, url: url) - appActivities.append(sendToDeviceActivity) - - return appActivities - } } extension ShareExtensionHelper: UIActivityItemSource { diff --git a/firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift b/firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift index 7bd53b0d2c88..26be673347ac 100644 --- a/firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift +++ b/firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift @@ -13,7 +13,6 @@ protocol TabLocationViewDelegate: AnyObject { func tabLocationViewDidTapReload(_ tabLocationView: TabLocationView) func tabLocationViewDidTapShield(_ tabLocationView: TabLocationView) func tabLocationViewDidBeginDragInteraction(_ tabLocationView: TabLocationView) - func tabLocationViewDidTapShare(_ tabLocationView: TabLocationView, button: UIButton) func tabLocationViewPresentCFR(at sourceView: UIView) /// - returns: whether the long-press was handled by the delegate; i.e. return `false` when the conditions @@ -66,19 +65,11 @@ class TabLocationView: UIView, FeatureFlaggable { didSet { hideButtons() updateTextWithURL() - shareButton.isHidden = !(shouldEnableShareButtonFeature && isValidHttpUrlProtocol(url)) setNeedsUpdateConstraints() showTrackingProtectionButton(for: url) } } - var shouldEnableShareButtonFeature: Bool { - guard featureFlags.isFeatureEnabled(.shareToolbarChanges, checking: .buildOnly) else { - return false - } - return true - } - var readerModeState: ReaderModeState { get { return readerModeButton.readerModeState @@ -129,17 +120,6 @@ class TabLocationView: UIView, FeatureFlaggable { trackingProtectionButton.accessibilityLabel = .TabLocationLockButtonAccessibilityLabel } - lazy var shareButton: ShareButton = .build { shareButton in - shareButton.addTarget(self, action: #selector(self.didPressShareButton(_:)), for: .touchUpInside) - shareButton.clipsToBounds = false - shareButton.contentHorizontalAlignment = .center - shareButton.accessibilityIdentifier = AccessibilityIdentifiers.Toolbar.shareButton - shareButton.accessibilityLabel = .TabLocationShareAccessibilityLabel - shareButton.showsLargeContentViewer = true - shareButton.largeContentImage = .templateImageNamed(StandardImageIdentifiers.Large.shareApple) - shareButton.largeContentTitle = .TabLocationShareButtonLargeContentTitle - } - private lazy var shoppingButton: UIButton = .build { button in let image = UIImage(named: StandardImageIdentifiers.Large.shopping) @@ -219,7 +199,6 @@ class TabLocationView: UIView, FeatureFlaggable { urlTextField, shoppingButton, readerModeButton, - shareButton, reloadButton ] contentView = UIStackView(arrangedSubviews: subviews) @@ -236,8 +215,6 @@ class TabLocationView: UIView, FeatureFlaggable { shoppingButton.heightAnchor.constraint(equalToConstant: UX.buttonSize), readerModeButton.widthAnchor.constraint(equalToConstant: UX.buttonSize), readerModeButton.heightAnchor.constraint(equalToConstant: UX.buttonSize), - shareButton.heightAnchor.constraint(equalToConstant: UX.buttonSize), - shareButton.widthAnchor.constraint(equalToConstant: UX.buttonSize), reloadButton.widthAnchor.constraint(equalToConstant: UX.buttonSize), reloadButton.heightAnchor.constraint(equalToConstant: UX.buttonSize), ]) @@ -262,7 +239,6 @@ class TabLocationView: UIView, FeatureFlaggable { urlTextField, shoppingButton, readerModeButton, - shareButton, reloadButton ] @@ -324,11 +300,6 @@ class TabLocationView: UIView, FeatureFlaggable { delegate?.tabLocationViewDidTapShield(self) } - @objc - func didPressShareButton(_ button: UIButton) { - delegate?.tabLocationViewDidTapShare(self, button: shareButton) - } - @objc func didPressShoppingButton(_ button: UIButton) { button.isSelected = true @@ -445,7 +416,7 @@ class TabLocationView: UIView, FeatureFlaggable { // Fixes: https://github.com/mozilla-mobile/firefox-ios/issues/17403 private func hideButtons() { - [shoppingButton, shareButton].forEach { $0.isHidden = true } + [shoppingButton].forEach { $0.isHidden = true } } private func currentTheme() -> Theme { @@ -555,7 +526,6 @@ extension TabLocationView: ThemeApplicable { urlTextField.textColor = theme.colors.textPrimary readerModeButton.applyTheme(theme: theme) trackingProtectionButton.applyTheme(theme: theme) - shareButton.applyTheme(theme: theme) reloadButton.applyTheme(theme: theme) shoppingButton.tintColor = theme.colors.textPrimary shoppingButton.setImage(UIImage(named: StandardImageIdentifiers.Large.shopping)? diff --git a/firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift b/firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift index e9a3a94c3cfd..ce3d05d74c1b 100644 --- a/firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift +++ b/firefox-ios/Client/Nimbus/NimbusFeatureFlagLayer.swift @@ -65,9 +65,6 @@ final class NimbusFeatureFlagLayer { case .reportSiteIssue: return checkGeneralFeature(for: featureID, from: nimbus) - case .shareSheetChanges, - .shareToolbarChanges: - return checkNimbusForShareSheet(for: featureID, from: nimbus) case .splashScreen: return checkSplashScreenFeature(for: featureID, from: nimbus) case .tabTrayRefactor: @@ -179,18 +176,6 @@ final class NimbusFeatureFlagLayer { } } - public func checkNimbusForShareSheet( - for featureID: NimbusFeatureFlagID, - from nimbus: FxNimbus) -> Bool { - let config = nimbus.features.shareSheet.value() - - switch featureID { - case .shareSheetChanges: return config.moveActions - case .shareToolbarChanges: return config.toolbarChanges - default: return false - } - } - private func checkSplashScreenFeature( for featureID: NimbusFeatureFlagID, from nimbus: FxNimbus diff --git a/firefox-ios/nimbus-features/shareSheetFeature.yaml b/firefox-ios/nimbus-features/shareSheetFeature.yaml deleted file mode 100644 index a5cb7713bbff..000000000000 --- a/firefox-ios/nimbus-features/shareSheetFeature.yaml +++ /dev/null @@ -1,23 +0,0 @@ -features: - share-sheet: - description: This feature define the redesign of the share sheet - variables: - move-actions: - description: If true copy and send to device are moved to share sheet - type: Boolean - default: false - toolbar-changes: - description: If true share option is shown on the toolbar - type: Boolean - default: false - defaults: - - channel: developer - value: { - "move-actions": false, - "toolbar-changes": false - } - - channel: beta - value: { - "move-actions": false, - "toolbar-changes": false - } diff --git a/firefox-ios/nimbus.fml.yaml b/firefox-ios/nimbus.fml.yaml index 794085ba7d27..18395504c29a 100644 --- a/firefox-ios/nimbus.fml.yaml +++ b/firefox-ios/nimbus.fml.yaml @@ -27,9 +27,8 @@ include: - nimbus-features/onboardingFrameworkFeature.yaml - nimbus-features/reduxSearchSettingsFeature.yaml - nimbus-features/searchFeature.yaml - - nimbus-features/shareSheetFeature.yaml + - nimbus-features/splashScreenFeature.yaml - nimbus-features/spotlightSearchFeature.yaml - nimbus-features/tabTrayFeature.yaml - nimbus-features/tabTrayRefactorFeature.yaml - nimbus-features/zoomFeature.yaml - - nimbus-features/splashScreenFeature.yaml