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

PM-16153: Draw new login action card #1238

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

Conversation

ezimet-livefront
Copy link
Collaborator

@ezimet-livefront ezimet-livefront commented Jan 6, 2025

🎟️ Tracking

PM-16153

📔 Objective

  • Adds Learn New login Action Card.

📸 Screenshots

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.57%. Comparing base (c8412de) to head (bd73cc6).
Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1238   +/-   ##
=======================================
  Coverage   89.57%   89.57%           
=======================================
  Files         709      709           
  Lines       45082    45125   +43     
=======================================
+ Hits        40382    40421   +39     
- Misses       4700     4704    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 158 to 161
let isLearnNewLoginCardShown = await services.stateService.getLearnNewLoginActionCardShown()
let accountCount = try? await services.stateService.getAccounts().count
let isVaultEmpty = try? await services.vaultRepository.isVaultEmpty()
let shouldShowLearnNewLoginActionCard = !isLearnNewLoginCardShown && isVaultEmpty == true && accountCount == 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we want to show this action card for new users only, not returning users, I came up with this checks, if you have better suggestions I am all open for it, even for moving this check to a service, tried to put this in StateService, but can't do it because of CipherService rely on StateService.

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Logo
Checkmarx One – Scan Summary & Detailsddd46fee-4dc5-4b77-b325-5e3e93c5300a

No New Or Fixed Issues Found

@ezimet-livefront ezimet-livefront marked this pull request as ready for review January 6, 2025 20:43
Copy link
Member

@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

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

🤔 Should the card be shown in iOS extensions flows?

@@ -608,6 +608,7 @@ class DefaultAuthService: AuthService { // swiftlint:disable:this type_body_leng
try await stateService.setAccountSetupImportLogins(.incomplete)
}
try await stateService.setAccountSetupVaultUnlock(.incomplete)
await stateService.setLearnNewLoginActionCardStatus(.eligible)
Copy link
Collaborator

Choose a reason for hiding this comment

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

❓ Should this action card appear only appear for the first new account created on a device or any new account created? If I've already seen/completed the walkthrough and I add a new account, should this overwrite the existing status?

Copy link
Member

@fedemkr fedemkr Jan 7, 2025

Choose a reason for hiding this comment

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

Additionally, this is only taking into consideration login in with master password. The user could login with other means like SSO, TDE or Device.

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 we only want to set this when creating a new account as opposed to logging into an existing account, which is why it was done here. I suppose you could use SSO + JIT to create a new account though? Do we know in the app though if signing into SSO created a new account or does that happen seamlessly in the backend?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

❓ Should this action card appear only appear for the first new account created on a device or any new account created? If I've already seen/completed the walkthrough and I add a new account, should this overwrite the existing status?

I think it should not overwrite the existing status.

Copy link
Member

@fedemkr fedemkr Jan 7, 2025

Choose a reason for hiding this comment

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

🤔 From what I can see on the Jira ticket:

Given I am a first-time user creating a new login item

I understand it as either as I've just created an account on mobile, or I've created it elsewhere and I'm logging in the mobile app and want to start adding logins. Could we ask someone to confirm the scope of this?

BitwardenShared/UI/Vault/Vault/VaultCoordinator.swift Outdated Show resolved Hide resolved
BitwardenShared/UI/Vault/Vault/VaultCoordinator.swift Outdated Show resolved Hide resolved
@ezimet-livefront ezimet-livefront added the hold This shouldn't be merged yet label Jan 7, 2025
@ezimet-livefront
Copy link
Collaborator Author

🤔 Should the card be shown in iOS extensions flows?

I added this check.

BitwardenShared/UI/Vault/Vault/VaultCoordinatorTests.swift Outdated Show resolved Hide resolved
Comment on lines +117 to +121
if await services.configService.getFeatureFlag(.nativeCreateAccountFlow),
appExtensionDelegate == nil {
self.state.isLearnNewLoginActionCardEligible = await services.stateService
.getLearnNewLoginActionCardStatus() == .incomplete
}
Copy link
Member

Choose a reason for hiding this comment

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

🤔 Shouldn't this be done in perform -> appeared? Additionally the if !state.configuration.isAdding is not meant to be done inside the Task. Can't say for sure that it will match the same behavior as before so I wouldn't change that part.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if we do it in appeared, it would slide in the action card after the view has appeared.
as far as configuration.isAdding I don't see why it will not match the same behavior, the original code was like this:

if !state.configuration.isAdding {
     Task {
           await self.services.rehydrationHelper.addRehydratableTarget(self)
      }
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tested doing it on appear? I think that's what we're doing on other views that show the action card and I don't recall it being an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold This shouldn't be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants