Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Refactor riskcard & states; Chapter1 (EXPOSUREAPP-4049, EXPOSUREAPP-3834) #1751

Merged
merged 19 commits into from
Nov 30, 2020

Conversation

d4rken
Copy link
Member

@d4rken d4rken commented Nov 27, 2020

  • Removed RiskLevelConstants which we not useful anymore and just unnecessary complicated
  • Simplified RiskLevel to RiskState which just has 3 states now INCREASED_RISK, LOW_RISK, FAILED
  • Simplified state behavior of the risk cards on the homescreen.
    • Disabled tracing overrides all other cards, as it's a current state we want the user to fix
    • Otherwise if the last calculation failed (for any reason), we show the "tracing failed" card
    • If the last calculation did not fail we display either a high or low risk card

TODO

  • No data yet, fresh install, airplane mode, manually press "restart", card seems to be just empty (light mode)
  • No data yet, fresh install, airplane mode, manually press "restart", card seems to be just empty, now enable WIFI, card is empty then green card appears (light mode)
  • Tracing disabled, light mode, divider is missing or invisible
  • Missing "contacts" when displaying low risk card
  • Negative days when time traveling backwards
  • Remove "minimum tracing time active" restrictions which should be removed according to EXPOSUREAPP-3051 (moved to extra PR Remove minimum tracing time requirement (EXPOSUREAPP-3051) #1762)

Testing

  • Make sure all 4 cards look correct (compare with figma, though it's not 100% current)
    • Red card (high rish)
    • Green card (low risk)
    • Tracing stopped
    • Tracing failed
  • Check all designs in dark mode too

@d4rken d4rken added bug Something isn't working enhancement Improvement of an existing feature maintainers Tag pull requests created by maintainers labels Nov 27, 2020
@d4rken d4rken added this to the 1.8.0 milestone Nov 27, 2020
@d4rken d4rken requested a review from a team November 27, 2020 17:30
@d4rken d4rken marked this pull request as draft November 27, 2020 17:51
@d4rken d4rken changed the title Refactor riskcard & states; Chapter1 (EXPOSUREAPP-4049) Refactor riskcard & states; Chapter1 (EXPOSUREAPP-4049, EXPOSUREAPP-3834) Nov 28, 2020
@d4rken d4rken marked this pull request as ready for review November 29, 2020 21:16
@chiljamgossow chiljamgossow self-assigned this Nov 30, 2020
Copy link
Contributor

@chiljamgossow chiljamgossow left a comment

Choose a reason for hiding this comment

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

Left some suggestions on how to make is easier to understand

@@ -26,28 +29,26 @@ data class TracingDetailsState(
* in all cases when risk level is not increased
*/
fun isBehaviorNormalVisible(): Boolean =
riskLevelScore != RiskLevelConstants.INCREASED_RISK
riskState != INCREASED_RISK
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why we do not simply call it HIGH_RISK? (independent of the wording we use to display it to the user) As far as I understand, it's either low = green or high = red

Copy link
Member Author

Choose a reason for hiding this comment

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

I had it previously named like that and @harambasicluka expressed the desire to keep it INCREASED_RISK.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wanted to have it consistently used in our app and as I think it's called increased risk in the protobuff files and since the beginning I would stick to increased risk.

)

val isRestartButtonEnabled = !isBackgroundJobEnabled || latestCalc.riskState == RiskState.CALCULATION_FAILED
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here isBackgroundJosDisabled instead of negation

Copy link
Member Author

Choose a reason for hiding this comment

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

Then we would have to negate isAutoModeEnabled and negate it again in other places.

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about having both, like val isBackgroundJobDisabled with get() =!isBackgroundJobEnabled, but it's just a suggestion

# Conflicts:
#	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/RiskLevelChangeDetector.kt
Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

Coding LGTM, just one question, we did you choose such a dramatic title with: ... Chapter1? :D

Will do device testing.

@d4rken
Copy link
Member Author

d4rken commented Nov 30, 2020

Coding LGTM, just one question, we did you choose such a dramatic title with: ... Chapter1? :D

The implementation is still not where it should be. It's still one multipurpose card doing everything, and I want to have separate cards and layouts, the home screen should be using a list with dynamic elements. Time did not allow me yet to do this, so Chapter 2: RiskCards strike back! ™️ 😉.

Copy link
Contributor

@ralfgehrer ralfgehrer left a comment

Choose a reason for hiding this comment

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

Did some serious device testing! Great work. Works very smoothly.

@harambasicluka harambasicluka self-assigned this Nov 30, 2020
@harambasicluka
Copy link
Contributor

Is this a typo?
Begegnungen an 1 Tag mit erhöhtem Risiko

I would suggest Begegnungen an einem Tag mit erhöhtem Risiko <- also this sounds strange

image

@harambasicluka
Copy link
Contributor

I now have a flickering when navigating from home to risk details as the download tries to start.

As it's converted to a gif you only see the loading indicator as I navigate from home to details, but I see it one device every time.

flickering_low_risk (1)

@sonarcloud
Copy link

sonarcloud bot commented Nov 30, 2020

Kudos, SonarCloud Quality Gate passed!

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

70.2% 70.2% Coverage
0.0% 0.0% Duplication

@harambasicluka
Copy link
Contributor

I deactivated wifi during downloading got in the correct state, also disabled tracing and this was visible. Then I enabled tracing and wifi and the download started. as it was showing the download it turned from the failure to green, but still was in the loading state and displaying that it's downloading and the second state of the loading state for the calculation was visible but seemed to be executes.

Copy link
Contributor

@harambasicluka harambasicluka left a comment

Choose a reason for hiding this comment

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

have noted down some follow up tasks:

  • card flickering: tracingrepository.refreshRisklevel
  • color change before apparent risk calculation
  • string singular high risk

@harambasicluka harambasicluka merged commit 7ce4be5 into release/1.8.x Nov 30, 2020
@harambasicluka harambasicluka deleted the fix/4049-refactor-riskcards branch November 30, 2020 17:14
@vaubaehn
Copy link
Contributor

vaubaehn commented Dec 1, 2020

@harambasicluka

Is this a typo?
Begegnungen an 1 Tag mit erhöhtem Risiko

I would suggest Begegnungen an einem Tag mit erhöhtem Risiko <- also this sounds strange

image

I would propose:
'An 1 Tag Begegnungen mit erhöhtem Risiko'
Or
'An einem Tag Begegnungen mit erhöhtem Risiko'
Or
'Sie hatten an einem Tag Begegnungen mit erhöhtem Risiko'

OT: What is the beautiful 'Corona-C' inside the snackstatusbar in the screenshot? ForegroundService? Looks nice!

@harambasicluka
Copy link
Contributor

@harambasicluka

Is this a typo?
Begegnungen an 1 Tag mit erhöhtem Risiko
I would suggest Begegnungen an einem Tag mit erhöhtem Risiko <- also this sounds strange
image

I would propose:
'An 1 Tag Begegnungen mit erhöhtem Risiko'
Or
'An einem Tag Begegnungen mit erhöhtem Risiko'
Or
'Sie hatten an einem Tag Begegnungen mit erhöhtem Risiko'

Thank's for your proposal, we currently discussing it with our User Assistance colleagues :) But I think we'll stick to the structure, even if I would prefer your idea :)

OT: What is the beautiful 'Corona-C' inside the snackstatusbar in the screenshot? ForegroundService? Looks nice!

It's one of our notifications, so that's one of my test devices not sure if I got an reminder to update the more more frequently or my risk changed from low to high :) Both is already in production ;)

@vaubaehn
Copy link
Contributor

vaubaehn commented Dec 1, 2020

@harambasicluka

we currently discussing it with our User Assistance colleagues :) But I think we'll stick to the structure

Let's see, I found UA being quite exact wrt language, maybe they'll also see the need for a change :)

OT: What is the beautiful 'Corona-C' inside the snackstatusbar in the screenshot? ForegroundService? Looks nice!

It's one of our notifications, so that's one of my test devices not sure if I got an reminder to update the more more frequently or my risk changed from low to high :) Both is already in production ;)

Ha, never saw a notification yet, that's why I d didn't get it immediately ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working enhancement Improvement of an existing feature maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants