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

T374012 #5204

Open
wants to merge 8 commits into
base: temp-accounts
Choose a base branch
from
Open

T374012 #5204

wants to merge 8 commits into from

Conversation

l-olson1214
Copy link
Collaborator

@l-olson1214 l-olson1214 commented Feb 19, 2025

Phabricator:
https://phabricator.wikimedia.org/T374012

Notes

  • Updated navigation bar
  • Update to use coordinator

Test Steps

  1. Using a temporary account, Test language
  2. Navigate to article
  3. Press pencil button (unlocked)
  4. Make sure temporary account sheet shows, press Done
  5. Ensure the temporary account icon shows, tap it
  6. Ensure temporary account sheet shows
  7. Repeat steps with IP account

Screenshots/Videos

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-02-19.at.16.08.26.mp4
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2025-02-19.at.15.59.21.mp4

@l-olson1214 l-olson1214 requested review from a team and mazevedofs and removed request for a team February 19, 2025 21:10
@tonisevener tonisevener requested review from tonisevener and removed request for mazevedofs March 3, 2025 15:16
@l-olson1214 l-olson1214 mentioned this pull request Mar 3, 2025
Copy link
Collaborator

@tonisevener tonisevener left a comment

Choose a reason for hiding this comment

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

Looking good! Just a few things.

@@ -0,0 +1,15 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you aren't using these new icon assets anymore. Can you delete them?


private lazy var temporaryAccountNoticesButton: UIBarButtonItem = {
let button = UIBarButtonItem(image: WMFIcon.temp, style: .plain, target: self, action: #selector(temporaryAccount(_ :)))
button.accessibilityLabel = CommonStrings.editNotices
Copy link
Collaborator

Choose a reason for hiding this comment

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

Accessibility label looks wrong here.

}()

private lazy var ipAccountNoticesButton: UIBarButtonItem = {
let button = UIBarButtonItem(image: WMFSFSymbolIcon.for(symbol: .temporaryAccountIcon), style: .plain, target: self, action: #selector(ipAccount(_ :)))
button.accessibilityLabel = CommonStrings.editNotices
Copy link
Collaborator

Choose a reason for hiding this comment

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

Accessibility label looks wrong here.

import WMFData
import CocoaLumberjackSwift

@objc(TempAccountSheetCoordinator)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can remove this @objc line and the NSObject superclass if you do not need to call this class from Objective-C.

return String.localizedStringWithFormat(format, tempUsername, openingBold, closingBold, openingLink, closingLink, lineBreaks, openingLinkLearnMore)
}

private func presentIPEditorSheet(_ presentEditorAction: @escaping () -> Void) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this presentEditorAction parameter is called, you can remove it.

return "https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Temporary_accounts?uselang=\(languageCodeSuffix)#Who_can_see_IP_address_data_associated_with_temporary_accounts?"
}

private func presentTempEditorSheet(_ presentEditorAction: @escaping () -> Void) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this presentEditorAction parameter is called, you can remove it.

},
guard let navigationController else { return }

let tempAccountsCoordinator = TempAccountSheetCoordinator(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I notice that when logged into a permanent account, the "You are not logged in" modal still appears here. So I think you do still need the check for authStateIsPermanent here before kicking off the coordinator:

       if !authManager.authStateIsPermanent {
           let tempAccountsCoordinator = TempAccountSheetCoordinator(
               navigationController: navigationController,
               theme: theme,
               dataStore: dataStore,
               didTapDone: { [weak self] in
                   self?.dismiss(animated: true)
                   presentEditorAction()
               },
               isTempAccount: authManager.authStateIsTemporary
           )
           
           tempAccountsCoordinator.start()
       } else {
           presentEditorAction()
       }

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

Successfully merging this pull request may close these issues.

2 participants