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

FTUE - Choose a display picture #5323

Merged
merged 20 commits into from
Mar 7, 2022
Merged

Conversation

ouchadam
Copy link
Contributor

@ouchadam ouchadam commented Feb 23, 2022

Type of change

  • WIP Feature
  • Bugfix
  • Technical
  • Other :

Content

Depends on #5211

Introduces a profile picture personalisation screen to the onboarding flow

  • Also extracts and tests the uri filename resolver since I was in the area

Motivation and context

To allow users to change their profile picture during the account creation
Part of #5200

Screenshots / GIFs

TINY TALL TABLET GIF
Screenshot_20220223_154259 profile-tall profile-tablet after-profile-picture

Tests

  • With the personalisation feature flag enabled
  • Create a new account

Tested devices

  • Physical
  • Emulator
  • OS version(s):

@ouchadam ouchadam added the Z-FTUE Issue is relevant to the first time use project or experience label Feb 23, 2022
@github-actions
Copy link

github-actions bot commented Feb 23, 2022

Unit Test Results

  96 files  +  4    96 suites  +4   1m 18s ⏱️ +12s
172 tests +10  172 ✔️ +10  0 💤 ±0  0 ±0 
564 runs  +40  564 ✔️ +40  0 💤 ±0  0 ±0 

Results for commit 3a2dea2. ± Comparison against base commit dd0d2e8.

This pull request removes 2 and adds 12 tests. Note that renamed tests count towards both.
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ given failure when handling display name updates action then emits failure event
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ when handling display name updates action then updates user display name and emits name updated event
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ given a selected picture when handling save selected profile picture then updates upstream avatar and completes personalization
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ given no selected picture when saving selected profile picture then emits failure event
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ given upstream failure when handling display name update then emits failure event
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ given upstream update avatar fails when saving selected profile picture then emits failure event
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ when handling display name update then updates upstream user display name
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ when handling profile picture selected then updates selected picture state
im.vector.app.features.onboarding.OnboardingViewModelTest ‑ when handling profile picture skipped then completes personalization
im.vector.app.features.onboarding.UriFilenameResolverTest ‑ given a non content schema Uri when querying file name then returns last segment
im.vector.app.features.onboarding.UriFilenameResolverTest ‑ given a non hierarchical Uri when querying file name then is null
im.vector.app.features.onboarding.UriFilenameResolverTest ‑ given content schema Uri with backing content when querying file name then returns display name column
…

♻️ This comment has been updated with latest results.

@github-actions
Copy link

Matrix SDK

Integration Tests Results:

  • [org.matrix.android.sdk.session]
    passed=
  • [org.matrix.android.sdk.account]
    passed=
  • [org.matrix.android.sdk.internal]
    passed=
  • [org.matrix.android.sdk.ordering]
    passed=
  • [org.matrix.android.sdk.PermalinkParserTest]
    passed=

Base automatically changed from feature/adm/choose-display-name to develop March 2, 2022 17:59
- cases for the personalisation and display name actions
- cases for the personalisation and display name actions
- moves the personalisation state to a dedicated model to allow for back and forth state restoration
- this toolbar will fade in with the fragment as it sits at the fragment level, probably worth revisiting once more pages have a toolbar
- also makes the avatar itself clicking, including a foreground ripple
@ouchadam ouchadam force-pushed the feature/adm/choose-display-picture branch from 2ed1491 to 6b04efd Compare March 3, 2022 10:58
@ouchadam ouchadam marked this pull request as ready for review March 3, 2022 10:58
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for adding all those tests!
A few remarks, but that's great work! Thanks!

<?xml version="1.0" encoding="utf-8"?>
<resources>
<item name="ftue_auth_profile_picture_height" format="float" type="dimen">0.15</item>
<item name="ftue_auth_profile_picture_icon_height" format="float" type="dimen">0.05</item>
Copy link
Member

Choose a reason for hiding this comment

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

Those 2 values are the same than in default resource, is it a mistake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah great catch 👀 ! they can be deleted, they were separated whilst checking with design about the different screen sizes, we chose to maintain the same % of screen for small screens and allow the entire avatar to be clickable instead of making the image bigger

Copy link
Contributor Author

Choose a reason for hiding this comment

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

setState { copy(asyncDisplayName = Success(Unit)) }
setState {
copy(
asyncDisplayName = Success(Unit),
Copy link
Member

Choose a reason for hiding this comment

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

Can't it be asyncDisplayName = Success(displayName) instead of storing the value in personalizationState. The remark is also applicable to selectedPictureUri I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a good point, at the moment those asyncs are only being used for showing/hiding the loading view, in Login2 they're replaced with a single isLoading: Boolean, I was thinking of doing the same but wanted to do all the asyncs at the same time

WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

That sounds like a plan! OK for me. What I want to avoid is having multiple sources of truth.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will raise a PR for it 💯

app:layout_constraintTop_toTopOf="@id/pos"
app:tint="?vctr_content_secondary">

</ImageView>
Copy link
Member

Choose a reason for hiding this comment

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

Could use /> for empty tag block :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -34,10 +35,13 @@ class FakeSession(
mockkStatic("im.vector.app.core.extensions.SessionKt")
}

override val myUserId: String = "a-user-id"
Copy link
Member

Choose a reason for hiding this comment

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

I am wondering if we should have a valid userId here like @fake:server.fake. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds great to me! makes me wonder if a dedicated type for UserId or MatrixId could be helpful (might raise a ticket for a value class PoC)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah it already exists #3633

deec923 for the value update

@bmarty bmarty self-requested a review March 7, 2022 14:05
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update. I let you merge it!

@ouchadam ouchadam enabled auto-merge (squash) March 7, 2022 14:07
@ouchadam ouchadam disabled auto-merge March 7, 2022 14:07
@ouchadam ouchadam merged commit 9a02543 into develop Mar 7, 2022
@ouchadam ouchadam deleted the feature/adm/choose-display-picture branch March 7, 2022 14:07
onurays added a commit that referenced this pull request Mar 8, 2022
* develop: (392 commits)
  Missing import of at-Ignore annotation.
  FTUE - Choose a display picture (#5323)
  Ignore ThreadMessagingTest as it seems to cause other integration tests to fail.
  Maybe the file is here?
  I give up for the weekend
  Frustration at artifact handling vs what's in docs.
  Update the top bar in a room (#5213)
  Tweak upload/download of codecov xml file
  Address review points from adam
  Remove unneeded code, retaining a comment for how to exclude certain projects
  Merge pull request #5405 from vector-im/cgizard/ISSUE-5402
  Remove the printing of file name to the log as it's doubling up information.
  Remove exclusions (for now).
  Fix typo in name of action
  giving avatar/display name error dialogs human readable error messages - reuses the ErrorDialog logic which translates exceptions to human readable strings
  Run codecoverage and pass to sonarqube upload for processing.
  Better codecov based on ouchadam's suggestion
  Correct name of environment variable
  Use environment variable that is tied to project property
  Merge pull request #4498 from vector-im/yostyle/fix_strandhogg
  ...

# Conflicts:
#	vector/src/main/java/im/vector/app/features/home/room/detail/timeline/action/MessageActionsViewModel.kt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-FTUE Issue is relevant to the first time use project or experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants