Skip to content

Commit 8b6da98

Browse files
committed
Minor visual fixes in create-site flow
1 parent 642e124 commit 8b6da98

File tree

7 files changed

+26
-59
lines changed

7 files changed

+26
-59
lines changed

WordPress/Classes/Extensions/Colors and Styles/WPStyleGuide+Search.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ extension WPStyleGuide {
88
searchBar.accessibilityIdentifier = "Search"
99
searchBar.autocapitalizationType = .none
1010
searchBar.autocorrectionType = .no
11-
searchBar.isTranslucent = true
12-
searchBar.backgroundImage = UIImage()
13-
searchBar.backgroundColor = backgroundColor
11+
if #available(iOS 26, *) {
12+
searchBar.searchBarStyle = .minimal // Removes borders
13+
} else {
14+
searchBar.isTranslucent = true
15+
searchBar.backgroundImage = UIImage()
16+
searchBar.backgroundColor = backgroundColor
17+
}
1418
searchBar.returnKeyType = returnKeyType
1519
}
1620

WordPress/Classes/ViewRelated/Domains/DomainSelectionViewController.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,7 @@ final class DomainSelectionViewController: CollapsableHeaderViewController {
419419
searchTextField.delegate = self
420420
searchTextField.accessibilityTraits = .searchField
421421

422-
let placeholderText = Strings.searchPlaceholder
423-
let attributes = WPStyleGuide.defaultSearchBarTextAttributesSwifted(.placeholderText)
424-
let attributedPlaceholder = NSAttributedString(string: placeholderText, attributes: attributes)
425-
searchTextField.attributedPlaceholder = attributedPlaceholder
422+
searchBar.placeholder = Strings.searchPlaceholder
426423
searchTextField.accessibilityHint = Strings.searchAccessibility
427424

428425
view.addSubview(noResultsLabel)

WordPress/Classes/ViewRelated/Gutenberg/Collapsable Header/CollapsableHeaderViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost {
1717
let secondaryActionTitle: String?
1818
let defaultActionTitle: String?
1919
open var accessoryBarHeight: CGFloat {
20-
return 44
20+
if #available(iOS 26, *) { 64 + 16 } else { 44 }
2121
}
2222

2323
open var separatorStyle: SeparatorStyle {
@@ -96,7 +96,11 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost {
9696
@IBOutlet var visualEffects: [UIVisualEffectView]! {
9797
didSet {
9898
visualEffects.forEach { (visualEffect) in
99-
visualEffect.effect = UIBlurEffect.init(style: .systemChromeMaterial)
99+
if #available(iOS 26, *) {
100+
visualEffect.effect = UIBlurEffect(style: .regular)
101+
} else {
102+
visualEffect.effect = UIBlurEffect(style: .systemChromeMaterial)
103+
}
100104
// Allow touches to pass through to the scroll view behind the header.
101105
visualEffect.contentView.isUserInteractionEnabled = false
102106
}

WordPress/Classes/ViewRelated/Reader/Style/WPStyleGuide+ReaderComments.swift

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,6 @@ import WordPressShared
33
import WordPressUI
44

55
extension WPStyleGuide {
6-
7-
@objc class func defaultSearchBarTextAttributes(_ color: UIColor) -> [String: Any] {
8-
let attributes = defaultSearchBarTextAttributesSwifted(color)
9-
return NSAttributedString.Key.convertToRaw(attributes: attributes)
10-
}
11-
12-
class func defaultSearchBarTextAttributesSwifted() -> [NSAttributedString.Key: Any] {
13-
return [
14-
.font: WPStyleGuide.fixedFont(for: .body)
15-
]
16-
}
17-
18-
class func defaultSearchBarTextAttributesSwifted(_ color: UIColor) -> [NSAttributedString.Key: Any] {
19-
var attributes = defaultSearchBarTextAttributesSwifted()
20-
21-
attributes[.foregroundColor] = color
22-
23-
return attributes
24-
}
25-
266
public struct ReaderCommentsNotificationSheet {
277
static let textColor = UIColor.label
288
static let descriptionLabelFont = fontForTextStyle(.subheadline)
@@ -33,17 +13,3 @@ extension WPStyleGuide {
3313
static let switchInProgressTintColor = UIAppColor.primary
3414
}
3515
}
36-
37-
private extension NSAttributedString.Key {
38-
/// Converts a collection of NSAttributedString Attributes, with 'NSAttributedStringKey' instances as 'Keys', into an
39-
/// equivalent collection that uses regular 'String' instances as keys.
40-
///
41-
static func convertToRaw(attributes: [NSAttributedString.Key: Any]) -> [String: Any] {
42-
var output = [String: Any]()
43-
for (key, value) in attributes {
44-
output[key.rawValue] = value
45-
}
46-
47-
return output
48-
}
49-
}

WordPress/Classes/ViewRelated/Site Creation/Design Selection/SiteDesignContentCollectionViewController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
215215
}
216216

217217
private func configureSkipButton() {
218-
let skip = UIBarButtonItem(title: TextContent.skipButtonTitle, style: .done, target: self, action: #selector(skipButtonTapped))
218+
let skip = UIBarButtonItem(title: TextContent.skipButtonTitle, style: .plain, target: self, action: #selector(skipButtonTapped))
219219
navigationItem.rightBarButtonItem = skip
220220
}
221221

@@ -224,7 +224,7 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
224224
return
225225
}
226226

227-
navigationItem.leftBarButtonItem = UIBarButtonItem(title: TextContent.cancelButtonTitle, style: .done, target: self, action: #selector(closeButtonTapped))
227+
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(closeButtonTapped))
228228
}
229229

230230
@objc
@@ -253,8 +253,6 @@ class SiteDesignContentCollectionViewController: CollapsableHeaderViewController
253253
comment: "Shortened version of the main title to be used in back navigation.")
254254
static let skipButtonTitle = NSLocalizedString("Skip",
255255
comment: "Continue without making a selection.")
256-
static let cancelButtonTitle = NSLocalizedString("Cancel",
257-
comment: "Cancel site creation.")
258256
static let errorTitle = NSLocalizedString("Unable to load this content right now.",
259257
comment: "Informing the user that a network request failed because the device wasn't able to establish a network connection.")
260258
static let errorSubtitle = NSLocalizedString("Check your network connection and try again.",

WordPress/Classes/ViewRelated/Site Creation/Site Intent/IntentCell.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ final class IntentCell: UITableViewCell, ModelSettableCell, NibLoadable {
2828
}
2929

3030
private func commonInit() {
31-
selectedBackgroundView?.backgroundColor = .clear
31+
if #available(iOS 26, *) {
32+
selectionStyle = .none
33+
} else {
34+
selectedBackgroundView?.backgroundColor = .clear
35+
}
3236

3337
accessibilityTraits = .button
3438
accessibilityHint = NSLocalizedString("Selects this topic as the intent for your site.",

WordPress/Classes/ViewRelated/Site Creation/Site Intent/SiteIntentViewController.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class SiteIntentViewController: CollapsableHeaderViewController {
1515
let searchBar = UISearchBar()
1616
searchBar.translatesAutoresizingMaskIntoConstraints = false
1717
WPStyleGuide.configureSearchBar(searchBar, backgroundColor: .clear, returnKeyType: .search)
18-
searchBar.setImage(UIImage(), for: .search, state: .normal)
18+
if #unavailable(iOS 26) {
19+
searchBar.setImage(UIImage(), for: .search, state: .normal)
20+
}
1921
return searchBar
2022
}()
2123

@@ -78,15 +80,9 @@ class SiteIntentViewController: CollapsableHeaderViewController {
7880
// Title
7981
navigationItem.backButtonTitle = Strings.backButtonTitle
8082
// Skip button
81-
navigationItem.rightBarButtonItem = UIBarButtonItem(title: Strings.skipButtonTitle,
82-
style: .done,
83-
target: self,
84-
action: #selector(skipButtonTapped))
83+
navigationItem.rightBarButtonItem = UIBarButtonItem(title: Strings.skipButtonTitle, style: .plain, target: self, action: #selector(skipButtonTapped))
8584
// Cancel button
86-
navigationItem.leftBarButtonItem = UIBarButtonItem(title: Strings.cancelButtonTitle,
87-
style: .done,
88-
target: self,
89-
action: #selector(closeButtonTapped))
85+
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(closeButtonTapped))
9086
navigationItem.leftBarButtonItem?.accessibilityIdentifier = "site-intent-cancel-button"
9187
}
9288

@@ -132,8 +128,6 @@ extension SiteIntentViewController {
132128
comment: "Shortened version of the main title to be used in back navigation")
133129
static let skipButtonTitle = NSLocalizedString("Skip",
134130
comment: "Continue without making a selection")
135-
static let cancelButtonTitle = NSLocalizedString("Cancel",
136-
comment: "Cancel site creation")
137131
static let searchTextFieldPlaceholder = NSLocalizedString("E.g. Fashion, Poetry, Politics", comment: "Placeholder text for the search field int the Site Intent screen.")
138132
static let continueButtonTitle = NSLocalizedString("Continue", comment: "Title of the continue button for the Site Intent screen.")
139133
}

0 commit comments

Comments
 (0)