WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Stats Traffic date picker

Open guarani opened this issue 1 year ago β€’ 5 comments

Fixes #22382

Add the Stats Traffic date picker.

I have some thoughts on what might need to be changed or improved:

  • Shorten the date format, e.g. "Jan 14, 2024 - Jan 20, 2024" is too long
  • Improve timezone handling: If it's Saturday in the site's timezone but still Friday night for the user, should the picker allow the user to pick Saturday? I think it make sense but I'll check how WP.com handles this and bring this up for discussion on Slack

[!NOTE] The changes in SiteStatsDashboardViewController.swift are just for testing and might be modified before merging.

To test

Enable the feature flag: swipe right on any screen (h/t to @staskus for telling me about this), tap Feature Flags, enable Stats Traffic Tab. Then open the Stats Traffic tab.

Day selection

  1. Go back and forth between different days
  2. You shouldn't be able to go to future dates

Week selection

  1. Switch to "By week"
  2. Go back and forth between different calendar weeks (Monday to Sunday, inclusive)
  3. The current week may include future days, but it should prevent you from going to the next week after that

Month selection

  1. Switch to "By month"
  2. Go back and forth between different calendar months (e.g. Jan 1-31st)
  3. The current month may include future days, but it should prevent you from going to the next month after that

Year selection

  1. Switch to "By year"
  2. Go back and forth between different calendar years (e.g. Jan 1 to Dec 31, 2024)
  3. The current year may include future days, but it should prevent you from going to the next year after that

Switching periods

  1. Switch to "By week"
  2. Go to a given week
  3. Switch to "By day"
  4. The date the picker lands on should be the start of the week shown previously

Regression Notes

  1. Potential unintended areas of impact

This is a new date picker, not yet integrated into the app. I don't see any potential unintended areas of impact.

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

Not applicable.

  1. What automated tests I added (or what prevented me from doing so)

I manually tested the new date picker and added unit tests.

PR submission checklist:

  • [x] I have completed the Regression Notes.
  • [x] I have considered adding unit tests for my changes.
  • [x] I have considered adding accessibility improvements for my changes.
  • [x] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

UI Changes testing checklist:

  • [x] Portrait and landscape orientations.
  • [x] Light and dark modes.
  • [x] Fonts: Larger, smaller and bold text.
  • [x] High contrast.
  • [x] VoiceOver.
  • [x] Languages with large words or with letters/accents not frequently used in English.
  • [x] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • [x] iPhone and iPad.
  • [ ] Multi-tasking: Split view and Slide over. (iPad)

guarani avatar Jan 15 '24 22:01 guarani

WordPress AlphaπŸ“² You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22400-18b7d4b
Version24.3
Bundle IDorg.wordpress.alpha
Commit18b7d4b5b993ba175eef2168360a1679d8be9f44
App Center BuildWPiOS - One-Offs #8997
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar Jan 15 '24 23:01 wpmobilebot

Jetpack AlphaπŸ“² You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22400-18b7d4b
Version24.3
Bundle IDcom.jetpack.alpha
Commit18b7d4b5b993ba175eef2168360a1679d8be9f44
App Center Buildjetpack-installable-builds #8035
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

wpmobilebot avatar Jan 15 '24 23:01 wpmobilebot

πŸ‘‹ @staskus, a heads-up: the date picker is working functionally, but visually isn't quite there yet. It also needs localization, testing, etc.

guarani avatar Jan 17 '24 02:01 guarani

πŸ‘‹ Thanks for the review comments, @staskus! I should have considered re-using some of the existing logic, so I'll see what can be done there. Yes, you're right about the date format in the designs; it shows how to represent the different periods, so I will update it to match.

guarani avatar Jan 22 '24 13:01 guarani

I'm going to bump this to the next release because we'll be code freezing 24.3 today and it seems like this has not been approved yet.

It doesn't seem the case, but if it's very important that this makes it into this release, let me know and we'll organize a new beta once ready.

mokagio avatar Feb 19 '24 00:02 mokagio

πŸ‘‹ Hey @staskus, this should be working now. Thanks for all the great feedback; I think I've incorporated it all in.

I added analytics, fixed the design and date formats, connected the date picker to the site's date, and refactored to use the existing date methods.

I haven't gone back and re-tested it all yet. If you have time, I'd appreciate your testing of this, but if not, I'll come back here and re-test everything tomorrow.

guarani avatar Feb 27 '24 01:02 guarani

I found a corner-case issue that combines these two requirements:

The current month may include future days, but it should prevent you from going to the next month after that The date the picker lands on should be the date you were in beforehand

  1. Select By month
  2. Come back a couple of months to November, 2023
  3. Select By Year
  4. Confirm 2023 is shown
  5. Go forward to 2024
  6. Select by month
  7. Now the data loads for November, 2024 which is an unexistent future Month

staskus avatar Feb 27 '24 14:02 staskus

Thanks for catching that. I've made a separate issue for it: https://github.com/wordpress-mobile/jetpack-issue-repo/issues/19

Enabling auto-merge now

guarani avatar Feb 27 '24 16:02 guarani