Skip to content

Update five icons template docs for title support and basic fallback#1004

Open
deeksha-rgb wants to merge 1 commit into
developfrom
five-icons-docs
Open

Update five icons template docs for title support and basic fallback#1004
deeksha-rgb wants to merge 1 commit into
developfrom
five-icons-docs

Conversation

@deeksha-rgb

Copy link
Copy Markdown
Contributor

Update five icons template docs for title support and basic fallback

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

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

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ 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: ba4dfd1e-63df-4af3-8f00-06e1b9c32ff1

📥 Commits

Reviewing files that changed from the base of the PR and between 01e8640 and 10c76de.

📒 Files selected for processing (1)
  • docs/CTPUSHTEMPLATES.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch five-icons-docs

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.

@francispereira

francispereira commented May 7, 2026

Copy link
Copy Markdown

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.

@sid2700

sid2700 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

/vision-review-deep

@clevertap-vision clevertap-vision Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

Summary

Docs-only PR updating the Five Icons template section in docs/CTPUSHTEMPLATES.md to document pt_title/pt_msg and to describe a basic-template fallback behavior. The new prose introduces two claims that do not match the actual SDK code in clevertap-pushtemplates — there is no basic-template fallback for FiveIcons (the notification is dropped), and pt_msg is never rendered.

📊 Visual Overview
flowchart TD
    A[Push payload<br/>pt_id=pt_five_icons] --> B{Validator: ≥3 deeplinks<br/>AND ≥3 images?}
    B -- No --> X[buildIfValid returns null<br/>NO notification rendered]
    B -- Yes --> C[Build FiveIconStyle<br/>setContentTitle pt_title<br/>setCustomContentView icon row]
    C --> D{Unloaded icons > 2<br/>at render time?}
    D -- Yes --> Y[TemplateRenderer returns null<br/>NO notification rendered<br/>PTLog: 'not displaying Notification']
    D -- No --> E[Notification shown<br/>title + icon row<br/>pt_msg never used]
    
    style X fill:#fdd
    style Y fill:#fdd
    style E fill:#dfd
Loading

Verdict

REQUEST CHANGES

The two new behavioral claims in the prose (basic-template fallback) and the new pt_msg row in the keys table are not supported by the current code. See inline comments for evidence and suggested wording. The pt_title addition is partially accurate but worth qualifying.


To retrigger this review, comment /vision-review-deep on the PR.

Reviewed by Vision AI

Comment thread docs/CTPUSHTEMPLATES.md
Five icons template is a push notification that can display a title and message above a row of up to 5 icons. It helps users go directly to the functionality of their choice with a button click.

If at least 3 icons are not retrieved, the library doesn't render any notification. The bifurcation of each CTA is captured in the event Notification Clicked with in the property `wzrk_c2a`.
`pt_title` and `pt_msg` are optional, but when provided they are rendered above the icon row.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🐛 Documentation inaccuracy — no basic-template fallback exists for Five Icons

This sentence claims two fallback paths to a basic notification, but neither matches the current code in clevertap-pushtemplates:

  1. Invalid payload (insufficient icons/deeplinks): FiveIconsTemplateValidator requires ≥3 deeplinks and ≥3 images; on failure buildIfValid returns null and the notification is dropped — there is no toBasicTemplateData() path for FiveIcons (compare with TimerTemplateData, TemplateRenderer.kt:166,176 which does fall back). See validators/FiveIconsTemplateValidator.kt:5-9 and TemplateRenderer.kt:216-217.
  2. ≥3 icon images fail to load at render time: TemplateRenderer.kt:147-149 returns null (no notification at all), not a basic notification:
    if ((... .getUnloadedFiveIconsCount() > 2 ||
         ... .getUnloadedFiveIconsCount() > 2) {
        null
    This matches the explicit log line in FiveIconSmallContentView.kt:115 / FiveIconBigContentView.kt:108:

    "More than 2 images were not retrieved in 5CTA Notification, not displaying Notification."

Suggested wording that matches actual behavior:

Suggested change
`pt_title` and `pt_msg` are optional, but when provided they are rendered above the icon row.
If the payload does not contain at least 3 valid icons and 3 deeplinks, or if 3 or more icon images fail to download at render time, the library does not render any notification.

If the intent of this PR is to actually introduce a basic-template fallback for FiveIcons, then a code change in TemplateRenderer.kt is missing from this PR and the docs are ahead of the implementation.

Comment thread docs/CTPUSHTEMPLATES.md
---:|:---:|:---
pt_id | Required | Value - `pt_five_icons`
pt_title | Optional | Title rendered above icons
pt_msg | Optional | Message rendered above icons

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🐛 pt_msg is not rendered by the Five Icons template

I couldn't find any code path that consumes a Five Icons pt_msg. The notification builder in styles/Style.kt:47-48 only calls setContentTitle(Html.fromHtml(pt_title)) — there is no corresponding setContentText(...) for FiveIcons (a grep for setContentText in clevertap-pushtemplates only turns up InputBoxStyle.kt:36 and PushTemplateReceiver.java:314, neither of which is the FiveIcons path). The two custom layouts res/layout/five_cta_collapsed.xml and res/layout/five_cta_expanded.xml also contain no TextView (grep for TextView|title|msg returns 0 matches in both).

Net effect: documenting pt_msg as "Message rendered above icons" will mislead integrators — the field will be silently ignored at render time.

Either:

  • drop this row from the table (and remove the "and message" wording from the section prose above), or
  • add the missing code change (a setContentText(...) in FiveIconStyle/Style for FiveIcons, and a TextView in the custom layouts) to this PR before merging the docs.

Comment thread docs/CTPUSHTEMPLATES.md
## Five Icons Template

Five icons template is a push notification with no text, just 5 icons which can help your users go directly to the functionality of their choice with a button's click.
Five icons template is a push notification that can display a title and message above a row of up to 5 icons. It helps users go directly to the functionality of their choice with a button click.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Qualify the title-rendering claim

pt_title is wired through Style.kt:48 (setContentTitle(Html.fromHtml(pt_title))), so it does appear in the standard notification header — but the FiveIcons template uses setCustomContentView / setCustomBigContentView (see Style.kt:28-33) and only opts into DecoratedCustomViewStyle on Android S+ (Style.kt:55-59). On pre-S devices the custom view replaces the standard notification chrome, so the title may not visibly appear "above the icon row" the way the prose implies — the icon row IS the whole notification on those devices.

Consider qualifying the wording, e.g. "…can display a title above a row of up to 5 icons (rendered via the standard notification header on Android 12+ using DecoratedCustomViewStyle)", or verify on pre-Android-12 emulators before keeping the current phrasing.

Comment thread docs/CTPUSHTEMPLATES.md
If the user clicks anywhere outside the icon CTAs, the default notification click action launches the activity intent.

<img src="https://github.com/CleverTap/clevertap-android-sdk/blob/master/static/fiveicon.png" width="412" height="100">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Nit: extra blank line introduced between the <img> tag and ## Timer Template — the rest of the doc uses a single blank line between sections. Not blocking.

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