Release PT 2.4.0#988
Conversation
* task(SDK-5545) - Vertical Template Implementation * task(SDK-5618) - Fixes button layout_width * task(SDK-5545) - Improves layout * task(SDK-5545) - Default Alt Text Fix * task(SDK-5545) - Adds tests for Vertical Template * task(SDK-5545) - Adds default colours * task(SDK-5545) - Rounded corners by default * task(SDK-5545) - Adds pt_ prefix * task(SDK-5545) - Code reuse * task(SDK-5545) - Improves signature of VerticalImageButtonData * task(SDK-5545) - Adds log for early return * task(SDK-5545) - Accepts gradient direction in degrees for linear gradient * task(SDK-5545) - Allows null deeplink to navigate to app by default (cherry picked from commit e730050)
feat(SDK-5618): Timer Template chronometer enhancements - Added configurable border radius for chronometer box (pt_chrono_border_radius) - Added configurable border width for chronometer box (pt_chrono_border_width) - Added gradient support for chronometer background (pt_chrono_style, pt_chrono_grad_clr1, pt_chrono_grad_clr2, pt_chrono_grad_dir) - Added solid border color support (pt_chrono_border_clr) - Fixed border overlap bug for solid and gradient styles - Improved null safety (replaced !! with elvis operator for timer_end) - Removed unnecessary timer_container wrapper layout - Segmented HRS/MIN/SEC design deferred to future release (preserved on task/SDK-5618/segmented-timer-design) (cherry picked from commit 5307b0e)
(cherry picked from commit 58b02b1)
* chore/pt - Removes api-23-checks * task(SDK-5658) - Vertical Template Button Click * task(SDK-5658) - Vertical Template Button Click fix for notification clicked event (cherry picked from commit b95190c)
(cherry picked from commit 3b597b8)
(cherry picked from commit 9be3a54)
(cherry picked from commit cc4310f)
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 39 minutes and 23 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughAdds a new VERTICAL_IMAGE push notification template (data, factory, rendering, styles, views, layouts, validations, tests), extends timer chronometer styling (PTConstants, TimerTemplateData, Timer views), introduces bitmap utilities and pending-intent/button handling, and calls CleverTapAPI.handleNotificationClicked for action-button flows. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateDataFactoryTest.kt (1)
1774-1781: Consider using delta for floating-point assertions.When comparing
Doublevalues withassertEquals, it's safer to use the overload with a delta parameter to account for floating-point precision issues, similar to what's done in the chronometer tests (e.g., line 1981).💡 Suggested improvement
- assertEquals(180.0, data.buttonData?.gradientDirection) + assertEquals(180.0, data.buttonData?.gradientDirection ?: 0.0, 0.0)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateDataFactoryTest.kt` around lines 1774 - 1781, The test currently asserts the Double gradientDirection with assertEquals(180.0, data.buttonData?.gradientDirection) which can fail due to floating-point precision; update the assertion for VerticalImageTemplateData.buttonData.gradientDirection to use the assertEquals overload that accepts a delta (e.g., assertEquals(expected, actual, delta)) so the comparison tolerates minor precision differences.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageContentView.kt`:
- Around line 39-64: VerticalImageContentView is dropping configured borderColor
for gradient buttons: when handling ButtonStyle.GRADIENT_LINEAR and
GRADIENT_RADIAL, extract borderColor (e.g., val borderColor =
buttonData.borderColor?.let { Utils.getColourOrNull(it) }) and pass it through
to the gradient bitmap helpers
(NotificationBitmapUtils.createLinearGradientBitmap and createRadialBitmap) just
like SOLID does; update the calls to include the borderColor parameter so
gradient buttons render borders consistently (refer to VerticalImageContentView,
buttonData, ButtonStyle.GRADIENT_LINEAR, ButtonStyle.GRADIENT_RADIAL,
NotificationBitmapUtils.createLinearGradientBitmap,
NotificationBitmapUtils.createRadialBitmap).
- Around line 29-35: The current VerticalImageContentView makes the CTA frame
visible and sets text even when buttonData.name is blank, producing a clickable
empty CTA and layout shift; update the logic in VerticalImageContentView to
check for empty or whitespace-only buttonData.name (in addition to null) before
calling remoteView.setViewVisibility(R.id.vertical_img_btn_frame, View.VISIBLE)
and remoteView.setTextViewText(R.id.vertical_img_btn, ...), and if the name is
blank hide the frame (or leave it gone) so no empty CTA is rendered; reference
buttonData and the remoteView methods to locate where to add the validation.
In
`@clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java`:
- Around line 234-241: The deeplink selection in PushTemplateReceiver leaves dl
empty when deepLinkList.size() == newPosition due to the final branch using
"deepLinkList.size() < newPosition"; change that boundary to "<= newPosition" so
the fallback branch (deepLinkList.get(0)) also triggers when size equals
newPosition, ensuring the last carousel card reuses the first deeplink; update
the condition around the deepLinkList checks (variables: deepLinkList,
newPosition, dl) accordingly.
In `@clevertap-pushtemplates/src/main/res/layout/vertical_image_big.xml`:
- Around line 9-10: The layout uses API-26-only shorthand attributes
android:paddingHorizontal and android:paddingVertical in vertical_image_big.xml
which are ignored on API 21–25; replace them with the explicit equivalents
android:paddingLeft and android:paddingRight for paddingHorizontal and
android:paddingTop and android:paddingBottom for paddingVertical, preserving the
same `@dimen` values (e.g., `@dimen/padding_horizontal` and `@dimen/padding_micro`) so
older Android versions retain the intended outer spacing.
---
Nitpick comments:
In
`@clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateDataFactoryTest.kt`:
- Around line 1774-1781: The test currently asserts the Double gradientDirection
with assertEquals(180.0, data.buttonData?.gradientDirection) which can fail due
to floating-point precision; update the assertion for
VerticalImageTemplateData.buttonData.gradientDirection to use the assertEquals
overload that accepts a delta (e.g., assertEquals(expected, actual, delta)) so
the comparison tolerates minor precision differences.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 20a1d464-352e-4bcf-b98d-8b6fd0cc5e86
📒 Files selected for processing (32)
clevertap-core/src/main/java/com/clevertap/android/sdk/pushnotification/CTNotificationIntentService.javaclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PTConstants.javaclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.javaclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateData.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateDataFactory.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateType.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/NotificationBitmapUtils.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/PendingIntentFactory.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/TimerSmallContentView.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageBigContentView.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageContentView.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageSmallContentView.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/styles/VerticalImageStyle.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/validators/ValidatorFactory.ktclevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/validators/VerticalImageTemplateValidator.ktclevertap-pushtemplates/src/main/res/drawable/pt_vertical_img_btn_default_bg.xmlclevertap-pushtemplates/src/main/res/layout-v31/timer.xmlclevertap-pushtemplates/src/main/res/layout-v31/timer_collapsed.xmlclevertap-pushtemplates/src/main/res/layout-v31/vertical_image_big.xmlclevertap-pushtemplates/src/main/res/layout-v31/vertical_image_small.xmlclevertap-pushtemplates/src/main/res/layout/timer.xmlclevertap-pushtemplates/src/main/res/layout/timer_collapsed.xmlclevertap-pushtemplates/src/main/res/layout/vertical_image_big.xmlclevertap-pushtemplates/src/main/res/layout/vertical_image_small.xmlclevertap-pushtemplates/src/main/res/values-night/colors.xmlclevertap-pushtemplates/src/main/res/values/colors.xmlclevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateDataFactoryTest.ktclevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateRendererTest.ktclevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/UtilsTest.ktclevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/VerticalImageTemplateValidatorTest.ktclevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/content/NotificationBitmapUtilsTest.kt
💤 Files with no reviewable changes (1)
- clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/UtilsTest.kt
Code Coverage Debug
Files
|
Push Templates release for Vertical template and timer template enhancements.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Refactor