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

[Device management] Update the unknown verification status icon (PSG-824) #7361

Merged

Conversation

mnaturel
Copy link
Contributor

@mnaturel mnaturel commented Oct 13, 2022

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Update the UI to handle verification status of other sessions when the current one is not verified.

Motivation and context

Closes #7327

Screenshots / GIFs


Tests

  • Signin to a new session
  • Enable the lab flag for the new session manager
  • Go to Settings -> Security & Privacy -> Show all sessions
  • Check the unverified sessions section does not show in security recommendations
  • Check the other session list items display a correct UI
  • Go to the session overview of another session
  • Check the UI is correct
  • Verify the current session
  • Check the unverified sessions section shows in security recommendations if there are any unverified sessions
  • Check the other session list items display a correct UI
  • Go to the session overview of another session
  • Check the UI is correct

Tested devices

  • Physical
  • Emulator
  • OS version(s): Android 11

Checklist

@mnaturel mnaturel added the Z-NextRelease For issues and PRs which should be included in the NextRelease. label Oct 13, 2022
@mnaturel mnaturel marked this pull request as ready for review October 14, 2022 07:40
@mnaturel mnaturel requested review from a team and fedrunov and removed request for a team October 14, 2022 07:56
@bmarty bmarty requested review from bmarty and removed request for fedrunov October 14, 2022 08:08
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.

LGTM, just 2 remarks.

if (unverifiedSessionsCount == 0 && inactiveSessionsCount == 0) {
hideSecurityRecommendations()
} else {
views.deviceListHeaderSectionSecurityRecommendations.isVisible = true
views.deviceListSecurityRecommendationsDivider.isVisible = true
views.deviceListUnverifiedSessionsRecommendation.isVisible = unverifiedSessionsCount > 0

views.deviceListUnverifiedSessionsRecommendation.isVisible = unverifiedSessionsCount > 0 && isCurrentSessionVerified
Copy link
Member

Choose a reason for hiding this comment

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

Could be nice to start using Paparazzi to test the different state of the View.
There is an example in PaparazziExampleScreenshotTest and a doc screenshot_testing.md is the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we will plan it. For now, the screens are still subject to change. Once the feature is stable, we will add some tests.

<path
android:strokeWidth="1"
android:pathData="M12.008,23.487C12.005,23.487 12.002,23.488 12,23.489C11.998,23.488 11.995,23.487 11.992,23.487C11.92,23.471 11.813,23.445 11.675,23.409C11.399,23.337 11.002,23.223 10.523,23.058C9.565,22.725 8.292,22.186 7.022,21.361C4.49,19.715 2,16.954 2,12.405V3.45L12,0.521L22,3.45V12.405C22,16.954 19.51,19.715 16.978,21.361C15.708,22.186 14.435,22.725 13.477,23.058C12.998,23.223 12.601,23.337 12.325,23.409C12.187,23.445 12.08,23.471 12.008,23.487Z"
android:fillColor="#737D8C"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe define and use a new color for this new shield as per https://github.com/vector-im/element-android/blob/main/library/ui-styles/src/main/res/values/colors.xml#L142
Also update line 14 and file ic_shield_unknown_no_border.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the new color resource but I had to enable backward compatibility for API < 24 (see https://developer.android.com/develop/ui/views/graphics/vector-drawable-resources#vector-drawables-backward-solution). The update: cf25b81

@mnaturel mnaturel requested a review from bmarty October 14, 2022 12:02
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/shield_color_unknown"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Backward lib compatibility has been enabled in vector module to avoid that, we should not have a warning here.

android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/shield_color_unknown"

Choose a reason for hiding this comment

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

  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable
  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable

android:strokeWidth="1"
android:strokeColor="#ffffff" />
<path
android:fillColor="@color/shield_color_unknown"

Choose a reason for hiding this comment

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

  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable
  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable

android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/shield_color_unknown"

Choose a reason for hiding this comment

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

  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable
  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable

android:strokeWidth="1"
android:strokeColor="#ffffff" />
<path
android:fillColor="@color/shield_color_unknown"

Choose a reason for hiding this comment

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

  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable
  • ⚠️ Resource references will not work correctly in images generated for this vector icon for API < 24; check generated icon to make sure it looks acceptable

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!

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

42.1% 42.1% Coverage
0.0% 0.0% Duplication

@mnaturel mnaturel merged commit 612d2e5 into develop Oct 14, 2022
@mnaturel mnaturel deleted the feature/mna/device-manager-unknown-verification-status branch October 14, 2022 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-NextRelease For issues and PRs which should be included in the NextRelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Device management] Update the unknown verification status icon
3 participants