Skip to content

Commit

Permalink
Merge remote-tracking branch 'mozilla/main' into ih/FXIOS-10996-refac…
Browse files Browse the repository at this point in the history
…tor-history-panel-hashable-conformance

# Conflicts:
#	firefox-ios/Storage/DefaultSuggestedSites.swift
  • Loading branch information
ih-codes committed Jan 17, 2025
2 parents 8641fed + 6d8a691 commit 6145d2e
Show file tree
Hide file tree
Showing 162 changed files with 2,957 additions and 999 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-rust-component-dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/firefox-ios-autofill-playwrite-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ jobs:
- name: Send Slack notification if tests fail
if: '${{ !cancelled() && !github.event.pull_request.head.repo.fork }}'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill-test.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
18 changes: 10 additions & 8 deletions .github/workflows/firefox-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
workflow_dispatch: {}
env:
browser: firefox-ios
xcode_version: 16.1
ios_version: 18.1
xcode_version: 16.2
ios_version: 18.2
ios_simulator_default: iPhone 16
xcodebuild_scheme: Fennec
xcodebuild_target: Client
Expand Down Expand Up @@ -184,12 +184,13 @@ jobs:
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.passfail.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: Smoketests
Expand Down Expand Up @@ -267,12 +268,13 @@ jobs:
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: FullFunctionalTestPlan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
committer: GitHub <[email protected]>
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: ${{ env.pr_title }}
commit-message: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
title: "Refactor [v${{ env.next_version }}] Update effective_tld_names file ${{ env.current_date }}"
branch: ${{ env.branch_name }}
body: ${{ env.pr_body }}
2 changes: 1 addition & 1 deletion .github/workflows/firefox-ios-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -53,14 +53,15 @@ jobs:
- name: Send Slack to notifiy if github action fails
if: '!cancelled()'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-autofill.json"
payload-templated: true
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
call-firefox-ios-autofill-playwrite-tests:
uses: ./.github/workflows/firefox-ios-autofill-playwrite-tests.yml
secrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.7]
python-version: [3.10.16]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -65,11 +65,12 @@ jobs:
- name: Send Slack to notifiy if github action fails
if: '!cancelled()'
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
env:
JOB_STATUS: ${{ job.status == 'success' && ':white_check_mark:' || job.status == 'failure' && ':x:' }}
JOB_STATUS_COLOR: ${{ job.status == 'success' && '#36a64f' || job.status == 'failure' && '#FF0000' }}
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
with:
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
payload-file-path: "./test-fixtures/ci/slack-notification-payload-remote-settings-fetch.json"
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
14 changes: 8 additions & 6 deletions .github/workflows/focus-ios-ui-tests-previous-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,13 @@ jobs:
retention-days: 90
- name: Report to Slack (SmokeTests)
id: slack-smoketests
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack-smoketests.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
ios_version: ${{ matrix.ios_version }}
pass_fail: ${{ steps.run-smoketests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
Expand All @@ -165,12 +166,13 @@ jobs:
sha: ${{ github.sha }}
- name: Report to Slack (FullFunctionalTests)
id: slack-fullfunctionaltests
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack-fullfunctionaltests.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
ios_version: ${{ matrix.ios_version }}
pass_fail: ${{ steps.run-fullfunctionaltests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/focus-ios-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ jobs:
retention-days: 90
- name: Report to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload-file-path: ${{ env.browser }}/slack.json
payload-templated: true
webhook: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
webhook-type: incoming-webhook
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SLACK_TOKEN }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
ios_simulator: ${{ matrix.ios_simulator }}
pass_fail: ${{ steps.run-tests.outcome == 'success' && ':white_check_mark:' || ':x:' }}
xcodebuild_test_plan: ${{ matrix.xcodebuild_test_plan }}
Expand Down
4 changes: 2 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ line_length:
ignores_interpolated_strings: true

closure_body_length:
warning: 71
error: 71
warning: 60
error: 60

file_header:
required_string: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ public class BottomSheetViewController: UIViewController,
self.sheetView.transform = CGAffineTransform(translationX: 0, y: self.viewTranslation.y)
})
case .ended:
if viewTranslation.y < 200 {
let velocity = recognizer.velocity(in: view)
if viewTranslation.y >= 200 || viewTranslation.y >= contentView.bounds.height / 2 || velocity.y >= 700 {
dismissSheetViewController()
} else {
UIView.animate(withDuration: UX.animationDuration,
delay: 0,
usingSpringWithDamping: UX.springWithDamping,
Expand All @@ -268,8 +271,6 @@ public class BottomSheetViewController: UIViewController,
animations: {
self.sheetView.transform = .identity
})
} else {
dismissSheetViewController()
}
default:
break
Expand Down
10 changes: 10 additions & 0 deletions BrowserKit/Sources/ComponentLibrary/Buttons/LinkButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ open class LinkButton: UIButton, ThemeApplicable {
configuration = updatedConfiguration
}

public func applyUnderline(underlinedText: String) {
let attributedString = NSAttributedString(
string: underlinedText,
attributes: [
.underlineStyle: NSUnderlineStyle.single.rawValue
]
)
setAttributedTitle(attributedString, for: .normal)
}

// MARK: ThemeApplicable

public func applyTheme(theme: Theme) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ public final class NavigationHeaderView: UIView {
label.textAlignment = .center
label.font = FXFontStyles.Regular.headline.scaledFont()
label.numberOfLines = 2
label.lineBreakMode = .byTruncatingTail
label.accessibilityTraits.insert(.header)
label.isAccessibilityElement = false
label.setContentHuggingPriority(.defaultLow, for: .horizontal)
label.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
}

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

private let horizontalLine: UIView = .build()
Expand All @@ -62,26 +67,20 @@ public final class NavigationHeaderView: UIView {
closeButton.removeConstraints(closeButton.constraints)
viewConstraints.removeAll()
viewConstraints.append(contentsOf: [
backButton.leadingAnchor.constraint(
equalTo: leadingAnchor,
constant: UX.imageMargins
),
backButton.leadingAnchor.constraint(equalTo: leadingAnchor, constant: UX.imageMargins),
backButton.centerYAnchor.constraint(equalTo: centerYAnchor),
backButton.trailingAnchor.constraint(lessThanOrEqualTo: titleLabel.leadingAnchor,
constant: -UX.horizontalMargin),

titleLabel.topAnchor.constraint(
equalTo: topAnchor,
constant: UX.baseDistance
),
titleLabel.bottomAnchor.constraint(
equalTo: bottomAnchor,
constant: -UX.baseDistance
),
titleLabel.leadingAnchor.constraint(greaterThanOrEqualTo: backButton.trailingAnchor,
constant: UX.horizontalMargin),
titleLabel.trailingAnchor.constraint(lessThanOrEqualTo: closeButton.leadingAnchor,
constant: -UX.horizontalMargin),
titleLabel.centerXAnchor.constraint(equalTo: centerXAnchor),
titleLabel.topAnchor.constraint(equalTo: topAnchor, constant: UX.baseDistance),
titleLabel.bottomAnchor.constraint(equalTo: bottomAnchor, constant: -UX.baseDistance),

closeButton.trailingAnchor.constraint(
equalTo: trailingAnchor,
constant: -UX.horizontalMargin
),
closeButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -UX.horizontalMargin),
closeButton.centerYAnchor.constraint(equalTo: centerYAnchor),

horizontalLine.leadingAnchor.constraint(equalTo: leadingAnchor),
Expand Down
16 changes: 16 additions & 0 deletions BrowserKit/Sources/Shared/InstallationUtils.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Foundation

public struct InstallationUtils {
/// Fetches the app's inferred installation date from the creation date of the Documents directory.
public static var inferredDateInstalledOn: Date? {
guard
let documentsURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last,
let attributes = try? FileManager.default.attributesOfItem(atPath: documentsURL.path)
else { return nil }
return attributes[.creationDate] as? Date
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ class DefaultImageHandler: ImageHandler {
}

let image = try await letterImageGenerator.generateLetterImage(siteString: siteString)
// FIXME Do we really want to cache letter icons and never attempt to get a favicon again?
// We can drop into here on a network timeout.
// FIXME FXIOS-11063 Do we really want to cache letter icons and never attempt to get a favicon again?
// We can drop into here on a network timeout.
await imageCache.cacheImage(image: image, cacheKey: imageModel.cacheKey, type: imageModel.imageType)
return image
} catch {
Expand Down
Loading

0 comments on commit 6145d2e

Please sign in to comment.