Skip to content

Jetpack Focus: Open web links with Jetpack - Update App pref setting#17514

Merged
develric merged 6 commits intotrunkfrom
issue/17494-open-with-jp-hook-on-off-app-settings
Nov 23, 2022
Merged

Jetpack Focus: Open web links with Jetpack - Update App pref setting#17514
develric merged 6 commits intotrunkfrom
issue/17494-open-with-jp-hook-on-off-app-settings

Conversation

@zwarm
Copy link
Copy Markdown
Contributor

@zwarm zwarm commented Nov 23, 2022

Parent #17494

This PR changes the way the DeepLinkOpenWebLinksWithJetpackHelper determines when to show the overlay. Instead of relying on the activity component to be enabled, a new app pref was added to manage the value. Also included in this PR is the logic to enable/disable the actual deep link component. A future PR will add the functionality to update the setting based on the overlay yes/no response.

This setting is only visible:

  • When the Open Web Links With Jetpack flow is enabled
  • Jetpack is installed on the device
  • The current app is WordPress

Note: had to comment out the following unused methods to pass ci checks. This will be uncommented in the next PR.
setOpenWebLinksWithJetpackOverlayLastShownTimestamp

Alt desc

To test:
##Test: Setting is not shown when Feature Flag is enabled and JP is not installed##

  • Do a clean install of the WP app from this PR
  • Launch WP and login
  • Navigate to Me -> App Settings -> Debug
  • Enable the "open web links with jetpack" feature flag and restart the app
  • Navigate to Me -> App Settings
  • ✅ Verify you don't see the "Open web links with Jetpack" setting (as in the screenshot above)

##Test: Setting is not shown when Feature Flag is disabled and JP is not installed##

  • Launch WP
  • Navigate to Me -> App Settings -> Debug
  • Disable the "open web links with jetpack" feature flag and restart the app
  • Navigate to Me -> App Settings
  • ✅ Verify you don't see the "Open web links with Jetpack" setting (as in the screenshot above)

##Test: Setting is not shown within the JP app when FF is enabled##

  • Do a clean install of the JP app from this PR
  • Launch JP and login
  • Navigate to Me -> App Settings -> Debug
  • Enable the "open web links with jetpack" feature flag and restart the app
  • Navigate to Me -> App Settings
  • ✅ Verify you don't see the "Open web links with Jetpack" setting (as in the screenshot above)

##Test: Setting is shown within the WP app when FF is enabled and JP is installed##

  • Make sure WP & JP are installed on the device
  • Launch the WP app
  • Enable the "open web links with jetpack" feature flag and restart the app
  • Navigate to Me -> App Settings
  • ✅ Verify you do see the "Open web links with Jetpack" setting (as in the screenshot above)

Regression Notes

  1. Potential unintended areas of impact
    The app showing shows when it shouldn't

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

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

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.

@zwarm zwarm self-assigned this Nov 23, 2022
@zwarm zwarm added this to the 21.3 milestone Nov 23, 2022
@zwarm zwarm requested a review from develric November 23, 2022 01:36
@zwarm zwarm changed the title Issue/17494 open with jp hook on off app settings Jetpack Focus: Open web links with Jetpack - Update App pref setting Nov 23, 2022
@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Nov 23, 2022

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17514-f39db35.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commitf39db35
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Nov 23, 2022

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17514-f39db35.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commitf39db35
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

Comment on lines +709 to +719
try {
mOpenWebLinksWithJetpackHelper.enableDisableOpenWithJetpackComponents(newValue);
} catch (Exception e) {
ToastUtils.showToast(
getActivity(),
(newValue ? R.string.preference_open_web_links_with_jetpack_setting_change_enable_error
: R.string.preference_open_web_links_with_jetpack_setting_change_disable_error),
ToastUtils.Duration.LONG);
AppLog.e(AppLog.T.UTILS, "Unable to enable or disable open with Jetpack components ", e);
}
}
Copy link
Copy Markdown
Contributor

@develric develric Nov 23, 2022

Choose a reason for hiding this comment

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

Since this can fail, wonder if we should AppPrefs.setIsOpenWebLinksWithJetpack here based on the success/fail result. Since the feature is disabled behind a feature flag we can also address this in one of the upcoming PRs in case you think what I said makes sense 🙇 .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Absolutely great idea @develric . Changed and pushed in commit f39db35

Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and the detailed test steps (super straightforward to follow 🙇 )! Works as described and code LGTM. Just left a comment inline (let me know if it makes sense, and we can address also in subsequent PRs since all is behind a FF for now). I'll wait for the minor checkstyle issue to be fixed and your follow up, but for all the rest this is good to land 👍 !

…ter it is determined if we could change the component setting
Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Thanks for the changes 🙇 ! I'm merging it 👍 !

@develric develric merged commit e980fc0 into trunk Nov 23, 2022
@develric develric deleted the issue/17494-open-with-jp-hook-on-off-app-settings branch November 23, 2022 12:20
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.

3 participants