Skip to content

Commit

Permalink
Merge remote-tracking branch 'mozilla/main' into wt/FXIOS-8599-create…
Browse files Browse the repository at this point in the history
…-toolbar-element
  • Loading branch information
thatswinnie committed Mar 26, 2024
2 parents 45f64f8 + 77bf13f commit 4cfdf8f
Show file tree
Hide file tree
Showing 119 changed files with 1,649 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ public class ContextualHintView: UIView, ThemeApplicable {
private var viewModel: ContextualHintViewModel!

struct UX {
static let actionButtonTextSize: CGFloat = 17
static let closeButtonSize = CGSize(width: 35, height: 35)
static let closeButtonTrailing: CGFloat = 5
static let closeButtonTop: CGFloat = 23
static let closeButtonBottom: CGFloat = 12
static let closeButtonInsets = NSDirectionalEdgeInsets(top: 0, leading: 7.5, bottom: 15, trailing: 7.5)
static let actionButtonInsets = NSDirectionalEdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0)
static let descriptionTextSize: CGFloat = 17
static let stackViewLeading: CGFloat = 16
static let stackViewTopArrowTopConstraint: CGFloat = 16
static let stackViewBottomArrowTopConstraint: CGFloat = 5
Expand All @@ -37,7 +35,7 @@ public class ContextualHintView: UIView, ThemeApplicable {
}

private lazy var descriptionLabel: UILabel = .build { label in
label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, size: UX.descriptionTextSize)
label.font = FXFontStyles.Regular.body.scaledFont()
label.textAlignment = .left
label.numberOfLines = 0
}
Expand Down Expand Up @@ -156,7 +154,7 @@ public class ContextualHintView: UIView, ThemeApplicable {

if viewModel.isActionType {
let textAttributes: [NSAttributedString.Key: Any] = [
.font: DefaultDynamicFontHelper.preferredFont(withTextStyle: .body, size: UX.actionButtonTextSize),
.font: FXFontStyles.Regular.body.scaledFont(),
.foregroundColor: theme.colors.textOnDark,
.underlineStyle: NSUnderlineStyle.single.rawValue
]
Expand Down
7 changes: 7 additions & 0 deletions BrowserKit/Sources/Redux/Store.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ public class Store<State: StateType>: DefaultDispatchStore {
}
actionRunning = true; defer { actionRunning = false }

// Each active screen state is given an opportunity to be reduced using the dispatched action
// (Note: this is true even if the action's UUID differs from the screen's window's UUID).
// Typically, reducers should compare the action's UUID to the incoming state UUID and skip
// processing for actions originating in other windows.
let newState = reducer(state, action)

// Middlewares are all given an opportunity to respond to the action. This is only done once
// per middleware, regardless of how many active windows or screen states there are. (This
// differs slightly from reducers, which are called once for each screen.)
middlewares.forEach { middleware in
middleware(newState, action)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let store = Store(state: FakeReduxState(),
reducer: FakeReduxState.reducer,
middlewares: [FakeReduxMiddleware().fakeProvider])

final class IntegrationTests: XCTestCase {
final class ReduxIntegrationTests: XCTestCase {
var fakeViewController: FakeReduxViewController!
var expectedIntValue: Int!

Expand Down
7 changes: 3 additions & 4 deletions BrowserKit/Tests/ReduxTests/Utilities/FakeReduxAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// 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
import XCTest

@testable import Redux

Expand All @@ -19,8 +19,7 @@ enum FakeReduxAction: Action {
case setPrivateModeTo(Bool)

var windowUUID: UUID {
// TODO: [8188] Currently these unit tests do not make use of UUIDs. This will be updated soon.
// For now, we can just return UUID().
return UUID()
// TODO: Update to use static consts on WindowUUID (.XCTestDefaultUUID)
return UUID(uuidString: "D9D9D9D9-D9D9-D9D9-D9D9-CD68A019860B")!
}
}
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contribution guidelines
We encourage you to participate in this open source project. We love Pull Requests, Issue Reports, Feature Requests or any kind of positive contribution. Please read the the following guidelines and our [Firefox for iOS contributing guidelines](https://github.com/mozilla-mobile/firefox-ios/blob/main/CONTRIBUTING.md) first.
We encourage you to participate in this open source project. We love Pull Requests, Issue Reports, Feature Requests or any kind of positive contribution. Please read the following guidelines and our [Firefox for iOS contributing guidelines](https://github.com/mozilla-mobile/firefox-ios/blob/main/CONTRIBUTING.md) first.

## Submitting an Issue
If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to our repository. Before you submit your issue, search open and closed issues, as it's possible that your question was already answered, or a ticket for the issue already exists.
Expand Down
Loading

0 comments on commit 4cfdf8f

Please sign in to comment.