Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor FXIOS-8971 Tweaks to redux actions (backport #19823) #20075

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Apr 30, 2024

📜 Tickets

Jira ticket
Github issue

💡 Description

This is a POC for a tweak to the redux system to try to simplify how we handle actions and associate them with the correct window/view etc.
Previously actions were entirely enum driven, this change shifts it so that actions are classes that contain an action type enum variable within. This allows the action to carry associated data in a simpler way, especially for data that we want to present in all or many cases such as a window ID and a view ID and can easily be expanded to add more if needed in the future.
This removes the need for ActionContext associated values on each of the action enums cases and removes the need to pull the windowUUID var from ever single enum case and the same for future top level variables that would need to be added like viewUUID to fix bugs arising from actions misfiring in places like the normal and private tab panels.

For the sake of the POC I have only updated the redux library and it's tests so that they run successfully. I've updated the active screen section of the client app just as an example but the client app does not currently compile.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

This is an automatic backport of pull request #19823 done by [Mergify](https://mergify.com).

* POC for tweaks to redux

* Update theme actions

* Update fakespot and felt privacy

* Update general browser actions

* Update tab peek action

* More updates

* Update tab actions

* Fix unit tests

* Fix tests

* Remove viewUUID

* Fix comment

* Add missing action handler

* Remove TODO

* Fix private browsing issue

(cherry picked from commit 7032936)

# Conflicts:
#	firefox-ios/Client/Frontend/Fakespot/FakespotViewController.swift
@mergify mergify bot requested a review from a team as a code owner April 30, 2024 13:12
@mergify mergify bot added the conflicts label Apr 30, 2024
Copy link
Contributor Author

mergify bot commented Apr 30, 2024

Cherry-pick of 7032936 has failed:

On branch mergify/bp/release/v126/pr-19823
Your branch is up to date with 'origin/release/v126'.

You are currently cherry-picking commit 703293606.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   BrowserKit/Sources/Redux/Action.swift
	modified:   BrowserKit/Tests/ReduxTests/Utilities/FakeReduxAction.swift
	modified:   BrowserKit/Tests/ReduxTests/Utilities/FakeReduxMiddleware.swift
	modified:   BrowserKit/Tests/ReduxTests/Utilities/FakeReduxState.swift
	modified:   BrowserKit/Tests/ReduxTests/Utilities/FakeReduxViewController.swift
	modified:   firefox-ios/Client/Coordinators/SettingsCoordinator.swift
	modified:   firefox-ios/Client/Frontend/Browser/BrowserViewController/Actions/GeneralBrowserAction.swift
	modified:   firefox-ios/Client/Frontend/Browser/BrowserViewController/Extensions/BrowserViewController+URLBarDelegate.swift
	modified:   firefox-ios/Client/Frontend/Browser/BrowserViewController/State/BrowserViewControllerState.swift
	modified:   firefox-ios/Client/Frontend/Browser/BrowserViewController/Views/BrowserViewController.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Action/RemoteTabsPanelAction.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Action/TabPanelAction.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Action/TabPeekAction.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Action/TabTrayAction.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Middleware/RemoteTabsPanelMiddleware.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Middleware/TabManagerMiddleware.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/State/RemoteTabsPanelState.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/State/TabPeekState.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/State/TabTrayState.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/State/TabsPanelState.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsPanel.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Views/TabDisplayPanel.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Views/TabDisplayView.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Views/TabPeekViewController.swift
	modified:   firefox-ios/Client/Frontend/Browser/Tabs/Views/TabTrayViewController.swift
	modified:   firefox-ios/Client/Frontend/Browser/ToastType.swift
	modified:   firefox-ios/Client/Frontend/Fakespot/FakespotAction.swift
	modified:   firefox-ios/Client/Frontend/Fakespot/FakespotState.swift
	modified:   firefox-ios/Client/Frontend/Fakespot/FakespotViewModel.swift
	modified:   firefox-ios/Client/Frontend/FeltPrivacy/FeltPrivacyMiddleware.swift
	modified:   firefox-ios/Client/Frontend/FeltPrivacy/PrivateModeAction.swift
	modified:   firefox-ios/Client/Frontend/Onboarding/Views/IntroViewController.swift
	modified:   firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsAction.swift
	modified:   firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeMiddleware.swift
	modified:   firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsAction.swift
	modified:   firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsController.swift
	modified:   firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsState.swift
	modified:   firefox-ios/Client/Frontend/Toolbar+URLBar/TabLocationView.swift
	modified:   firefox-ios/Client/Redux/GlobalState/ActiveScreenAction.swift
	modified:   firefox-ios/Client/Redux/GlobalState/ActiveScreenState.swift
	modified:   firefox-ios/Client/TabManagement/TabManagerImplementation.swift
	modified:   firefox-ios/firefox-ios-tests/Tests/ClientTests/Mocks/MockThemeManager.swift
	modified:   firefox-ios/firefox-ios-tests/Tests/ClientTests/Settings/ThemeSettingsControllerTests.swift
	modified:   firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/RemoteTabPanelStateTests.swift
	modified:   firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabDisplayViewTests.swift
	modified:   firefox-ios/firefox-ios-tests/Tests/ClientTests/TabTray/TabsPanelStateTests.swift

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   firefox-ios/Client/Frontend/Fakespot/FakespotViewController.swift

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested review from mattreaganmozilla and removed request for a team April 30, 2024 13:12
@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Apr 30, 2024

Warnings
⚠️ Pull Request size seems relatively large. If this Pull Request contains multiple changes, please split each into separate PR will helps faster, easier review. Consider using epic branches for work that would affect main.
Messages
📖 Project coverage: 32.26%
📖 Edited 47 files
📖 Created 0 files

Client.app: Coverage: 30.82

File Coverage
RemoteTabsPanelAction.swift 100.0%
TabPeekViewController.swift 0.0% ⚠️
TabDisplayView.swift 31.16% ⚠️
PrivateModeAction.swift 0.0% ⚠️
GeneralBrowserAction.swift 0.0% ⚠️
BrowserViewController.swift 4.79% ⚠️
FakespotAction.swift 0.0% ⚠️
TabManagerMiddleware.swift 8.15% ⚠️
TabTrayAction.swift 100.0%
TabsPanelState.swift 54.69%
TabDisplayPanel.swift 16.06% ⚠️
BrowserViewController+URLBarDelegate.swift 2.17% ⚠️
ToastType.swift 0.0% ⚠️
ActiveScreenAction.swift 100.0%
BrowserViewControllerState.swift 0.0% ⚠️
FakespotViewModel.swift 12.21% ⚠️
ThemeSettingsState.swift 70.09%
TabPanelAction.swift 100.0%
TabPeekAction.swift 0.0% ⚠️
FakespotViewController.swift 4.55% ⚠️
TabTrayState.swift 50.0% ⚠️
RemoteTabsPanelMiddleware.swift 23.7% ⚠️
FakespotState.swift 12.5% ⚠️
FeltPrivacyMiddleware.swift 81.82%
TabLocationView.swift 43.13% ⚠️
TabTrayViewController.swift 66.28%
ThemeSettingsController.swift 36.31% ⚠️
RemoteTabsPanel.swift 28.33% ⚠️
TabPeekState.swift 0.0% ⚠️
ThemeMiddleware.swift 69.03%
IntroViewController.swift 41.09% ⚠️
SettingsCoordinator.swift 93.75%
RemoteTabsPanelState.swift 74.07%
TabManagerImplementation.swift 28.9% ⚠️
ThemeSettingsAction.swift 100.0%
ActiveScreenState.swift 75.53%

Generated by 🚫 Danger Swift against a7da71e

@mattreaganmozilla
Copy link
Collaborator

cc @OrlaM

@OrlaM OrlaM merged commit e97d494 into release/v126 Apr 30, 2024
12 checks passed
@OrlaM OrlaM deleted the mergify/bp/release/v126/pr-19823 branch April 30, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants