From ec5f63a42b263bfdeba0eeec8a4d42af9f01c790 Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Thu, 26 Oct 2023 01:41:54 +0600 Subject: [PATCH 1/2] Fix invisible Find Previous & Find Next buttons Move the corresponding icon assets to the DesginSystem module so that they can be found at runtime. Fixes #3699 --- focus-ios/Blockzilla/Utilities/FindInPageBar.swift | 4 ++-- .../Assets.xcassets/FindInPage}/Contents.json | 0 .../FindInPage}/find_next.imageset/Contents.json | 0 .../FindInPage}/find_next.imageset/Find Next.pdf | Bin .../FindInPage}/find_next.imageset/find_next.pdf | Bin .../find_previous.imageset/Contents.json | 0 .../find_previous.imageset/Find Previous.pdf | Bin .../find_previous.imageset/find_previous.pdf | Bin .../Sources/DesignSystem/UIImage+AppImages.swift | 4 ++++ 9 files changed, 6 insertions(+), 2 deletions(-) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/Contents.json (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/Contents.json (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/Find Next.pdf (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_next.imageset/find_next.pdf (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/Contents.json (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/Find Previous.pdf (100%) rename focus-ios/{Blockzilla/Assets.xcassets/Find In Page => BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage}/find_previous.imageset/find_previous.pdf (100%) diff --git a/focus-ios/Blockzilla/Utilities/FindInPageBar.swift b/focus-ios/Blockzilla/Utilities/FindInPageBar.swift index b5f96149e7..f1be25c00d 100644 --- a/focus-ios/Blockzilla/Utilities/FindInPageBar.swift +++ b/focus-ios/Blockzilla/Utilities/FindInPageBar.swift @@ -77,14 +77,14 @@ class FindInPageBar: UIView { matchCountView.accessibilityIdentifier = "FindInPage.matchCount" addSubview(matchCountView) - previousButton.setImage(UIImage(named: "find_previous"), for: []) + previousButton.setImage(.findPrevious, for: []) previousButton.setTitleColor(.white, for: []) previousButton.accessibilityLabel = UIConstants.strings.findInPagePreviousLabel previousButton.addTarget(self, action: #selector(didFindPrevious), for: .touchUpInside) previousButton.accessibilityIdentifier = "FindInPage.find_previous" addSubview(previousButton) - nextButton.setImage(UIImage(named: "find_next"), for: []) + nextButton.setImage(.findNext, for: []) nextButton.setTitleColor(.white, for: []) nextButton.accessibilityLabel = UIConstants.strings.findInPageNextLabel nextButton.addTarget(self, action: #selector(didFindNext), for: .touchUpInside) diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/Contents.json b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/Contents.json similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/Contents.json rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/Contents.json diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Contents.json b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Contents.json similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Contents.json rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Contents.json diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Find Next.pdf b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Find Next.pdf similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/Find Next.pdf rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/Find Next.pdf diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/find_next.pdf b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/find_next.pdf similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_next.imageset/find_next.pdf rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_next.imageset/find_next.pdf diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Contents.json b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Contents.json similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Contents.json rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Contents.json diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Find Previous.pdf b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Find Previous.pdf similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/Find Previous.pdf rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/Find Previous.pdf diff --git a/focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/find_previous.pdf b/focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/find_previous.pdf similarity index 100% rename from focus-ios/Blockzilla/Assets.xcassets/Find In Page/find_previous.imageset/find_previous.pdf rename to focus-ios/BlockzillaPackage/Sources/DesignSystem/Assets.xcassets/FindInPage/find_previous.imageset/find_previous.pdf diff --git a/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift b/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift index 15aea7c41f..26447e93e1 100644 --- a/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift +++ b/focus-ios/BlockzillaPackage/Sources/DesignSystem/UIImage+AppImages.swift @@ -46,4 +46,8 @@ public extension UIImage { static let delete = UIImage(named: "icon_delete")! static let hamburgerMenu = UIImage(named: "icon_hamburger_menu")! static let stopMenu = UIImage(named: "icon_stop_menu")! + + // MARK: Find In Page + static let findPrevious = UIImage(named: "find_previous")! + static let findNext = UIImage(named: "find_next")! } From aac944d896ce5a221f5d3f4a8e5d3ce936d8efec Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Thu, 26 Oct 2023 01:48:19 +0600 Subject: [PATCH 2/2] Make Find Previous / Find Next buttons initially disabled When the user hasn't entered any text, the previous/next buttons were not made disabled, which could be a little bit misleading and was not consistent with the case where there are no search results. --- focus-ios/Blockzilla/Utilities/FindInPageBar.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/focus-ios/Blockzilla/Utilities/FindInPageBar.swift b/focus-ios/Blockzilla/Utilities/FindInPageBar.swift index f1be25c00d..c1987af6d2 100644 --- a/focus-ios/Blockzilla/Utilities/FindInPageBar.swift +++ b/focus-ios/Blockzilla/Utilities/FindInPageBar.swift @@ -82,6 +82,7 @@ class FindInPageBar: UIView { previousButton.accessibilityLabel = UIConstants.strings.findInPagePreviousLabel previousButton.addTarget(self, action: #selector(didFindPrevious), for: .touchUpInside) previousButton.accessibilityIdentifier = "FindInPage.find_previous" + previousButton.isEnabled = false addSubview(previousButton) nextButton.setImage(.findNext, for: []) @@ -89,6 +90,7 @@ class FindInPageBar: UIView { nextButton.accessibilityLabel = UIConstants.strings.findInPageNextLabel nextButton.addTarget(self, action: #selector(didFindNext), for: .touchUpInside) nextButton.accessibilityIdentifier = "FindInPage.find_next" + nextButton.isEnabled = false addSubview(nextButton) let closeButton = UIButton()