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

Time Selection Feature #15128

Merged
merged 19 commits into from Aug 16, 2021
Merged

Conversation

Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
@ravishanker
Copy link
Contributor

@ravishanker ravishanker commented Aug 4, 2021

Implemented time selection for blogging reminders

Fixes #15123

To test:

  • Go to site settings
  • Find Blogging reminders setting and click on the item below it
  • It should launch select days bottom sheet
  • bottom sheet should now have Notification time item, click on time
  • It should show time selection dialog
  • Select a time, AM, PM and time should reflect the selection
  • De-select all days, time list item should disappear, then select a day, time should appear again

Regression Notes

  1. Potential unintended areas of impact
    Reminder scheduling

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing

  3. What automated tests I added (or what prevented me from doing so)
    Unit testing

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
Implemented time selection for blogging reminders
@peril-wordpress-mobile
Copy link

@peril-wordpress-mobile peril-wordpress-mobile bot commented Aug 4, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Loading

@peril-wordpress-mobile
Copy link

@peril-wordpress-mobile peril-wordpress-mobile bot commented Aug 4, 2021

You can test the changes on this Pull Request by downloading the APKs:

Loading

@ravishanker ravishanker requested a review from renanferrari Aug 5, 2021
@ravishanker
Copy link
Contributor Author

@ravishanker ravishanker commented Aug 5, 2021

Needs an update to FluxC in a separate PR here

Loading

Copy link
Member

@renanferrari renanferrari left a comment

Thanks for the changes! I'm not sure if this is ready for review, but I've taken a quick look and it seems that the time picker is behaving a bit weirdly after I dismiss it by tapping on the outside:

video.7.mp4

Also, I noticed that the time formatting is not following my current locale?

Let me know if this is ready for a proper review, so I can take a deeper look at the code as well.

Loading

@ravishanker
Copy link
Contributor Author

@ravishanker ravishanker commented Aug 10, 2021

Thanks for the changes! I'm not sure if this is ready for review, but I've taken a quick look and it seems that the time picker is behaving a bit weirdly after I dismiss it by tapping on the outside:
video.7.mp4

Also, I noticed that the time formatting is not following my current locale?

Let me know if this is ready for a proper review, so I can take a deeper look at the code as well.

Thanks @renanferrari for a quick look. Good catch on the issue. Looks like if the time picker is cancelled, then it is not dismissing the dialog.

Unfortunately, I couldn't use material MaterialTimePicker even after upgrading material version. MaterialTimePicker is crashing due to bridge theme in use in the app.

I've now fixed the issue with Cancel of TimePicker. You can may be review this after I merge the FluxC PR first, then update this one. Thanks

Loading

Copy link
Member

@renanferrari renanferrari left a comment

Thanks for the changes! After testing, it seems that the dialog behavior is still there if we press the back button. I've taken a look at the code and left a few suggestions below. Let me know what you think.

Loading

Loading
Loading
fun newInstance(hour: Int, minute: Int): BloggingReminderTimePicker {
return BloggingReminderTimePicker().apply {
arguments = Bundle().apply {
putInt(ARG_HOUR, hour)
putInt(ARG_MINUTE, minute)
}
}
}
Copy link
Member

@renanferrari renanferrari Aug 10, 2021

Choose a reason for hiding this comment

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

It seems that we're not using these arguments anywhere yet. I imagine you're planning to use them to pass the currently selected time to the dialog? If so, I think that's the way to go 👍

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 11, 2021

Choose a reason for hiding this comment

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

Yes, once I merge the FluxC PR

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 11, 2021

Choose a reason for hiding this comment

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

Removed the arguments now, no longer needed as time and hour are available after FluxC update

Loading

Copy link
Member

@renanferrari renanferrari Aug 11, 2021

Choose a reason for hiding this comment

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

I believe we should still pass the currently selected time to the dialog. If we don't, the time picker will display a different time from the one that's being displayed on the bottom sheet:

notification-time.mp4

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 12, 2021

Choose a reason for hiding this comment

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

Updated to reflect current time selection on the picker after merging FluxC PR

Loading

@@ -44,5 +52,11 @@ sealed class BloggingRemindersItem(val type: Type) {
data class DayItem(val text: UiString, val isSelected: Boolean, val onClick: ListItemInteraction)
}

data class TimeItem(
val time: UiString,
val isInvisible: Boolean = false,
Copy link
Member

@renanferrari renanferrari Aug 10, 2021

Choose a reason for hiding this comment

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

It looks like isInvisible is not being used anywhere?

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 11, 2021

Choose a reason for hiding this comment

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

Need to seek clarification on this one. We had discussion if you remember, whether the time selection should always be displayed or only after a day selection is made. If we decide to default to display always, then this can be removed

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 11, 2021

Choose a reason for hiding this comment

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

Update it now, to be visible only when at least a day is selected

Loading

Copy link
Member

@renanferrari renanferrari Aug 11, 2021

Choose a reason for hiding this comment

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

I'm not sure what's the best approach here, but the way we are currently hiding the item looks quite weird IMHO:

notification-time-visibility.mp4

If we want to hide that, we should consider conditionally adding this TimeItem to the list instead of hiding its content. Personally, I'd probably just default to always show it, though.

Either way, we should probably ask for a design review here. You can do that by adding the "Needs design review" label and/or pinging a designer yourself.

Loading

Copy link
Contributor Author

@ravishanker ravishanker Aug 12, 2021

Choose a reason for hiding this comment

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

Yeah, Chris is AFK, will ask next week when he returns. For now, made TimeItem conditional. Thanks

Loading

Loading
Loading
Loading
ravishanker added 2 commits Aug 11, 2021
refactored time picker handling
@ravishanker ravishanker marked this pull request as ready for review Aug 11, 2021
build.gradle Show resolved Hide resolved
Loading
Copy link
Member

@renanferrari renanferrari left a comment

Left a few more comments above. Let me know if you need a hand with anything!

Loading

Copy link
Member

@renanferrari renanferrari left a comment

Sorry, just noticed a few more things!

Loading

@ravishanker ravishanker added this to the 18.1 milestone Aug 12, 2021
ravishanker added 4 commits Aug 12, 2021
Refactored and updated after merging FluxC PR
Track time selection feature by adding a selected_time property to the blogging_reminders_scheduled event
Copy link
Member

@renanferrari renanferrari left a comment

Great work!

LGTM :shipit:

Feel free to merge this after resolving the merge conflicts. I think we can address any design issues separately as well, but it's up to you.

Loading

ravishanker and others added 4 commits Aug 16, 2021
@ravishanker ravishanker merged commit fd04a08 into develop Aug 16, 2021
13 checks passed
Loading
@ravishanker ravishanker deleted the feature/15123-blogging-remindertime-selection branch Aug 16, 2021
@osullivanchris
Copy link

@osullivanchris osullivanchris commented Aug 18, 2021

Hey @renanferrari @ravishanker I had a think about the time display when the user has not selected any days yet.

What if we display it but disabled until days are selected? Then we follow the same rational that its not interactive before days are selected, but, the UI doesn't jump when it becomes active. WDYT?

The only thing I wasn't sure is if we should display the default time, or no time, before a day is selected.

notification time

I also thought Ravi had a nice idea about using a button style for the time to make it more clear that its interactive. Here's a quick mock. I think it looks pretty nice but I'm not sure if its ok to put a text button in a list item like this?

alt

Loading

@osullivanchris
Copy link

@osullivanchris osullivanchris commented Aug 19, 2021

As discussed elsewhere, we have good reason for 'hiding' rather than disabling the time initially. So we can ignore my above suggestion for now!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment