Skip to content

Commit

Permalink
Code review feedback changes
Browse files Browse the repository at this point in the history
String updates, formatting, removing unused extensions and UI Test plan configurations updates
  • Loading branch information
mazevedofs committed Dec 4, 2023
1 parent 4aa4e2a commit 70a35b7
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ class WKFindAndReplaceView: WKComponentView {

replaceTextField.adjustsFontForContentSizeCategory = true
replaceTextField.font = WKFont.for(.caption1, compatibleWith: appEnvironment.traitCollection)
replaceTextField.accessibilityLabel = WKSourceEditorLocalizedStrings.current.accessibilityLabelReplaceTextField
replaceTypeLabel.text = WKSourceEditorLocalizedStrings.current.findReplaceTypeSingle
replaceTypeLabel.isAccessibilityElement = false
replaceTypeLabel.isAccessibilityElement = false

currentMatchLabel.adjustsFontForContentSizeCategory = true
currentMatchLabel.font = WKFont.for(.caption1, compatibleWith: appEnvironment.traitCollection)
Expand All @@ -77,7 +78,8 @@ class WKFindAndReplaceView: WKComponentView {

replacePlaceholderLabel.adjustsFontForContentSizeCategory = true
replacePlaceholderLabel.font = WKFont.for(.caption1, compatibleWith: appEnvironment.traitCollection)
replacePlaceholderLabel.text = "Replace with..." // TODO
replacePlaceholderLabel.text = WKSourceEditorLocalizedStrings.current.findReplaceWith
replacePlaceholderLabel.isAccessibilityElement = false

updateColors()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class WKEditorToolbarHighlightView: WKEditorToolbarView {
formatHeadingButton.setImage(WKIcon.formatHeading, for: .normal)
formatHeadingButton.addTarget(self, action: #selector(tappedFormatHeading), for: .touchUpInside)
formatHeadingButton.accessibilityIdentifier = WKSourceEditorAccessibilityIdentifiers.current?.formatHeadingButton
formatHeadingButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonFormatHeading
formatHeadingButton.accessibilityLabel = WKSourceEditorLocalizedStrings.current?.accessibilityLabelButtonFormatHeading

citationButton.setImage(WKIcon.citation, for: .normal)
citationButton.addTarget(self, action: #selector(tappedCitation), for: .touchUpInside)
Expand Down
8 changes: 4 additions & 4 deletions Test Plans/UITests.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"configurations" : [
{
"id" : "8E0498FE-92FF-40EC-865C-5BEA22044FC7",
"name" : "Default (Light)",
"name" : "System Language (Light)",
"options" : {
"commandLineArgumentEntries" : [
{
Expand All @@ -13,7 +13,7 @@
},
{
"id" : "67D2A1C7-F722-404E-8F8B-9EE88B448393",
"name" : "RTL (Sepia)",
"name" : "Hebrew (Sepia)",
"options" : {
"commandLineArgumentEntries" : [
{
Expand All @@ -25,7 +25,7 @@
},
{
"id" : "9B0F186E-C17A-428A-8752-69A009336688",
"name" : "Double Lenght (Dark)",
"name" : "German (Dark)",
"options" : {
"commandLineArgumentEntries" : [
{
Expand All @@ -37,7 +37,7 @@
},
{
"id" : "D9266DCB-72A3-4FA1-81DC-AB33158D08AF",
"name" : "Accented (Black)",
"name" : "Vietnamese (Black)",
"options" : {
"commandLineArgumentEntries" : [
{
Expand Down
8 changes: 4 additions & 4 deletions WMF Framework/CommonStrings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,14 @@ public class CommonStrings: NSObject {
public static let textFormatting = WMFLocalizedString("source-editor-text-formatting", value: "Text Formatting", comment: "Label for text formatting section on the page editor")
public static let style = WMFLocalizedString("source-editor-style", value: "Style", comment: "Label for style formatting section on the page editor ")
public static let clearFormatting = WMFLocalizedString("source-editor-clear-formatting", value: "Clear formatting", comment: "Label for clear formatting on the page editor")
public static let paragraph = WMFLocalizedString("source-editor-paragraph", value: "Paragraph", comment: "Label for paragraph formatting section on the page editor")
public static let paragraph = WMFLocalizedString("source-editor-paragraph", value: "Paragraph", comment: "Label for paragraph formatting button on the page editor")
public static let heading = WMFLocalizedString("source-editor-heading", value: "Heading", comment: "Label for heading formatting button on section editor")
public static let subheading1 = WMFLocalizedString("source-editor-subheading1", value: "Subheading 1", comment: "Label for subheading 1 formatting button on the page editor")
public static let subheading2 = WMFLocalizedString("source-editor-subheading2", value: "Subheading 2", comment: "Label for subheading 2 formatting button on the page editor")
public static let subheading3 = WMFLocalizedString("source-editor-subheading3", value: "Subheading 3", comment: "Label for subheading 3 formatting button on the page editor")
public static let subheading4 = WMFLocalizedString("source-editor-subheading3", value: "Subheading 4", comment: "Label for subheading 4 formatting button on the page editor")
public static let subheading4 = WMFLocalizedString("source-editor-subheading4", value: "Subheading 4", comment: "Label for subheading 4 formatting button on the page editor")
public static let findAndReplaceSingle = WMFLocalizedString("source-editor-find-replace-single", value: "Replace", comment: "Label for replace single string button on page editor")
public static let findAndReplaceAll = WMFLocalizedString("source-editor-find-replace-all", value: "Replace all", comment: "Label for replace all ocurrences of a string on the peage editor")
public static let findAndReplaceAll = WMFLocalizedString("source-editor-find-replace-all", value: "Replace all", comment: "Label for replace all ocurrences of a string on the page editor")
public static let replaceWith = WMFLocalizedString("source-editor-find-replace-with", value: "Replace with...", comment: "Lable for replace with string button on page editor")
public static let accessibilityLabelButtonFormatText = WMFLocalizedString("source-editor-accessibility-label-format-text", value: "Show text formatting menu", comment: "Accessibility label for text formatting menu button on the page editor")
public static let accessibilityLabelButtonFormatHeading = WMFLocalizedString("source-editor-accessibility-label-format-heading", value: "Show text style menu", comment: "Accessibility label for heading style formatting menu button on the page editor")
Expand All @@ -559,7 +559,7 @@ public class CommonStrings: NSObject {
public static let accessibilityLabelButtonItalics = WMFLocalizedString("source-editor-accessibility-label-italics", value: "Add italic formatting", comment: "Accessibility label for the italics button on the page editor")
public static let accessibilityLabelButtonItalicsSelected = WMFLocalizedString("source-editor-accessibility-label-italics-selected", value: "Remove italic formatting", comment: "Accessibility label for the selected italics button on the page editor")
public static let accessibilityLabelButtonClearFormatting = WMFLocalizedString("source-editor-accessibility-label-clear-formatting", value: "Clear formatting", comment: "Accessibility label for the clear formatting button on the page editor")
public static let accessibilityLabelButtonShowMore = WMFLocalizedString("source-editor-accessibility-label-format-text", value: "Show text formatting menu", comment: "Accessibility label for the show more button on the page editor")
public static let accessibilityLabelButtonShowMore = WMFLocalizedString("source-editor-accessibility-label-format-text-show-more", value: "Show text formatting menu", comment: "Accessibility label for the show more button on the page editor")
public static let accessibilityLabelButtonComment = WMFLocalizedString("source-editor-accessibility-label-comment", value: "Add comment syntax", comment: "Accessibility label for the add comment button on the page editor")
public static let accessibilityLabelButtonCommentSelected = WMFLocalizedString("source-editor-accessibility-label-comment-selected", value: "Remove comment syntax", comment: "Accessibility label for the selected comment button on the page editor")
public static let accessibilityLabelButtonSuperscript = WMFLocalizedString("source-editor-accessibility-label-superscript", value: "Add superscript formatting", comment: "Accessibility label for the superscript button on the page editor")
Expand Down
2 changes: 1 addition & 1 deletion WMF Framework/NavigationBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
public class NavigationBar: SetupView, FakeProgressReceiving, FakeProgressDelegate {
fileprivate let statusBarUnderlay: UIView = UIView()
fileprivate let titleBar: UIToolbar = UIToolbar()
public let bar: UINavigationBar = UINavigationBar()
fileprivate let bar: UINavigationBar = UINavigationBar()
fileprivate let underBarView: UIView = UIView() // this is always visible below the navigation bar
fileprivate let extendedView: UIView = UIView()
fileprivate let shadow: UIView = UIView()
Expand Down
16 changes: 8 additions & 8 deletions Wikipedia.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1480,9 +1480,9 @@
83836ED11F615E5B007D1A05 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83836ECB1F615E5B007D1A05 /* ShareViewController.xib */; };
83836ED21F615E5B007D1A05 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83836ECB1F615E5B007D1A05 /* ShareViewController.xib */; };
83836ED31F615E5B007D1A05 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83836ECB1F615E5B007D1A05 /* ShareViewController.xib */; };
83842A892B0CFF8200EFC55F /* UITestHelperContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperContainerViewController.swift */; };
83842A8A2B0CFF8200EFC55F /* UITestHelperContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperContainerViewController.swift */; };
83842A8B2B0CFF8300EFC55F /* UITestHelperContainerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperContainerViewController.swift */; };
83842A892B0CFF8200EFC55F /* UITestHelperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperViewController.swift */; };
83842A8A2B0CFF8200EFC55F /* UITestHelperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperViewController.swift */; };
83842A8B2B0CFF8300EFC55F /* UITestHelperViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83842A872B07A22300EFC55F /* UITestHelperViewController.swift */; };
8386BDE723857F87007EE89D /* URLParsingAndRoutingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8386BDE623857F87007EE89D /* URLParsingAndRoutingTests.swift */; };
8386BDED2386C269007EE89D /* WikipediaURLTranslations.swift in Sources */ = {isa = PBXBuildFile; fileRef = B08423DD2384E2C7005E93A0 /* WikipediaURLTranslations.swift */; };
8386BDF12386D3E1007EE89D /* RequestError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8386BDF02386D3E1007EE89D /* RequestError.swift */; };
Expand Down Expand Up @@ -3821,7 +3821,7 @@
8383446B1F62EBD000BD5A37 /* UIView+Constraints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = "<group>"; };
83836ECA1F615E5B007D1A05 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
83836ECB1F615E5B007D1A05 /* ShareViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShareViewController.xib; sourceTree = "<group>"; };
83842A872B07A22300EFC55F /* UITestHelperContainerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestHelperContainerViewController.swift; sourceTree = "<group>"; };
83842A872B07A22300EFC55F /* UITestHelperViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestHelperViewController.swift; sourceTree = "<group>"; };
8386BDE623857F87007EE89D /* URLParsingAndRoutingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLParsingAndRoutingTests.swift; sourceTree = "<group>"; };
8386BDEE2386CAAB007EE89D /* ViewController+URLHandling.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewController+URLHandling.swift"; sourceTree = "<group>"; };
8386BDF02386D3E1007EE89D /* RequestError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RequestError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -6362,7 +6362,7 @@
isa = PBXGroup;
children = (
67623E102AFD2897007488C7 /* WKSourceEditorUITests.swift */,
83842A872B07A22300EFC55F /* UITestHelperContainerViewController.swift */,
83842A872B07A22300EFC55F /* UITestHelperViewController.swift */,
);
path = WikipediaUITests;
sourceTree = "<group>";
Expand Down Expand Up @@ -10568,7 +10568,7 @@
FFE891462445150B0058B642 /* AppTabBarDelegate.swift in Sources */,
B069FA2E1CEACB8400083D59 /* WeakScriptMessageDelegate.swift in Sources */,
0042812D25E6E841004945B3 /* NYTPhotoCaptionView.m in Sources */,
83842A892B0CFF8200EFC55F /* UITestHelperContainerViewController.swift in Sources */,
83842A892B0CFF8200EFC55F /* UITestHelperViewController.swift in Sources */,
67985A542523D80000EBF353 /* ArticleAsLivingDocController.swift in Sources */,
7A35CB871FD82B6300AAF3B7 /* ReadingListDetailViewController.swift in Sources */,
7A9A611E21124D0F00403154 /* CreateNewReadingListButtonView.swift in Sources */,
Expand Down Expand Up @@ -11536,7 +11536,7 @@
7A82898D21B34B86005D7EC1 /* TextFormattingCustomViewTableViewCell.swift in Sources */,
67E8B07B226A57DE00537BC9 /* AccountViewController.swift in Sources */,
7A32078921E40193009E1677 /* SectionEditorMenuItemsController.swift in Sources */,
83842A8B2B0CFF8300EFC55F /* UITestHelperContainerViewController.swift in Sources */,
83842A8B2B0CFF8300EFC55F /* UITestHelperViewController.swift in Sources */,
6707C033237DBCEE0017E7B6 /* DiffRevisionTransition.swift in Sources */,
8382F8D420D928BF00AE5250 /* ColumnarCollectionViewControllerLayoutCache.swift in Sources */,
67985A562523D80000EBF353 /* ArticleAsLivingDocController.swift in Sources */,
Expand Down Expand Up @@ -12125,7 +12125,7 @@
67E8B07C226A57DE00537BC9 /* AccountViewController.swift in Sources */,
7A32078A21E40193009E1677 /* SectionEditorMenuItemsController.swift in Sources */,
6707C034237DBCEE0017E7B6 /* DiffRevisionTransition.swift in Sources */,
83842A8A2B0CFF8200EFC55F /* UITestHelperContainerViewController.swift in Sources */,
83842A8A2B0CFF8200EFC55F /* UITestHelperViewController.swift in Sources */,
8382F8D520D928BF00AE5250 /* ColumnarCollectionViewControllerLayoutCache.swift in Sources */,
D8EC3E7D1E9BDA35006712EB /* UIViewController+WMFChildViewController.swift in Sources */,
832A7A5D23EA138C00D0A750 /* ArticleViewController+References.swift in Sources */,
Expand Down
19 changes: 0 additions & 19 deletions Wikipedia/Code/ExploreViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class ExploreViewController: ColumnarCollectionViewController, ExploreCardViewCo
isRefreshControlEnabled = true
collectionView.refreshControl?.layer.zPosition = 0

self.navigationBar.bar.accessibilityIdentifier = "WikipediaUITests"

title = CommonStrings.exploreTabTitle

NotificationCenter.default.addObserver(self, selector: #selector(exploreFeedPreferencesDidSave(_:)), name: NSNotification.Name.WMFExploreFeedPreferencesDidSave, object: nil)
Expand Down Expand Up @@ -137,7 +135,6 @@ class ExploreViewController: ColumnarCollectionViewController, ExploreCardViewCo

let settingsBarButtonItem = UIBarButtonItem(image: BarButtonImageStyle.settingsButtonImage(theme: theme), style: .plain, target: self, action: #selector(userDidTapSettings))
settingsBarButtonItem.accessibilityLabel = CommonStrings.settingsTitle
settingsBarButtonItem.accessibilityIdentifier = "Source Editor Entry Button"
navigationItem.rightBarButtonItem = settingsBarButtonItem
navigationBar.updateNavigationItems()
}
Expand Down Expand Up @@ -602,15 +599,7 @@ class ExploreViewController: ColumnarCollectionViewController, ExploreCardViewCo
updateSettingsButton()

searchBar.apply(theme: theme)
#if DEBUG
searchBarContainerView.backgroundColor = UIColor.blue
#elseif TEST
searchBarContainerView.backgroundColor = UIColor.red
#elseif UITEST
searchBarContainerView.backgroundColor = UIColor.green
#else
searchBarContainerView.backgroundColor = theme.colors.paperBackground
#endif
collectionView.backgroundColor = .clear
view.backgroundColor = theme.colors.paperBackground
for cell in collectionView.visibleCells {
Expand Down Expand Up @@ -1098,11 +1087,3 @@ extension ExploreViewController {
}

}

extension ExploreViewController: WKSourceEditorViewControllerDelegate {
func sourceEditorViewControllerDidTapFind(sourceEditorViewController: Components.WKSourceEditorViewController) {

}


}
14 changes: 0 additions & 14 deletions Wikipedia/Code/WMFSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,6 @@ - (void)configureBarButtonItems {
[self.navigationBar updateNavigationItems];
}

- (void)uiTestGoToPageEditor {

UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"My Alert"
message:@"This is an alert."
preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {}];

[alert addAction:defaultAction];
[self presentViewController:alert animated:YES completion:nil];

}

- (void)closeButtonPressed {
[[WMFNavigationEventsFunnel shared] logTappedSettingsCloseButton];
[self dismissViewControllerAnimated:YES completion:nil];
Expand Down
1 change: 1 addition & 0 deletions Wikipedia/Localizations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,7 @@
"source-editor-accessibility-label-find-text-field" = "Find";
"source-editor-accessibility-label-format-heading" = "Show text style menu";
"source-editor-accessibility-label-format-text" = "Show text formatting menu";
"source-editor-accessibility-label-format-text-show-more" = "Show text formatting menu";
"source-editor-accessibility-label-indent-decrease" = "Decrease indent depth";
"source-editor-accessibility-label-indent-increase" = "Increase indent depth";
"source-editor-accessibility-label-italics" = "Add italic formatting";
Expand Down
Loading

0 comments on commit 70a35b7

Please sign in to comment.