-
Notifications
You must be signed in to change notification settings - Fork 22
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: dismiss message when close button pressed #734
Conversation
Part of: https://linear.app/customerio/issue/MBL-310/create-a-uikit-uiview-that-displays-an-inline-in-app-message-sent-from Create a WebView to display inline in-app message and display in the Inline UIView. To do this, we can re-use a lot of the same logic that Modal messages use to create WebViews and display them. Testing: There are some automated tests added in this commit. Reviewer notes: This commit will not show an in-app message if you were to add it to a sample app. Autolayout constraints need to be added to have Views resize and that will come in a future commit. commit-id:025c7bf5
…UIKit app Part of: https://linear.app/customerio/issue/MBL-310/create-a-uikit-uiview-that-displays-an-inline-in-app-message-sent-from This commit implements UIKit AutoLayout constraints to the Inline View and the WebView. Adding these constraints make inline messages visible inside of UIKit apps! The Inline View will start at height 0 and then after the webview content is loaded, it will instantly change the height to display the full in-app message. Testing: All testing is done manually in sample apps. AutoLayout constraints change the visuals of Views so viewing how the View looks in an app is required to test. If you want to test this commit in a sample app build, follow these instructions: * Open the UIKit app on device. * Immediately after the app opens, send yourself a test in-app message with element ID "test". * Wait 10 seconds. In this time, the in-app SDK will fetch the test in-app message and then will display it inline on the screen. commit-id:5ab2c403
Part of: https://linear.app/customerio/issue/MBL-310/create-a-uikit-uiview-that-displays-an-inline-in-app-message-sent-from Fetching of in-app message is an async operation running in the background. There is a chance that in-app messages are not available when the inline View is constructed but become available after. This commit gets notified when a fetch is complete so it can check if there are in-app messages to display after the View has already been constructed. Testing: * Automated tests are added. * Verified that messages display in sample app. If you want to test this commit in a sample app build, follow these instructions: 1. Kill the app on device. 2. Send yourself a test inline message from Fly. 3. Open app. After you wait a few seconds, the inline message you sent yourself will display. commit-id:aea90dff
… View Part of: https://linear.app/customerio/issue/MBL-311/provide-positive-ux-when-inline-messages-displayed-by-animating-height Fetching of in-app message is an async operation running in the background. There is a chance that an inline in-app message is rendered and ready to display on the screen currently in the foreground. We want to display the inline message when it's ready to show, and we also want to display these messages without causing a negative UX. This commit does the following: 1. Hides the inline View when the View is constructed by setting the height to 0. 2. When the in-app message web content is rendered, the inline View is given a height that matches the web content aspect ratio. The inline View animates it's height from 0 to the new height to make the inline View visible. Testing: This change is heavy on UI so testing is done mostly in UIKit sample app QA testing. If you want to test this commit in a sample app build, follow these instructions: 1. Open the app on device. 2. Send yourself a test inline message from Fly to one of the inline Views on Dashboard screen. 3. After you wait a few seconds, you will see the inline message animate into visibility. Notes for reviewer: * During development, I encountered difficulties with getting the animation to work when the inline View is embedded in a StackView. Because of this, I modified the Dashboard screen's UI to nest the inline Views inside of the StackView to make sure we QA test this scenario.
just testing the animation here. Testing * I created a timer that after 5 seconds it dismisses.
Testing: * in sample app, simulate a fetch by calling MessageQueueManager directly with an empty array.
…ires, it dismisses
… we wait for main thread tasks to finish
… into levi/inline-dismiss-when-expire
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.
|
SDK binary size reports 📊SDK binary size of this PR
SDK binary size diff report between this PR and the main branch
|
The logic is actually backwards. I modified the test with the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, considering persistent changes for close are gonna follow up in later milestones.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/inline-inapp #734 +/- ##
========================================================
+ Coverage 66.48% 67.22% +0.74%
========================================================
Files 145 145
Lines 4162 4165 +3
========================================================
+ Hits 2767 2800 +33
+ Misses 1395 1365 -30 ☔ View full report in Codecov by Sentry. |
Ticket: https://linear.app/customerio/issue/MBL-312/when-close-button-clicked-on-in-app-message-make-inline-view-no-longer
As a marketer, I want an inline View to no longer be visible when the close button on an in-app message is clicked, so that the in-app message is no longer displayed on screen.
When the close action button on an inline message gets clicked, the inline View will animate it's height to 0, making it invisible.
Testing:
Demo:
close.mov
Based on PR #733
Full chain of PRs as of 2024-06-07
levi/inline-close-button
➔levi/inline-dismiss-when-expire
levi/inline-dismiss-when-expire
➔levi/inline-animate-open
levi/inline-animate-open
➔levi/display-inline-uiview-afterfetch
levi/display-inline-uiview-afterfetch
➔feature-inline-inapp