Skip to content

Conversation

@adhiamboperes
Copy link
Collaborator

@adhiamboperes adhiamboperes commented Jun 2, 2025

Explanation

Fixes part of #4938

This PR creates the introduction screen, where the user is informed about what it means to be an admin.

In #5378, the "I am a parent/Teacher" option previously routed to the profiles list screen, since admin onboarding had not yet been implemented. In this PR, the option leads to the admin creating their profile nickname, followed by viewing the newly introduced introduction screen. The steps are ordered this way for consistency with the learner onboarding flow.

In #5387, supervisor profile onboarding was marked as started on the profile type screen and ended on the home screen. This workaround has now been updated so that supervisor onboarding starts on the introduction screen (similar to the learner flow). This means that if the user abandons onboarding at this point, they will resume the flow from the introduction screen when they reopen the app. Admin onboarding is marked as completed on the profile chooser screen.

This PR also ensures that the onboarding event logs are refactored accordingly, and tests have been updated to verify the refactor.

Additionally, testFragment_profileTypeArgumentMissing_showsUnknownProfileTypeError() has been removed from CreateProfileFragmentTest.kt because this condition will never be hit, due to a new check that verifies ProfileType is not null when a CreateProfileActivity intent is created.

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing
Landscape Portrait
Screenshot_1751638663 Screenshot_1751637334
Screenshot_1751640466 Screenshot_1751639602
https://github.com/user-attachments/assets/b1dd5108-f439-4817-bdab-40f676f86d75 https://github.com/user-attachments/assets/c4cf5c05-722d-4d5a-baca-15752cc7b3ee
tablet landscape tablet_portrait
event_logs.webm Screenshot_1758651952

@github-actions
Copy link

Coverage Report

Results

Number of files assessed: 23
Overall Coverage: 75.28%
Coverage Analysis: PASS

Passing coverage

Files with passing code coverage
File Coverage Lines Hit Status Min Required
EventBundleCreator.ktutility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
75.28% 338 / 449 70%

Exempted coverage

Files exempted from coverage
File Exemption Reason
ActivityComponentImpl.ktapp/src/main/java/org/oppia/android/app/activity/ActivityComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
ProfileChooserFragment.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ProfileChooserFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
ProfileChooserActivity.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserActivity.kt
This file is exempted from having a test file; skipping coverage check.
ProfileChooserActivityPresenter.ktapp/src/main/java/org/oppia/android/app/profile/ProfileChooserActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
HomeFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/home/HomeFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
HomeActivity.ktapp/src/main/java/org/oppia/android/app/home/HomeActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
SplashActivity.ktapp/src/main/java/org/oppia/android/app/splash/SplashActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
SplashActivityPresenter.ktapp/src/main/java/org/oppia/android/app/splash/SplashActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
CreateProfileFragment.ktapp/src/main/java/org/oppia/android/app/onboarding/CreateProfileFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
AdminIntroActivityPresenter.ktapp/src/main/java/org/oppia/android/app/onboarding/AdminIntroActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
OnboardingProfileTypeFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
CreateProfileActivity.ktapp/src/main/java/org/oppia/android/app/onboarding/CreateProfileActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
AdminIntroFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/onboarding/AdminIntroFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
WavyBackgroundView.ktapp/src/main/java/org/oppia/android/app/onboarding/WavyBackgroundView.kt
This file is exempted from having a test file; skipping coverage check.
CreateProfileFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/onboarding/CreateProfileFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
AdminIntroFragment.ktapp/src/main/java/org/oppia/android/app/onboarding/AdminIntroFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
AdminIntroActivity.ktapp/src/main/java/org/oppia/android/app/onboarding/AdminIntroActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
OnboardingProfileTypeFragment.ktapp/src/main/java/org/oppia/android/app/onboarding/OnboardingProfileTypeFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
ClassroomListFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/classroom/ClassroomListFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
ClassroomListFragment.ktapp/src/main/java/org/oppia/android/app/classroom/ClassroomListFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

@oppiabot
Copy link

oppiabot bot commented Sep 23, 2025

Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 23, 2025
@adhiamboperes adhiamboperes removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 23, 2025
Base automatically changed from redesign-pin-input to develop September 23, 2025 17:10
# Conflicts:
#	app/src/main/AndroidManifest.xml
#	app/src/main/java/org/oppia/android/app/activity/ActivityComponentImpl.kt
#	app/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
#	app/src/main/java/org/oppia/android/app/profile/ProfileChooserActivityPresenter.kt
#	app/src/main/res/values/strings.xml
#	model/src/main/proto/screens.proto
#	utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
@adhiamboperes
Copy link
Collaborator Author

Thanks for your initial review @subhajitxyz! I addressed your comments. However, there have been a lot of refactors since your review, and I appreciate that you might not have time to review a second time due to being on a break.

@BenHenning, PTAL.

@oppiabot
Copy link

oppiabot bot commented Sep 30, 2025

Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 30, 2025
@oppiabot oppiabot bot closed this Oct 7, 2025
@adhiamboperes adhiamboperes reopened this Oct 7, 2025
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 7, 2025
@oppiabot
Copy link

oppiabot bot commented Oct 14, 2025

Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 14, 2025
@oppiabot oppiabot bot closed this Oct 21, 2025
@adhiamboperes adhiamboperes reopened this Oct 29, 2025
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Oct 29, 2025
@BenHenning
Copy link
Member

Apologies--will try to look at this early next week. Feel free to send me more chained PRs as well if that helps.

@oppiabot
Copy link

oppiabot bot commented Nov 7, 2025

Hi @adhiamboperes, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 7, 2025
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @adhiamboperes! Took a full pass and had just a few comments--PTAL.

if (enableOnboardingFlowV2.value) {
when {
profileType == ProfileType.SUPERVISOR && profile.numberOfLogins == 1 -> {
// Supervisors end profile onboarding on the profiles list screen, but they do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Supervisors end profile onboarding on the profiles list screen, but they do
// Supervisors end profile onboarding on the profiles list screen, but they do

Small nit.

import androidx.compose.ui.unit.dp
import kotlin.math.sin

/** Adds a bezier curve background to a view. */
Copy link
Member

Choose a reason for hiding this comment

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

Slight nit maybe, but is this actually a bezier curve? It appears to be a sine wave, instead.

ProfileType.SUPERVISOR -> launchProfileChooserScreen()
else -> {}
}
else -> launchOnboardingActivity()
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should combine them together so that the else cases are impossible? I do worry a bit about the else cases since they would make the user stuck, I think.

@@ -0,0 +1,7 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<androidx.compose.ui.platform.ComposeView
Copy link
Member

Choose a reason for hiding this comment

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

For this & app/src/main/res/layout/admin_intro_activity.xml these should be two-space indented.

@Test
fun testIntroFragment_onLaunch_landscapeMode_allViewsAreCorrectlyDisplayed() {
launch(AdminIntroActivity::class.java).use {
onView(ViewMatchers.isRoot()).perform(orientationLandscape())
Copy link
Member

Choose a reason for hiding this comment

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

This test should start in landscape using a qualifier rather than rotating (since rotating isn't 100% reliable in Robolectric).

Also, shouldn't this verify that the step count isn't visible since that's orientation-specific logic?

@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Nov 9, 2025
@oppiabot
Copy link

oppiabot bot commented Nov 9, 2025

Unassigning @BenHenning since the review is done.

@oppiabot
Copy link

oppiabot bot commented Nov 9, 2025

Hi @adhiamboperes, it looks like some changes were requested on this pull request by @BenHenning. PTAL. Thanks!

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.

5 participants