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

chore: Improve public settings screen UX #453

Merged

Conversation

mahmoud-elmorabea
Copy link
Contributor

@mahmoud-elmorabea mahmoud-elmorabea commented Oct 10, 2024

This PR is one of series of PRs that update the UX of the settings page for the Java_Layout sample app.

PR stack:

Notes:

  • I will collect all changes in a base branch update-settings-page-ux and then merge them as one chore to the main branch
  • Choosing chore not to trigger an SDK release when this is merged

The general idea of the improvements is to have our settings screen map as close as possible to the configuration of our SDK when it's being initialized. You can see how closely the fields in this public settings screen map to the config:

The UI was tested on multiple devices

Phone - API 35 Phone - API 21 Tablet

Video of how it works

public-settings-page.webm

Copy link

github-actions bot commented Oct 10, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: update-public-settings-screen (1729000443)
  • kotlin_compose: update-public-settings-screen (1729000445)

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (update-settings-page-ux@ffa1f75). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             update-settings-page-ux     #453   +/-   ##
==========================================================
  Coverage                           ?   51.21%           
  Complexity                         ?      287           
==========================================================
  Files                              ?       95           
  Lines                              ?     2269           
  Branches                           ?      353           
==========================================================
  Hits                               ?     1162           
  Misses                             ?     1007           
  Partials                           ?      100           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ViewUtils.prepareForAutomatedTests(binding.settingsCdpApiKeyLabel, R.string.acd_cdp_api_key_input);
ViewUtils.prepareForAutomatedTests(binding.settingsSiteIdKeyLabel, R.string.acd_site_id_input);
ViewUtils.prepareForAutomatedTests(binding.settingsSaveButton, R.string.acd_save_settings_button);
ViewUtils.prepareForAutomatedTests(binding.settingsRestoreDefaultsButton, R.string.acd_restore_default_settings_button);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Shahroz16 @mrehan27 I couldn't find those UI tests, do I need to update something for the new fields?

Copy link
Contributor

Choose a reason for hiding this comment

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

The tests are available in a separate Appium repository. We haven't maintained them in a while though, but having unique and consistent values across all sample apps should be sufficient for now.

}

private void setupObservers() {

binding.deviceTokenTextInput.setText(CustomerIO.instance().getRegisteredDeviceToken());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to internal settings screen

Copy link
Contributor

Choose a reason for hiding this comment

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

The device token location should move to the main screen under the email.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scotttwittrockcio maybe we can add it there for convenience but also keep it in the internal settings?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's needed in both places. It's a really useful piece of information when testing push messages. It helps me quickly validate the device id matches the one in fly, and the one I'm using to send a test push to.

settingsViewModel.getSDKConfigObservable().observe(this, config -> {
binding.progressIndicator.hide();
updateIOWithConfig(config);
parseLinkParams();
});
}

private boolean isHostURLInvalid(String url) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved to internal settings screen

Copy link

github-actions bot commented Oct 10, 2024

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

Copy link

Build available to test
Version: update-public-settings-screen-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

@mahmoud-elmorabea mahmoud-elmorabea self-assigned this Oct 10, 2024
@mahmoud-elmorabea mahmoud-elmorabea marked this pull request as ready for review October 10, 2024 21:12
@mahmoud-elmorabea mahmoud-elmorabea requested a review from a team October 10, 2024 21:12
Base automatically changed from create-internal-settings-screen to update-settings-page-ux October 14, 2024 13:19
@mahmoud-elmorabea mahmoud-elmorabea force-pushed the update-public-settings-screen branch from 97bf238 to 8f5d2ac Compare October 14, 2024 13:22
private final Boolean deviceAttributesTrackingEnabled;
@Nullable
private final Boolean debugModeEnabled;
private final boolean screenTrackingEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of wrapper classes here was intentional to differentiate between default values and user-set values. Just wanted to confirm if the switch to primitive classes is deliberate and ensures that all cases are covered.

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 wasn't clear to me that it was intentional so I just wanted to keep it consistent with the new values. Do we still want to keep them as nullable values? Having two getters for each field returning nullable boolean and primitive boolean was too confusing.

Do we still want to differentiate between default values and user values? Not sure if we actually use that distinction anywhere though

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that using object classes adds some management overhead, but primitive types will always resolve to either true or false which can't fully capture the essence of SDK default values. Although it only becomes relevant if SDK's default value changes. I can't think of any other major use cases where it would matter, so as long as saving and restoring values features are working fine, I think using primitives is fine and won't really make a difference in most cases.

Copy link
Contributor

@mrehan27 mrehan27 left a comment

Choose a reason for hiding this comment

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

Everything looks good, except for what Scott suggested in his comment. Looks like device token is missing from public settings screen. Is there a separate PR for that change?

@mahmoud-elmorabea
Copy link
Contributor Author

@mrehan27 Yes, I will have follow up PRs for changes to login page and other parts

@mahmoud-elmorabea mahmoud-elmorabea merged commit c89791b into update-settings-page-ux Oct 16, 2024
33 of 35 checks passed
@mahmoud-elmorabea mahmoud-elmorabea deleted the update-public-settings-screen branch October 16, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants