Skip to content

Commit f7c1456

Browse files
committed
Merge branch 'main' into afarcasanu/fxios_10139_22212_saveaspdf_save_option
2 parents 6f1f77b + 999680a commit f7c1456

File tree

191 files changed

+2437
-1654
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+2437
-1654
lines changed

.githooks/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
echo "Starting Swiftlint Check..."
4-
swiftlint --strict
4+
swiftlint --strict --quiet
55
RESULT=$?
66

77
if [ $RESULT -ne 0 ]; then

.github/workflows/firefox-ios-autofill-playwrite-tests.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ jobs:
5454
- name: Send Slack notification if tests fail
5555
if: '${{ !cancelled() && !github.event.pull_request.head.repo.fork }}'
5656
id: slack
57-
uses: slackapi/slack-github-action@v1.26.0
57+
uses: slackapi/slack-github-action@v2.0.0
5858
with:
5959
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill-test.json"
60+
payload-templated: true
61+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
62+
webhook-type: incoming-webhook
6063
env:
6164
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
6265
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
63-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
64-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

.github/workflows/firefox-ios-ui-tests.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ on:
44
workflow_dispatch: {}
55
env:
66
browser: firefox-ios
7-
xcode_version: 16.1
8-
ios_version: 18.1
7+
xcode_version: 16.2
8+
ios_version: 18.2
99
ios_simulator_default: iPhone 16
1010
xcodebuild_scheme: Fennec
1111
xcodebuild_target: Client
@@ -184,12 +184,13 @@ jobs:
184184
retention-days: 90
185185
- name: Report to Slack
186186
id: slack
187-
uses: slackapi/slack-github-action@v1.26.0
187+
uses: slackapi/slack-github-action@v2.0.0
188188
with:
189189
payload-file-path: ${{ env.browser }}/slack.json
190+
payload-templated: true
191+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
192+
webhook-type: incoming-webhook
190193
env:
191-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
192-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
193194
ios_simulator: ${{ matrix.ios_simulator }}
194195
pass_fail: ${{ steps.passfail.outcome == 'success' && ':white_check_mark:' || ':x:' }}
195196
xcodebuild_test_plan: Smoketests
@@ -267,12 +268,13 @@ jobs:
267268
retention-days: 90
268269
- name: Report to Slack
269270
id: slack
270-
uses: slackapi/slack-github-action@v1.26.0
271+
uses: slackapi/slack-github-action@v2.0.0
271272
with:
272273
payload-file-path: ${{ env.browser }}/slack.json
274+
payload-templated: true
275+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
276+
webhook-type: incoming-webhook
273277
env:
274-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
275-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
276278
ios_simulator: ${{ matrix.ios_simulator }}
277279
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
278280
xcodebuild_test_plan: FullFunctionalTestPlan

.github/workflows/firefox-ios-update-effective-tld-names-file.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
7373
committer: GitHub <[email protected]>
7474
token: ${{ secrets.GITHUB_TOKEN }}
75-
commit-message: ${{ env.pr_title }}
75+
commit-message: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
7676
title: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
7777
branch: ${{ env.branch_name }}
7878
body: ${{ env.pr_body }}

.github/workflows/firefox-ios-update_credential_provider_script.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ jobs:
5353
- name: Send Slack to notifiy if github action fails
5454
if: '!cancelled()'
5555
id: slack
56-
uses: slackapi/slack-github-action@v1.26.0
56+
uses: slackapi/slack-github-action@v2.0.0
5757
env:
5858
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
5959
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
60-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
61-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
6260
with:
6361
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill.json"
62+
payload-templated: true
63+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
64+
webhook-type: incoming-webhook
6465
call-firefox-ios-autofill-playwrite-tests:
6566
uses: ./.github/workflows/firefox-ios-autofill-playwrite-tests.yml
6667
secrets:

.github/workflows/firefox-ios-update_remote_settings_data_script.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ jobs:
6565
- name: Send Slack to notifiy if github action fails
6666
if: '!cancelled()'
6767
id: slack
68-
uses: slackapi/slack-github-action@v1.26.0
68+
uses: slackapi/slack-github-action@v2.0.0
6969
env:
7070
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
7171
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
72-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
73-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
7472
with:
75-
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
73+
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
74+
payload-templated: true
75+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
76+
webhook-type: incoming-webhook

.github/workflows/focus-ios-ui-tests-previous-os.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,13 @@ jobs:
148148
retention-days: 90
149149
- name: Report to Slack (SmokeTests)
150150
id: slack-smoketests
151-
uses: slackapi/slack-github-action@v1.26.0
151+
uses: slackapi/slack-github-action@v2.0.0
152152
with:
153153
payload-file-path: ${{ env.browser }}/slack-smoketests.json
154+
payload-templated: true
155+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
156+
webhook-type: incoming-webhook
154157
env:
155-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
156-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
157158
ios_simulator: ${{ matrix.ios_simulator }}
158159
ios_version: ${{ matrix.ios_version }}
159160
pass_fail: ${{ steps.run-smoketests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
@@ -165,12 +166,13 @@ jobs:
165166
sha: ${{ github.sha }}
166167
- name: Report to Slack (FullFunctionalTests)
167168
id: slack-fullfunctionaltests
168-
uses: slackapi/slack-github-action@v1.26.0
169+
uses: slackapi/slack-github-action@v2.0.0
169170
with:
170171
payload-file-path: ${{ env.browser }}/slack-fullfunctionaltests.json
172+
payload-templated: true
173+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
174+
webhook-type: incoming-webhook
171175
env:
172-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
173-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
174176
ios_simulator: ${{ matrix.ios_simulator }}
175177
ios_version: ${{ matrix.ios_version }}
176178
pass_fail: ${{ steps.run-fullfunctionaltests.outcome == 'success' && ':white_check_mark:' || ':x:' }}

.github/workflows/focus-ios-ui-tests.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,13 @@ jobs:
116116
retention-days: 90
117117
- name: Report to Slack
118118
id: slack
119-
uses: slackapi/slack-github-action@v1.26.0
119+
uses: slackapi/slack-github-action@v2.0.0
120120
with:
121121
payload-file-path: ${{ env.browser }}/slack.json
122+
payload-templated: true
123+
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
124+
webhook-type: incoming-webhook
122125
env:
123-
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
124-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
125126
ios_simulator: ${{ matrix.ios_simulator }}
126127
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
127128
xcodebuild_test_plan: ${{ matrix.xcodebuild_test_plan }}

.swiftlint.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ line_length:
102102
ignores_interpolated_strings: true
103103

104104
closure_body_length:
105-
warning: 64
106-
error: 64
105+
warning: 53
106+
error: 53
107107

108108
file_header:
109109
required_string: |
@@ -142,8 +142,9 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
142142
- firefox-ios/Client/ContentBlocker/ContentBlockerGenerator/Package.swift
143143
- Package.swift
144144
- firefox-ios/Build/Intermediates.noindex/Client.build/Fennec-iphoneos/WidgetKitExtension.build/DerivedSources/IntentDefinitionGenerated/WidgetIntents/*
145-
# Temporarly ignore focus-ios folder
146-
- focus-ios/
145+
# Focus specific
146+
- focus-ios/Blockzilla/Generated
147+
- focus-ios-tests/tools/Localizations
147148

148149
included:
149150
- /Users/vagrant/git

BrowserKit/Sources/Common/Constants/AppBuildChannel.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import Foundation
66

77
public enum AppBuildChannel: String {
8-
case release
9-
case beta
10-
case developer
8+
case release = "RELEASE"
9+
case beta = "BETA"
10+
case developer = "FENNEC"
1111

1212
// Used for unknown cases
1313
case other

BrowserKit/Sources/ComponentLibrary/BottomSheet/BottomSheetViewController.swift

+4-3
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ public class BottomSheetViewController: UIViewController,
259259
self.sheetView.transform = CGAffineTransform(translationX: 0, y: self.viewTranslation.y)
260260
})
261261
case .ended:
262-
if viewTranslation.y < 200 {
262+
let velocity = recognizer.velocity(in: view)
263+
if viewTranslation.y >= 200 || viewTranslation.y >= contentView.bounds.height / 2 || velocity.y >= 700 {
264+
dismissSheetViewController()
265+
} else {
263266
UIView.animate(withDuration: UX.animationDuration,
264267
delay: 0,
265268
usingSpringWithDamping: UX.springWithDamping,
@@ -268,8 +271,6 @@ public class BottomSheetViewController: UIViewController,
268271
animations: {
269272
self.sheetView.transform = .identity
270273
})
271-
} else {
272-
dismissSheetViewController()
273274
}
274275
default:
275276
break

BrowserKit/Sources/ComponentLibrary/Buttons/LinkButton.swift

+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ open class LinkButton: UIButton, ThemeApplicable {
5959
configuration = updatedConfiguration
6060
}
6161

62+
public func applyUnderline(underlinedText: String) {
63+
let attributedString = NSAttributedString(
64+
string: underlinedText,
65+
attributes: [
66+
.underlineStyle: NSUnderlineStyle.single.rawValue
67+
]
68+
)
69+
setAttributedTitle(attributedString, for: .normal)
70+
}
71+
6272
// MARK: ThemeApplicable
6373

6474
public func applyTheme(theme: Theme) {

BrowserKit/Sources/ComponentLibrary/Headers/NavigationHeaderView.swift

+15-16
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ public final class NavigationHeaderView: UIView {
2323
label.textAlignment = .center
2424
label.font = FXFontStyles.Regular.headline.scaledFont()
2525
label.numberOfLines = 2
26+
label.lineBreakMode = .byTruncatingTail
2627
label.accessibilityTraits.insert(.header)
2728
label.isAccessibilityElement = false
29+
label.setContentHuggingPriority(.defaultLow, for: .horizontal)
30+
label.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
2831
}
2932

3033
private lazy var closeButton: CloseButton = .build { button in
@@ -37,6 +40,8 @@ public final class NavigationHeaderView: UIView {
3740
for: .normal)
3841
button.titleLabel?.adjustsFontSizeToFitWidth = true
3942
button.addTarget(self, action: #selector(self.backButtonTapped), for: .touchUpInside)
43+
button.setContentHuggingPriority(.defaultHigh, for: .horizontal)
44+
button.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
4045
}
4146

4247
private let horizontalLine: UIView = .build()
@@ -62,26 +67,20 @@ public final class NavigationHeaderView: UIView {
6267
closeButton.removeConstraints(closeButton.constraints)
6368
viewConstraints.removeAll()
6469
viewConstraints.append(contentsOf: [
65-
backButton.leadingAnchor.constraint(
66-
equalTo: leadingAnchor,
67-
constant: UX.imageMargins
68-
),
70+
backButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: UX.imageMargins),
6971
backButton.centerYAnchor.constraint(equalTo: centerYAnchor),
72+
backButton.trailingAnchor.constraint(lessThanOrEqualTo: titleLabel.leadingAnchor,
73+
constant: -UX.horizontalMargin),
7074

71-
titleLabel.topAnchor.constraint(
72-
equalTo: topAnchor,
73-
constant: UX.baseDistance
74-
),
75-
titleLabel.bottomAnchor.constraint(
76-
equalTo: bottomAnchor,
77-
constant: -UX.baseDistance
78-
),
75+
titleLabel.leadingAnchor.constraint(greaterThanOrEqualTo: backButton.trailingAnchor,
76+
constant: UX.horizontalMargin),
77+
titleLabel.trailingAnchor.constraint(lessThanOrEqualTo: closeButton.leadingAnchor,
78+
constant: -UX.horizontalMargin),
7979
titleLabel.centerXAnchor.constraint(equalTo: centerXAnchor),
80+
titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: UX.baseDistance),
81+
titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -UX.baseDistance),
8082

81-
closeButton.trailingAnchor.constraint(
82-
equalTo: trailingAnchor,
83-
constant: -UX.horizontalMargin
84-
),
83+
closeButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -UX.horizontalMargin),
8584
closeButton.centerYAnchor.constraint(equalTo: centerYAnchor),
8685

8786
horizontalLine.leadingAnchor.constraint(equalTo: leadingAnchor),

BrowserKit/Sources/Shared/AppConstants.swift

+4-18
Original file line numberDiff line numberDiff line change
@@ -87,29 +87,15 @@ public class AppConstants {
8787

8888
/// Build Channel.
8989
public static let buildChannel: AppBuildChannel = {
90-
#if MOZ_CHANNEL_RELEASE
91-
return AppBuildChannel.release
92-
#elseif MOZ_CHANNEL_BETA
93-
return AppBuildChannel.beta
94-
#elseif MOZ_CHANNEL_FENNEC
95-
return AppBuildChannel.developer
96-
#else
97-
return AppBuildChannel.other
98-
#endif
90+
let channelRaw = Bundle.main.infoDictionary?["CHANNEL"] as? String ?? "other"
91+
let channel = AppBuildChannel(rawValue: channelRaw) ?? .other
92+
return channel
9993
}()
10094

10195
/// Enables support for International Domain Names (IDN)
10296
/// Disabled because of https://bugzilla.mozilla.org/show_bug.cgi?id=1312294
10397
public static let punyCode: Bool = {
104-
#if MOZ_CHANNEL_RELEASE
105-
return false
106-
#elseif MOZ_CHANNEL_BETA
107-
return false
108-
#elseif MOZ_CHANNEL_FENNEC
109-
return true
110-
#else
111-
return true
112-
#endif
98+
return buildChannel == .developer || buildChannel == .other
11399
}()
114100

115101
/// The maximum length of a URL stored by Firefox. Shared with Places on desktop.

SampleBrowser/SampleBrowser.xcodeproj/project.pbxproj

+22
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@
296296
isa = PBXNativeTarget;
297297
buildConfigurationList = 8A46020B2B0FE20800FFD17F /* Build configuration list for PBXNativeTarget "SampleBrowser" */;
298298
buildPhases = (
299+
EE20F75A2D3AC5CA00A3F5DF /* Swiftlint */,
299300
8A4601DD2B0FE20500FFD17F /* Sources */,
300301
8A4601DE2B0FE20500FFD17F /* Frameworks */,
301302
8A4601DF2B0FE20500FFD17F /* Resources */,
@@ -363,6 +364,27 @@
363364
};
364365
/* End PBXResourcesBuildPhase section */
365366

367+
/* Begin PBXShellScriptBuildPhase section */
368+
EE20F75A2D3AC5CA00A3F5DF /* Swiftlint */ = {
369+
isa = PBXShellScriptBuildPhase;
370+
buildActionMask = 2147483647;
371+
files = (
372+
);
373+
inputFileListPaths = (
374+
);
375+
inputPaths = (
376+
);
377+
name = Swiftlint;
378+
outputFileListPaths = (
379+
);
380+
outputPaths = (
381+
);
382+
runOnlyForDeploymentPostprocessing = 0;
383+
shellPath = /bin/sh;
384+
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nMODIFIED_FILES=$(git diff --name-only --diff-filter=ACM | grep -e '\\.swift$')\n\nSWIFTLINT_ROOT=\"${SRCROOT}/..\"\n\nif which swiftlint > /dev/null; then\n # Move to the location of the root Swiftlint config file in\n # order to use nested configurations\n cd ${SWIFTLINT_ROOT}\n\n swiftlint lint ${MODIFIED_FILES}\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\" \nfi\n";
385+
};
386+
/* End PBXShellScriptBuildPhase section */
387+
366388
/* Begin PBXSourcesBuildPhase section */
367389
8A4601DD2B0FE20500FFD17F /* Sources */ = {
368390
isa = PBXSourcesBuildPhase;

SampleComponentLibraryApp/SampleComponentLibraryApp.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@
241241
isa = PBXNativeTarget;
242242
buildConfigurationList = 8A2FE6782A55EE3F0036B6AF /* Build configuration list for PBXNativeTarget "SampleComponentLibraryApp" */;
243243
buildPhases = (
244+
8A2FE6922A55F1880036B6AF /* Swiftlint */,
244245
8A2FE64A2A55EE3D0036B6AF /* Sources */,
245246
8A2FE64C2A55EE3D0036B6AF /* Resources */,
246247
8A2FE64B2A55EE3D0036B6AF /* Frameworks */,
247-
8A2FE6922A55F1880036B6AF /* Swiftlint */,
248248
);
249249
buildRules = (
250250
);
@@ -321,7 +321,7 @@
321321
);
322322
runOnlyForDeploymentPostprocessing = 0;
323323
shellPath = /bin/sh;
324-
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swiftlint > /dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
324+
shellScript = "if [[ \"$(uname -m)\" == arm64 ]]; then\n export PATH=\"/opt/homebrew/bin:$PATH\"\nfi\n\nMODIFIED_FILES=$(git diff --name-only --diff-filter=ACM | grep -e '\\.swift$')\n\nSWIFTLINT_ROOT=\"${SRCROOT}/..\"\n\nif which swiftlint > /dev/null; then\n # Move to the location of the root Swiftlint config file in\n # order to use nested configurations\n cd ${SWIFTLINT_ROOT}\n\n swiftlint lint ${MODIFIED_FILES}\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\" \nfi\n";
325325
};
326326
/* End PBXShellScriptBuildPhase section */
327327

0 commit comments

Comments
 (0)