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

In-App Updates: Show notice (flexible) or modal (blocking) #23195

Merged
merged 23 commits into from
May 17, 2024

Conversation

momo-ozawa
Copy link
Contributor

Part of https://github.com/Automattic/wordpress-mobile/issues/55
Part of https://github.com/Automattic/wordpress-mobile/issues/56

Description

  • Adds preliminary UI for flexible and blocking updates
    • 🚧 Design will be refined later
    • 🚧 The "Update" CTA doesn't do anything yet; it'll be addressed in a future PR
  • On app launch, checks if any updates are available
    • Shows a modal if there's a blocking update available
    • Shows a notice if there's a flexible update available

How to test

Flexible update

Precondition: On Xcode, change the app version to something lower than the current app store version

  • Build and run the app
  • Verify the "App Update Available" notice is displayed

Blocking update

Precondition: On Xcode, change the app version to something lower than the current app store version

  • Build and run the app
  • Change the in app update remote config value to the current app store version
  • Verify the "App Update Available" modal is displayed

Minimum OS version

Precondition: On Xcode, change the app version to something lower than the current app store version

  • Change InAppCoordinator.swift L62 to "14.0"
  • Build and run the app
  • Verify no notice or modal is displayed

Regression Notes

  1. Potential unintended areas of impact

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

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

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.

Testing checklist:

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

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 13, 2024

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 Numberpr23195-89e1488
Version24.9
Bundle IDorg.wordpress.alpha
Commit89e1488
App Center BuildWPiOS - One-Offs #9931
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 13, 2024

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 Numberpr23195-89e1488
Version24.9
Bundle IDcom.jetpack.alpha
Commit89e1488
App Center Buildjetpack-installable-builds #8980
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@@ -68,6 +68,28 @@ public struct NormalNoticeStyle: NoticeStyle {
public let dismissGesture: NoticeDismissGesture? = nil
}

public struct InAppUpdateNoticeStyle: NoticeStyle {
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like it's identical to QuickStartNoticeStyle.

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, but I wasn't sure if I'd want to extend it when I implement showing a dismissed notice again after a certain interval. If I don't end up doing that, I'll get rid of it.

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@momo-ozawa
Copy link
Contributor Author

Hey @kean, can you re-review this PR? Thanks! 🙇‍♀️

Base automatically changed from task/iau-remote-config to trunk May 15, 2024 10:12
Copy link
Contributor

@kean kean left a comment

Choose a reason for hiding this comment

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

I tested both of the scenarios. The UI did show up + I tested blocking updates and accessibility features.

Feedback:

  • (Nit) the button alignment the snackbar is a bit odd. I'd suggest centering them.
  • Should there be a feature flag?
  • (Noting) The app performs the check on every launch. Ideally, it should only check it once in a while and only if there popup can be shown (based on the business logic – time interval, number of attempts, etc)
  • (Note) "Update" button doesn't work, which seems expected based on the TODOs in the code
  • I suggest using https://github.com/apple/swift-package-manager/blob/main/Sources/PackageDescription/Version.swift for version parsing and comparison. It supports pre-release identifiers and a couple of other things. It will be a valuable addition to the app.

@momo-ozawa
Copy link
Contributor Author

@kean, thanks for the feedback!

(Nit) the button alignment the snackbar is a bit odd. I'd suggest centering them.

I'll look into this later!

Should there be a feature flag?

Yes - #23202 (thanks for approving 🙇‍♀️)

(Noting) The app performs the check on every launch. Ideally, it should only check it once in a while and only if there popup can be shown (based on the business logic – time interval, number of attempts, etc)
(Note) "Update" button doesn't work, which seems expected based on the TODOs in the code

These will be addressed in a separate PR :)

I suggest using https://github.com/apple/swift-package-manager/blob/main/Sources/PackageDescription/Version.swift for version parsing and comparison. It supports pre-release identifiers and a couple of other things. It will be a valuable addition to the app.

Good shout. Will address this in a future PR

@momo-ozawa momo-ozawa requested a review from kean May 15, 2024 15:06
@momo-ozawa momo-ozawa merged commit 854c0b0 into trunk May 17, 2024
24 checks passed
@momo-ozawa momo-ozawa deleted the task/iau-blocking-modal branch May 17, 2024 09:45
@momo-ozawa momo-ozawa mentioned this pull request May 17, 2024
14 tasks
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.

None yet

4 participants