Skip to content

Commit

Permalink
text zoom improvements (#3509)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/392891325557410/1206268893832417/f
Tech Design URL:
CC:

**Description**:
Makes it easier to access text zoom and allows per page state.

**Steps to test this PR**:
See test scenarios in Ship Review:
https://app.asana.com/0/0/1208685664909495/f

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**Definition of Done (Internal Only)**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

**Copy Testing**:

* [ ] Use of correct apostrophes in new copy, ie `’` rather than `'`

**Orientation Testing**:

* [ ] Portrait
* [ ] Landscape

**Device Testing**:

* [ ] iPhone SE (1st Gen)
* [ ] iPhone 8
* [ ] iPhone X
* [ ] iPhone 14 Pro
* [ ] iPad

**OS Testing**:

* [ ] iOS 15
* [ ] iOS 16
* [ ] iOS 17

**Theme Testing**:

* [ ] Light theme
* [ ] Dark theme

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
  • Loading branch information
brindy authored Nov 14, 2024
1 parent 3feecaf commit c404177
Show file tree
Hide file tree
Showing 47 changed files with 1,092 additions and 785 deletions.
3 changes: 3 additions & 0 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 Down Expand Up @@ -111,6 +112,8 @@ extension FeatureFlag: FeatureFlagDescribing {
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 Down
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
21 changes: 15 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 @@ -220,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 @@ -748,7 +751,7 @@ extension Pixel {
case settingsRecentlyVisitedOff
case settingsAddressBarSelectorPressed
case settingsAccessibilityOpen
case settingsAccessiblityTextSize
case settingsAccessiblityTextZoom

// Web pixels
case privacyProOfferMonthlyPriceClick
Expand Down Expand Up @@ -927,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 @@ -1063,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 @@ -1590,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 c404177

Please sign in to comment.