8000 PM-10639: Implement conditional logic for showing the intro carousel by matt-livefront · Pull Request #804 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-10639: Implement conditional logic for showing the intro carousel #804

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

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

matt-livefront
Copy link
Collaborator
@matt-livefront matt-livefront commented Aug 7, 2024

🎟️ Tracking

PM-10639

📔 Objective

Adds the logic to determine when to show the intro carousel. If the feature is enabled, and there's no accounts on the device, the intro carousel should be shown on app launch. Once the user successfully creates an account or logs in, the carousel won't be shown on future app launches.

⏰ 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

let isCarouselEnabled: Bool = await services.configService.getFeatureFlag(.nativeCarouselFlow)
let introCarouselShown = await services.stateService.getIntroCarouselShown()
if isCarouselEnabled, !introCarouselShown {
await services.stateService.setIntroCarouselShown(true)
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 If I'm understanding this correctly, we will also only show the carousel the first time the app is launched. So even if someone doesn't log in or create an account, they won't see it a second time. Just want to make sure this is intended behavior, as I feel the ticket is a bit ambiguous on this; and the PR summary indicates that it's only keyed to having accounts on the device, implying that it should pop up each time until a user successfully logs in or creates an account.

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 will also only show the carousel the first time the app is launched. So even if someone doesn't log in or create an account, they won't see it a second time

The completeAuthRedirect() method is only called once someone has successfully logged in or created an account right before the vault is shown. So if the app is launched and you see the carousel, but you don't log in or create an account, we wouldn't get here and then you would still see it on subsequent app launches until an account is added.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense, was just making sure!

Copy link
Contributor
github-actions bot commented Aug 7, 2024

Logo
Checkmarx One – Scan Summary & Details466335e6-4520-4fbf-99dd-db4e2cf94f47

No New Or Fixed Issues Found

Copy link
codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.22%. Comparing base (f660936) to head (87cdc66).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #804   +/-   ##
=======================================
  Coverage   88.21%   88.22%           
=======================================
  Files         581      581           
  Lines       29373    29390   +17     
=======================================
+ Hits        25911    25928   +17     
  Misses       3462     3462           

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

KatherineInCode
KatherineInCode previously approved these changes Aug 8, 2024
@matt-livefront
Copy link
Collaborator Author

I made one other change here to set the carousel shown flag on app startup if there's existing accounts, to prevent existing users from seeing the carousel. The logic in completeAuthRedirect() was meant to handle both existing accounts completing auth (vault unlock) and new logins / accounts. But for an existing user with never lock, that method is skipped, so the carousel shown flag wasn't being set.

@matt-livefront matt-livefront merged commit e262003 into main Aug 9, 2024
8 checks passed
@matt-livefront matt-livefront deleted the matt/PM-10639-carousel-conditions branch August 9, 2024 16:27
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
0