-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Making the "Ready to Send" screen more actionable #5693
Conversation
8226f0f
to
e7fdc1d
Compare
# Forms ready to send banner | ||
############################################## | ||
--> | ||
<string name="last_form_sent_seconds_ago">Last form sent: %d second(s) ago</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could have used Quantity strings instead of adding (s)
but we usually use the latter because it's easier. Supporting so many languages and keeping such strings translated correctly would be difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case I think we should go for the quantity string. Many workflows involve looking at this screen a LOT. I think we want it to look as clean as we can. CC @alyblenkin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree! I took a screengrab below – it isn't great for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've improved that.
@alyblenkin probably good for you to have a look at this before I dive into a code review |
@alyblenkin |
a00922e
to
f79165b
Compare
Ah thanks now I see, ok it's fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
collect_app/src/main/java/org/odk/collect/android/readytosend/ReadyToSendBanner.kt
Outdated
Show resolved
Hide resolved
...androidTest/java/org/odk/collect/android/feature/instancemanagement/SendFinalizedFormTest.kt
Outdated
Show resolved
Hide resolved
3a63570
to
2c49cc1
Compare
2c49cc1
to
0721c66
Compare
collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt
Outdated
Show resolved
Hide resolved
collect_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBanner.kt
Outdated
Show resolved
Hide resolved
...ct_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendViewModel.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of tweaks to tests here so this is ready for QA!
...t_app/src/test/java/org/odk/collect/android/instancemanagement/send/ReadyToSendBannerTest.kt
Outdated
Show resolved
Hide resolved
...ct_app/src/main/java/org/odk/collect/android/instancemanagement/send/ReadyToSendViewModel.kt
Show resolved
Hide resolved
|
||
@Test | ||
fun `numberOfSentInstances should represent the real number of instances with STATUS_SUBMITTED in the database`() { | ||
scheduler.runBackground() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It surprised me that you didn't also have to call runForeground
to have data
updated by the foreground part of the task. It looks like FakeScheduler
runs the foreground part for you though as it splits "background" and "foreground" on a slightly different level (the way the Scheduler
was called really). Do you think we should change it so that runForeground
would be required here? I could go either way on it really!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The real implementation works in such a way that the foreground part is triggered automatically once the background one is done so I think in tests it can be like that too unless we need to do something in between. For now, we don't need that so I think we can leave it as-is.
@grzesiek2010 Can you define "more actionable”? When the new banner is shown – what does it mean displayed correctly? Is it connected with auto send options etc.? Does the PR include also the new snackbar "Look like you are offline…” ? |
@dbemke - By actionable we mean easier for the user to understand the status of when their forms were last sent and which ones still need to be actioned, so they can make an informed decision within this page. Right now it's hard for the user to remeber when they last sent their forms without leaving the page and checking their "Sent" forms. We've talked about having a snackbar to indicate when the user is offline however, it's a bit more complicated to implement, so we aren't showing it as part of this issue.
Agreed, this would be a very confusing state. The activity banner should still be at the top to indicate the last sent form. The second line say "0 forms to send" instead of displaying the empty state with the banner. |
All those problems should be fixed. |
After the fix when the user sends forms in "Ready to send" the banner is updated but if a form was sent with a big sized file (sending takes some time) in "Start new form" and then goes to "Ready to send" after the form was sent there is still info about 1 form to send. Steps to reproduce:
|
57076bc
to
e52bf13
Compare
@dbemke I'm not able to reproduce but I've added one change so please give it a try maybe now it works well. |
Just had a quick look at the fix and seems to be working well. We'll finish testing the PR after Central testing is finished. |
Fixed. |
Tested with Success! Verified on device with Android 13 Verified cases:
|
Tested with Success! Verified on device with Android 10 |
Closes #5605
What has been done to verify that this works as intended?
I've tested the changes manually and added automated tests.
Why is this the best possible solution? Were any other approaches considered?
There is nothing important to discuss here. I've created a custom view for the new element to make testing easier and isolated.
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
It's rather an isolated change so testing the list of forms to make sure the banner is displayed correctly would be enough.
Do we need any specific form for testing your changes? If so, please attach one.
No.
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.