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

feat: port BrowserViewController - WPB-15927 #2566

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

Conversation

KaterinaWire
Copy link
Contributor

@KaterinaWire KaterinaWire commented Feb 19, 2025

TaskWPB-15927 [iOS] Port BrowserViewController to SwiftUI

Issue

We need to display the SSO login Web page in-app as a modal view, not as a part of the navigation stack.

Solution

We are currently using SFSafariViewController, but will probably want to use [ASWebAuthenticationSession](https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession) in the future. Switching to ASWebAuthenticationSession is not that easy, so I decided to copy BrowserViewController and create a ticket for the future to investigate and decide whether we need/should use ASWebAuthenticationSession.

Testing

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@@ -54,7 +54,8 @@ class DetermineAuthMethodComponent: Component<DetermineAuthMethodComponentDepend
@MainActor var determineAuthMethodView: DetermineAuthMethodView {
DetermineAuthMethodView(
viewModel: viewModel,
builder: loginViaEmailComponent
builder: loginViaEmailComponent,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename this builder?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean, rename it to loginViaEmailBuilder? I would say yes.

Copy link
Contributor

github-actions bot commented Feb 19, 2025

Test Results

34 tests   34 ✅  6s ⏱️
 3 suites   0 💤
 1 files     0 ❌

Results for commit d8d1460.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 19, 2025

Datadog Report

Branch report: feat/port-BrowserViewController-to-SwiftUI-WBP-15927
Commit report: 48779bb
Test service: wire-ios-mono

✅ 0 Failed, 29 Passed, 0 Skipped, 6.7s Total Time

Copy link
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. Personally I'm still not sure about the Router pattern we are using but happy to follow along and see where it leads us.

Copy link
Collaborator

@johnxnguyen johnxnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good but had a few questions

@@ -54,7 +54,8 @@ class DetermineAuthMethodComponent: Component<DetermineAuthMethodComponentDepend
@MainActor var determineAuthMethodView: DetermineAuthMethodView {
DetermineAuthMethodView(
viewModel: viewModel,
builder: loginViaEmailComponent
builder: loginViaEmailComponent,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean, rename it to loginViaEmailBuilder? I would say yes.

Copy link
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Copy link
Collaborator

@johnxnguyen johnxnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants