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

Quick Start for Existing Users: Add media upload tour #18471

Merged
merged 20 commits into from
May 10, 2022

Conversation

hassaanelgarem
Copy link
Contributor

@hassaanelgarem hassaanelgarem commented Apr 28, 2022

Part of #18388

Description

  • Added new Media upload tour
    • First step depends on where the tour is triggered from
      • Site menu: Point to media menu item, and vertically scroll to it
      • Dashboard: Point to media quick action button, and horizontally scroll to it
    • Second step points to add media button
  • Now we always show the media button, even if there's media available (Ref: p1651124342417449-slack-C027K4MNPGQ)
  • This PR uses a beta version of MediaPicker-iOS that fixes Empty view incorrect placement MediaPicker-iOS#386
Step 1 Menu Step 1 Home Step 2 with media Step 2 no media
Step1-menu Step1-home Step2-withmedia Step2-nomedia

Testing Instructions

Initial screen: Site Menu (With media)

  1. Make sure the initial screen is site menu
  2. Switch to a site that has media already uploaded
  3. Enable quick start for existing site from debug menu
  4. Start media upload task
  5. Make sure notice gets dispalyed with correct copy
  6. Make sure spotlight appears over media item and that the screen autoscrolls to it
  7. Tap on media item
  8. Make sure the second notice gets dispalyed with correct copy
  9. Make sure spotlight is added to the add button
  10. Tap on the add button
  11. Make sure the notice is dismissed
  12. Navigate back to site menu
  13. Make sure media task is marked as completed

Initial screen: Home (With media)

  1. Make sure the initial screen is Home
  2. Switch to a site that has media already uploaded
  3. Enable quick start for existing site from debug menu
  4. Start media upload task
  5. Make sure notice gets dispalyed with correct copy
  6. Make sure spotlight appears over media quick action button and that the screen autoscrolls to it
  7. Tap on media button
  8. Make sure the second notice gets dispalyed with correct copy
  9. Make sure spotlight is added to the add button
  10. Tap on the add button
  11. Make sure the notice is dismissed
  12. Navigate back to site menu
  13. Make sure media task is marked as completed14.

No Media

  1. Switch to a site that has no media uploaded
  2. Enable quick start for existing site from debug menu
  3. Start media upload task
  4. Navigate to media
  5. Make sure the second notice gets dispalyed with correct copy
  6. Make sure the add button is visibile and a spotlight is added to it
  7. Tap on the add button OR the "Upload Media" button
  8. Make sure the notice is dismissed in both cases
  9. Navigate back to site menu
  10. Make sure media task is marked as completed

Regression Notes

  1. Potential unintended areas of impact
    N/A

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

  3. What automated tests I added (or what prevented me from doing so)
    N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • 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.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 28, 2022

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18471-724a60d on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Apr 28, 2022

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr18471-724a60d on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@momo-ozawa momo-ozawa left a comment

Choose a reason for hiding this comment

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

Works as described!

  • Looks like you need to fix QuickStartFactoryTests
  • Once you release the new WPMediaPicker you can point to the released version before merging this PR

@@ -74,6 +74,8 @@ typedef NS_ENUM(NSInteger, QuickStartTourElement) {
QuickStartTourElementNotifications = 23,
QuickStartTourElementSetupQuickStart = 24,
QuickStartTourElementRemoveQuickStart = 25,
QuickStartTourElementMediaScreen = 26,
QuickStartTourElementMediaAdd = 27,
Copy link
Contributor

Choose a reason for hiding this comment

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

MediaUpload might be a better name, wdyt?

Suggested change
QuickStartTourElementMediaAdd = 27,
QuickStartTourElementMediaUpload = 27,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! 724a60d

let step1DescriptionTarget = NSLocalizedString("Media", comment: "The menu item to select during a guided tour.")
let step1: WayPoint = (element: .mediaScreen, description: step1DescriptionBase.highlighting(phrase: step1DescriptionTarget, icon: .gridicon(.image)))

let step2DescriptionBase = NSLocalizedString("Select %@to upload media. You can add it to your posts / pages from any device.", comment: "A step in a guided tour for quick start. %@ will be a plus icon.")
Copy link
Contributor

Choose a reason for hiding this comment

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

[Q] Is it intentional that there no space between the "%@" and the "to"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is yes.
String.highlighting adds a space between the title and the icon passed. Given that the title is empty in this case, this means String.highlighting will add an extra space either way.

Removing the space from the base sting was to mitigate this issue. This was simpler than modifying String.highlighting to handle this specific case.

if blog.userCanUploadMedia {
addButton.spotlightOffset = Constants.addButtonSpotlightOffset
let config = UIImage.SymbolConfiguration(textStyle: .body, scale: .large)
let image = UIImage(systemName: "plus", withConfiguration: config) ?? .gridicon(.plus)
Copy link
Contributor

Choose a reason for hiding this comment

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

[Q] Any particular reason we're using the system image over the gridicon?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were using the system's default button. Since I had to manually create the button to add the spotlight view, I tried (to the best of my ability) to maintain the same look as before. I found that the plus grid icon was a bit thicker than the system icon.

Grid Icon System
GridIcon System

# Conflicts:
#	WordPress/Classes/ViewRelated/Blog/Blog Details/BlogDetailsViewController.h
#	WordPress/Classes/ViewRelated/Blog/QuickStartTours.swift
@hassaanelgarem
Copy link
Contributor Author

@momo-ozawa

Looks like you need to fix QuickStartFactoryTests

Fixed in 913e67b

Once you release the new WPMediaPicker you can point to the released version before merging this PR

Done in a91b3b5

@hassaanelgarem hassaanelgarem requested a review from momo-ozawa May 9, 2022 01:57
Copy link
Contributor

@momo-ozawa momo-ozawa left a comment

Choose a reason for hiding this comment

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

Looking great! Can you also update the release notes? Otherwise, LGTM!

@hassaanelgarem hassaanelgarem enabled auto-merge May 10, 2022 11:43
@hassaanelgarem hassaanelgarem merged commit 361b4dc into trunk May 10, 2022
@hassaanelgarem hassaanelgarem deleted the task/18388-qs-media branch May 10, 2022 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty view incorrect placement
3 participants