Skip to content

Commit

Permalink
Merge branch 'main' into sam/use-lazyview-for-subscription-child-views
Browse files Browse the repository at this point in the history
* main:
  text zoom improvements (#3509)
  Add support for local overrides for feature flags (#3571)
  pixels for bookmarks > favorites tab (#3572)
  • Loading branch information
samsymons committed Nov 14, 2024
2 parents f534ce5 + c404177 commit e624cf4
Show file tree
Hide file tree
Showing 51 changed files with 1,130 additions and 793 deletions.
11 changes: 9 additions & 2 deletions Core/FeatureFlag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public enum FeatureFlag: String {
case onboardingAddToDock
case autofillSurveys
case autcompleteTabs
case textZoom
case adAttributionReporting

/// https://app.asana.com/0/72649045549333/1208231259093710/f
Expand All @@ -54,7 +55,11 @@ public enum FeatureFlag: String {
case networkProtectionEnforceRoutes
}

extension FeatureFlag: FeatureFlagSourceProviding {
extension FeatureFlag: FeatureFlagDescribing {
public var supportsLocalOverriding: Bool {
false
}

public var source: FeatureFlagSource {
switch self {
case .debugMenu:
Expand Down Expand Up @@ -107,6 +112,8 @@ extension FeatureFlag: FeatureFlagSourceProviding {
return .remoteReleasable(.feature(.autocompleteTabs))
case .networkProtectionUserTips:
return .remoteReleasable(.subfeature(NetworkProtectionSubfeature.userTips))
case .textZoom:
return .remoteReleasable(.feature(.textZoom))
case .networkProtectionEnforceRoutes:
return .remoteDevelopment(.subfeature(NetworkProtectionSubfeature.enforceRoutes))
case .adAttributionReporting:
Expand All @@ -117,6 +124,6 @@ extension FeatureFlag: FeatureFlagSourceProviding {

extension FeatureFlagger {
public func isFeatureOn(_ featureFlag: FeatureFlag) -> Bool {
return isFeatureOn(forProvider: featureFlag)
return isFeatureOn(for: featureFlag)
}
}
5 changes: 3 additions & 2 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ public struct PixelParameters {
public static let count = "count"
public static let source = "source"

public static let textSizeInitial = "text_size_initial"
public static let textSizeUpdated = "text_size_updated"
// Text size is the legacy name
public static let textZoomInitial = "text_size_initial"
public static let textZoomUpdated = "text_size_updated"

public static let canAutoPreviewMIMEType = "can_auto_preview_mime_type"
public static let mimeType = "mime_type"
Expand Down
27 changes: 21 additions & 6 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ extension Pixel {
case browsingMenuCopy
case browsingMenuPrint
case browsingMenuFindInPage
case browsingMenuZoom
case browsingMenuDisableProtection
case browsingMenuEnableProtection
case browsingMenuReportBrokenSite
Expand Down Expand Up @@ -207,6 +208,9 @@ extension Pixel {
case bookmarkAddFavoriteBySwipe
case bookmarkDeletedFromBookmark

case bookmarksUIFavoritesAction
case bookmarksUIFavoritesManage

case bookmarkImportSuccess
case bookmarkImportFailure
case bookmarkImportFailureParsingDL
Expand All @@ -217,8 +221,10 @@ extension Pixel {
case bookmarkExportSuccess
case bookmarkExportFailure

case textSizeSettingsChanged

case textZoomSettingsChanged
case textZoomChangedOnPage
case textZoomChangedOnPageDaily

case downloadStarted
case downloadStartedDueToUnhandledMIMEType
case downloadTriedToPresentPreviewWithoutTab
Expand Down Expand Up @@ -745,7 +751,7 @@ extension Pixel {
case settingsRecentlyVisitedOff
case settingsAddressBarSelectorPressed
case settingsAccessibilityOpen
case settingsAccessiblityTextSize
case settingsAccessiblityTextZoom

// Web pixels
case privacyProOfferMonthlyPriceClick
Expand Down Expand Up @@ -924,6 +930,7 @@ extension Pixel.Event {
case .browsingMenuCopy: return "mb_cp"
case .browsingMenuPrint: return "mb_pr"
case .browsingMenuFindInPage: return "mb_fp"
case .browsingMenuZoom: return "m_menu_page_zoom_taps"
case .browsingMenuDisableProtection: return "mb_wla"
case .browsingMenuEnableProtection: return "mb_wlr"
case .browsingMenuReportBrokenSite: return "mb_rb"
Expand Down Expand Up @@ -968,6 +975,9 @@ extension Pixel.Event {
case .bookmarkAddFavoriteBySwipe: return "m_add_favorite_by_swipe"
case .bookmarkDeletedFromBookmark: return "m_bookmark_deleted_from_bookmark"

case .bookmarksUIFavoritesAction: return "m_bookmarks_ui_favorites_action_daily"
case .bookmarksUIFavoritesManage: return "m_bookmarks_ui_favorites_manage_daily"

case .homeScreenShown: return "mh"
case .homeScreenEditFavorite: return "mh_ef"
case .homeScreenDeleteFavorite: return "mh_df"
Expand Down Expand Up @@ -1057,8 +1067,11 @@ extension Pixel.Event {
case .bookmarkExportSuccess: return "m_be_a"
case .bookmarkExportFailure: return "m_be_e"

case .textSizeSettingsChanged: return "m_text_size_settings_changed"

// Text size is the legacy name
case .textZoomSettingsChanged: return "m_text_size_settings_changed"
case .textZoomChangedOnPageDaily: return "m_menu_page_zoom_changed_daily"
case .textZoomChangedOnPage: return "m_menu_page_zoom_changed"

case .downloadStarted: return "m_download_started"
case .downloadStartedDueToUnhandledMIMEType: return "m_download_started_due_to_unhandled_mime_type"
case .downloadTriedToPresentPreviewWithoutTab: return "m_download_tried_to_present_preview_without_tab"
Expand Down Expand Up @@ -1584,7 +1597,9 @@ extension Pixel.Event {
case .settingsRecentlyVisitedOff: return "m_settings_autocomplete_recently-visited_off"
case .settingsAddressBarSelectorPressed: return "m_settings_address_bar_selector_pressed"
case .settingsAccessibilityOpen: return "m_settings_accessibility_open"
case .settingsAccessiblityTextSize: return "m_settings_accessiblity_text_size"

// legacy name is text size
case .settingsAccessiblityTextZoom: return "m_settings_accessiblity_text_size"

// Web
case .privacyProOfferMonthlyPriceClick: return "m_privacy-pro_offer_monthly-price_click"
Expand Down
58 changes: 0 additions & 58 deletions Core/TextSizeUserScript.swift

This file was deleted.

7 changes: 6 additions & 1 deletion Core/UserDefaultsPropertyWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public struct UserDefaultsWrapper<T> {
case downloadedSurrogatesCount = "com.duckduckgo.app.downloadedSurrogatesCount"
case downloadedTrackerDataSetCount = "com.duckduckgo.app.downloadedTrackerDataSetCount"
case downloadedPrivacyConfigurationCount = "com.duckduckgo.app.downloadedPrivacyConfigurationCount"
case textSize = "com.duckduckgo.ios.textSize"

// Text size is the legacy name and this key is still in use
case textZoom = "com.duckduckgo.ios.textSize"

case emailWaitlistShouldReceiveNotifications = "com.duckduckgo.ios.showWaitlistNotification"
case unseenDownloadsAvailable = "com.duckduckgo.app.unseenDownloadsAvailable"
Expand Down Expand Up @@ -179,6 +181,9 @@ public struct UserDefaultsWrapper<T> {
case duckPlayerPixelExperimentLastVideoIDRendered = "com.duckduckgo.ios.duckplayer.pixel.experiment.last.videoID.rendered.v2"
case duckPlayerPixelExperimentOverride = "com.duckduckgo.ios.duckplayer.pixel.experiment.override.v2"

// Domain specific text zoom
case domainTextZoomStorage = "com.duckduckgo.ios.domainTextZoomStorage"

// TipKit
case resetTipKitOnNextLaunch = "com.duckduckgo.ios.tipKit.resetOnNextLaunch"
}
Expand Down
154 changes: 0 additions & 154 deletions Core/textsize.js

This file was deleted.

Loading

0 comments on commit e624cf4

Please sign in to comment.