Skip to content

Release PT 2.4.0#988

Merged
Anush-Shand merged 11 commits into
developfrom
task/release/pt/2.4.0
Apr 13, 2026
Merged

Release PT 2.4.0#988
Anush-Shand merged 11 commits into
developfrom
task/release/pt/2.4.0

Conversation

@CTLalit
Copy link
Copy Markdown
Collaborator

@CTLalit CTLalit commented Apr 13, 2026

Push Templates release for Vertical template and timer template enhancements.

Summary by CodeRabbit

  • New Features

    • Added Vertical Image notification template with customizable media, two text lines, and expandable/collapsed CTA buttons.
    • Enhanced Timer template styling: chronometer background, gradients, borders, radii, and selectable button styles (solid/linear/radial).
  • Bug Fixes

    • Improved handling of notification action-button clicks to ensure click events are processed reliably.
  • Tests

    • Added extensive unit tests for Vertical Image, Timer styling, bitmap utilities, renderer and validator behavior.
  • Refactor

    • Simplified notification and pending-intent handling by removing redundant API-level checks.

Anush-Shand and others added 8 commits April 13, 2026 16:12
* 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 9be3a54)
(cherry picked from commit cc4310f)
…ements (#984)

* add unit tests for timer template chronometer enhancements

* add unit tests for NotificationBitmapUtils

* recycle bitmaps in teardown to prevent memory leaks

(cherry picked from commit 114ed7c)
@CTLalit CTLalit requested a review from Anush-Shand April 13, 2026 11:00
@francispereira
Copy link
Copy Markdown

francispereira commented Apr 13, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

Warning

Rate limit exceeded

@deeksha-rgb has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 39 minutes and 23 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d43d9821-24f1-48b3-a314-bc948ffca647

📥 Commits

Reviewing files that changed from the base of the PR and between 9b557ac and cb173e2.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/CTPUSHTEMPLATES.md
  • docs/CTPUSHTEMPLATESCHANGELOG.md
  • gradle/libs.versions.toml
  • templates/CTPUSHTEMPLATESCHANGELOG.md

Walkthrough

Adds 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

Cohort / File(s) Summary
Core Notification Handling
clevertap-core/.../CTNotificationIntentService.java
Inserted CleverTapAPI.handleNotificationClicked(context, extras); into action-button click flow; removed block Javadoc and simplified an inline comment.
Constants & Template Type
clevertap-pushtemplates/.../PTConstants.java, clevertap-pushtemplates/.../TemplateType.kt
Added chrono and vertical-image/button keys (including collapsed variants); removed several obsolete constants; updated COLOR_KEYS; added TemplateType.VERTICAL_IMAGE.
Template Models
clevertap-pushtemplates/.../TemplateData.kt
Added ButtonStyle enum; extended TimerTemplateData with chronometer styling fields; added VerticalImageButtonData and VerticalImageTemplateData.
Factory & Parsing
clevertap-pushtemplates/.../TemplateDataFactory.kt
Added parsing for VERTICAL_IMAGE, new helpers for vertical-image buttons/collapsed media, and populating chronometer fields from extras.
Rendering & Styles
clevertap-pushtemplates/.../TemplateRenderer.kt, clevertap-pushtemplates/.../styles/VerticalImageStyle.kt
Dispatch support for VerticalImageTemplateData; explicit style imports; builder creation delegates to VerticalImageStyle which provides pending intent/action wiring.
Content Views & Layouts
clevertap-pushtemplates/.../content/VerticalImageContentView.kt, VerticalImageSmallContentView.kt, VerticalImageBigContentView.kt, res/layout*/vertical_image_*.xml
New abstract base and concrete small/big content views implementing button setup, deeplink wiring, and media/text rendering; new layouts for collapsed/expanded vertical-image templates.
Button/Intent Handling
clevertap-pushtemplates/.../PushTemplateReceiver.java, .../content/PendingIntentFactory.kt
Added handleVerticalImageButtonClick() and vertical-image pending intent constants; simplified PendingIntent FLAG logic (always include FLAG_IMMUTABLE or FLAG_MUTABLE when needed) and routing for vertical-image intents.
Bitmap Utilities
clevertap-pushtemplates/.../content/NotificationBitmapUtils.kt
New internal utilities to create rounded rect bitmaps: solid, linear-gradient, radial-gradient, with optional borders and direction handling.
Timer View Styling & Layouts
clevertap-pushtemplates/.../content/TimerSmallContentView.kt, res/layout*/timer*.xml
Chronometer now uses bitmap background generation (style-based) and safe timerEnd handling; layouts wrap Chronometer in chronometer_frame and add chronometer_bg ImageView for background.
Validation
clevertap-pushtemplates/.../validators/ValidatorFactory.kt, .../VerticalImageTemplateValidator.kt
Added validation for VERTICAL_IMAGE requiring big image URL and canonical title/message checks via new VerticalImageTemplateValidator.
Resources
res/drawable/pt_vertical_img_btn_default_bg.xml, res/values*/colors.xml
Added default CTA drawable and light/night color tokens for vertical-image button background/text.
Tests
src/test/.../TemplateDataFactoryTest.kt, TemplateRendererTest.kt, VerticalImageTemplateValidatorTest.kt, NotificationBitmapUtilsTest.kt, UtilsTest.kt
Added extensive tests for vertical-image parsing/rendering/validation and bitmap utilities; extended timer tests; removed one obsolete UtilsTest.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

PushTemplates

Suggested reviewers

  • piyush-kukadiya
  • CTLalit
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Release PT 2.4.0' clearly and concisely summarizes the pull request as a version release, which aligns with the comprehensive changeset adding vertical image templates, timer enhancements, and supporting infrastructure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/release/pt/2.4.0

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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 Double values with assertEquals, 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

📥 Commits

Reviewing files that changed from the base of the PR and between c26db7a and 381df70.

📒 Files selected for processing (32)
  • clevertap-core/src/main/java/com/clevertap/android/sdk/pushnotification/CTNotificationIntentService.java
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PTConstants.java
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/PushTemplateReceiver.java
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateData.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateDataFactory.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateRenderer.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/TemplateType.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/NotificationBitmapUtils.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/PendingIntentFactory.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/TimerSmallContentView.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageBigContentView.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageContentView.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/content/VerticalImageSmallContentView.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/styles/VerticalImageStyle.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/validators/ValidatorFactory.kt
  • clevertap-pushtemplates/src/main/java/com/clevertap/android/pushtemplates/validators/VerticalImageTemplateValidator.kt
  • clevertap-pushtemplates/src/main/res/drawable/pt_vertical_img_btn_default_bg.xml
  • clevertap-pushtemplates/src/main/res/layout-v31/timer.xml
  • clevertap-pushtemplates/src/main/res/layout-v31/timer_collapsed.xml
  • clevertap-pushtemplates/src/main/res/layout-v31/vertical_image_big.xml
  • clevertap-pushtemplates/src/main/res/layout-v31/vertical_image_small.xml
  • clevertap-pushtemplates/src/main/res/layout/timer.xml
  • clevertap-pushtemplates/src/main/res/layout/timer_collapsed.xml
  • clevertap-pushtemplates/src/main/res/layout/vertical_image_big.xml
  • clevertap-pushtemplates/src/main/res/layout/vertical_image_small.xml
  • clevertap-pushtemplates/src/main/res/values-night/colors.xml
  • clevertap-pushtemplates/src/main/res/values/colors.xml
  • clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateDataFactoryTest.kt
  • clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/TemplateRendererTest.kt
  • clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/UtilsTest.kt
  • clevertap-pushtemplates/src/test/java/com/clevertap/android/pushtemplates/VerticalImageTemplateValidatorTest.kt
  • clevertap-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

Comment thread clevertap-pushtemplates/src/main/res/layout/vertical_image_big.xml
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

Code Coverage Debug

Overall Project 67.62% -0.75%
Files changed 49.24%

Module Coverage
clevertap-core 67.67%
clevertap-pushtemplates 61.63% -7.86%
Files
Module File Coverage
clevertap-core CTNotificationIntentService.java 0% -1.81%
clevertap-pushtemplates VerticalImageTemplateValidator.kt 100%
TemplateDataFactory.kt 99.72% -0.28%
PTConstants.java 97.06%
TemplateType.kt 94.52%
TemplateData.kt 87.04% -5.02%
TemplateRenderer.kt 81.85%
ValidatorFactory.kt 27.98%
PushTemplateReceiver.java 2.48% -39.61%

Anush-Shand and others added 3 commits April 13, 2026 16:56
(cherry picked from commit b7169b5)
…emplates SDK version 2.3.0 → 2.4. - Add v2.4.0 entry to PT changelog (Image with CTA template, Timer enhancements)

 - Update integration doc with new PT version
 - Add release date entry to root CHANGELOG.md
Copy link
Copy Markdown
Contributor

@Anush-Shand Anush-Shand left a comment

Choose a reason for hiding this comment

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

LGTM

@Anush-Shand Anush-Shand merged commit dfbeefe into develop Apr 13, 2026
9 checks passed
@Anush-Shand Anush-Shand deleted the task/release/pt/2.4.0 branch April 13, 2026 12:54
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.

4 participants