Repository navigation
Conversation
Eighteen files used `UIView`, `UIColor` and `String` extensions that the Zendesk SDK declares publicly: the `safe…Anchor` properties, the `constrain…` methods, `UIColor.colorFromHex` and `String.isEqual(to:)`. None of these files import Zendesk. They compiled because other files in the app module do, so they would stop compiling once the SDK is removed. Each use is replaced with the UIKit equivalent, matching what the SDK's helper does. The action sheet's button badge used two of the helpers and no caller ever set it, so the badge is removed.
Collaborator
Generated by 🚫 Danger |
10 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
UIView,UIColorandStringhelpers that 18 files were getting from the Zendesk SDK without importing it. Nothing changes on screen. Extracted from #26434, which removes the SDK.Summary
UIView,UIColorandString, so any file in the app can call them without an import. These 18 files do, and would stop compiling once the SDK is removed.Changes
safeLeadingAnchor,safeTrailingAnchor,safeTopAnchor,safeBottomAnchor,safeRightAnchorsafeAreaLayoutGuideconstrainToSuperViewEdges()pinSubviewToAllEdges(_:)constrain(size:)constrain(attribute:toView:relatedBy:constant:)leadingAnchor.constraint(greaterThanOrEqualTo:)UIColor.colorFromHex("F6F7F7")UIColor(fromHex: 0xF6F7F7)String.isEqual(to:)==The three
constrain…helpers also settranslatesAutoresizingMaskIntoConstraints = false. The view at each of those call sites already sets it.Test plan
Simulator checks ran on an iPhone 18 Pro, iOS 27.2, with Debug builds.
trunkbuild and this branch produce byte-identical output. With one replacement broken on purpose, the output differed. The hook covers 11 of the 18 files, listed below.safe…Anchorhelper returns the matchingsafeAreaLayoutGuideanchor (probe output below), so that swap is the same expression. It is the only change in six view controllers that need a site to create. Two of those were also opened in Jetpack with a WordPress.com account: My Site's empty state and the Notifications filter header render correctly.#F6F7F7, the value in the code.git grepfinds none of the helper names in the repo.trunktoo (cannot find type 'PostHelper' in scope), and CI skips it for that reason. Pre-existing.Executed 50 tests, with 0 failuresandTest run with 8 tests in 1 suite passed. The suites are listed below.What the hook covers, and the six files it doesn't
Compared by the hook:
DashboardPageCreationCell, expanded and compactReferrerDetailsCell,ReferrerDetailsHeaderCellandReferrerDetailsSpamActionCellGutenGhostViewJetpackOverlayViewNoticeAnimatorActionSheetViewControllerwith three buttonsDomainCreditRedemptionSuccessViewControllerGutenbergSuggestionsViewControllerSplashPrologueStyleGuideString.isEqual(to:)against==for five pairs of strings, which is the change inBooleanUserDefaultsDebugViewModelNot built by the hook, because each needs a site:
MySiteViewController,NotificationsViewController,GutenbergViewController,PreviewWebKitViewController,SiteStatsInsightsDetailsTableViewControllerandBloggingRemindersFlowSettingsViewController. Their only change is thesafe…Anchorswap.Unit test suites run, all in
WordPressTest:BooleanUserDefaultsDebugViewModelTests,NotificationsViewControllerTests,PreviewWebKitViewControllerTests,ReferrerDetailsViewModelTests,SiteStatsInsightsDetailsViewModelTestsandNoticePresenterLayoutTests.What each helper does, printed by a probe linked against
CommonUISDK9.0.2tAMICistranslatesAutoresizingMaskIntoConstraints.equalsOurscompares againstUIColor(red:green:blue:alpha:)built from the same hex value, which is whatUIColor(fromHex:)does.