Release: 2.26.2#205
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Review Summary by QodoRelease version 2.26.2 with fixes and enhancements
WalkthroughsDescription• Release version 2.26.2 with bug fixes and improvements • Added "More" button color customization properties • Fixed consent banner display and persistence issues • Improved SDK initialization logging and UI alignment Diagramflowchart LR
A["Version Update<br/>2.26.1 → 2.26.2"] --> B["Bug Fixes<br/>Android/iOS/TCF"]
A --> C["UI Enhancements<br/>More Button Colors"]
B --> D["Release Notes<br/>& Documentation"]
C --> D
File Changes1. android/build.gradle.kts
|
📝 WalkthroughWalkthroughA patch version release (2.26.1 → 2.26.2) with changelog documentation, dependency version bumps in Android build files, package version updates, and iOS serialization extension adding two new color fields for "more" button customization. Changes
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Suggested reviewers
Poem
🚥 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 docstrings
🧪 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 |
Code Review by Qodo
|
|
PR Summary: Release 2.26.2: version bumps, changelog update, and iOS UI color serialization for the "More" button (plus test mock).
|
|
Reviewed up to commit:c368401c3c839cf22e9604f4ef9e58d109178340 |
| "moreBtnBackground" : self.moreBtnBackground as Any, | ||
| "moreBtnText" : self.moreBtnText as Any, |
There was a problem hiding this comment.
1. Ios/android color fields diverge 🐞 Bug ≡ Correctness
iOS now includes moreBtnBackground/moreBtnText in CustomizationColor.toDictionary(), but Android’s CustomizationColor.serialize() still omits them, so the JS payload differs by platform and “More” button colors will be unavailable on Android.
Agent Prompt
### Issue description
iOS now serializes `CustomizationColor.moreBtnBackground` and `CustomizationColor.moreBtnText` into the JS payload, but Android does not. This makes the React Native API platform-inconsistent and prevents Android apps from receiving the new “More” button color customization.
### Issue Context
The iOS side added two new keys in `CustomizationColor.toDictionary()`. Android’s corresponding `CustomizationColor.serialize()` should expose the same keys when present.
### Fix Focus Areas
- android/src/main/java/com/usercentrics/reactnative/extensions/UsercentricsCMPDataExtensions.kt[308-330]
- ios/Extensions/UsercentricsCMPData+Dict.swift[270-295]
### Expected change
Add `"moreBtnBackground"` and `"moreBtnText"` to the map returned by `CustomizationColor.serialize()` (reading from the SDK model fields), matching the iOS key names.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ios/Extensions/UsercentricsCMPData`+Dict.swift:
- Around line 292-293: The CustomizationColor.toDictionary() serializer is
missing three color keys present in the mock (tabsBorderColor, ccpaButtonColor,
ccpaButtonTextColor); update the toDictionary() implementation in the
CustomizationColor type to include these three keys (tabsBorderColor,
ccpaButtonColor, ccpaButtonTextColor) alongside the existing moreBtnBackground
and moreBtnText so the bridge contract matches the mock data (ensure you use the
same dictionary key names and map them from the corresponding CustomizationColor
properties).
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: b055ee86-3b35-431c-be1d-b0ca766572f3
⛔ Files ignored due to path filters (2)
package-lock.jsonis excluded by!**/package-lock.jsonsample/ios/Podfile.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
CHANGELOG.mdandroid/build-legacy.gradleandroid/build.gradle.ktsios/Extensions/UsercentricsCMPData+Dict.swiftpackage.jsonsample/ios/sampleTests/Mock/CMPData+Mock.swift
| "moreBtnBackground" : self.moreBtnBackground as Any, | ||
| "moreBtnText" : self.moreBtnText as Any, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check field parity for CustomizationColor across Swift/TS/Kotlin surfaces
rg -n --type=swift --type=ts --type=kt \
'moreBtnBackground|moreBtnText|tabsBorderColor|ccpaButtonColor|ccpaButtonTextColor'Repository: Usercentrics/react-native-sdk
Length of output: 99
🏁 Script executed:
#!/bin/bash
# Search for CustomizationColor field definitions and usage
# Fix: use proper file type flags and broader search
# First, check rg supported types
echo "=== Checking available Kotlin patterns ==="
rg -n 'moreBtnBackground|moreBtnText|tabsBorderColor|ccpaButtonColor|ccpaButtonTextColor' --max-count=30
echo ""
echo "=== Locate CustomizationColor definition ==="
rg -n 'class CustomizationColor|interface CustomizationColor' --type=swift --type=tsRepository: Usercentrics/react-native-sdk
Length of output: 903
🏁 Script executed:
#!/bin/bash
# Check the referenced mock file location and content
echo "=== Verify mock file reference ==="
find . -name "CMPData+Mock.swift" -type f
echo ""
echo "=== Read referenced lines 509-511 from mock file ==="
if [ -f "sample/ios/sampleTests/Mock/CMPData+Mock.swift" ]; then
sed -n '500,520p' "sample/ios/sampleTests/Mock/CMPData+Mock.swift"
fiRepository: Usercentrics/react-native-sdk
Length of output: 1145
🏁 Script executed:
#!/bin/bash
# Search for where these color fields are defined/used in native bridge
echo "=== Find all color field definitions across Swift and TypeScript ==="
rg -n -A3 -B3 'ccpaButtonColor|tabsBorderColor' --type=swift --type=ts | head -100Repository: Usercentrics/react-native-sdk
Length of output: 999
🏁 Script executed:
#!/bin/bash
# Read the complete UsercentricsCMPData+Dict.swift file to see the full toDictionary method
wc -l ios/Extensions/UsercentricsCMPData+Dict.swiftRepository: Usercentrics/react-native-sdk
Length of output: 122
🏁 Script executed:
#!/bin/bash
# Search for CustomizationColor extension in the target file
rg -n -B5 -A30 'extension CustomizationColor' ios/Extensions/UsercentricsCMPData+Dict.swift | head -150Repository: Usercentrics/react-native-sdk
Length of output: 1614
🏁 Script executed:
#!/bin/bash
# Get broader context around lines 292-293 to see the method structure
sed -n '250,310p' ios/Extensions/UsercentricsCMPData+Dict.swiftRepository: Usercentrics/react-native-sdk
Length of output: 2073
🏁 Script executed:
#!/bin/bash
# Find CustomizationColor class definition
rg -n -B2 -A50 'class CustomizationColor' --type=swift | head -100Repository: Usercentrics/react-native-sdk
Length of output: 55
🏁 Script executed:
#!/bin/bash
# Search for CustomizationColor definition without restricting to "class"
rg -n 'CustomizationColor' --type=swift | grep -E '(struct|class|var|let|func).*CustomizationColor' | head -20Repository: Usercentrics/react-native-sdk
Length of output: 168
🏁 Script executed:
#!/bin/bash
# Find where CustomizationColor is first declared/defined
rg -n '^(struct|class|protocol|typealias)\s+CustomizationColor' --type=swiftRepository: Usercentrics/react-native-sdk
Length of output: 55
🏁 Script executed:
#!/bin/bash
# List files in ios directory that might contain model definitions
find ios -name "*.swift" -type f | head -30Repository: Usercentrics/react-native-sdk
Length of output: 1037
🏁 Script executed:
#!/bin/bash
# Search entire repo for CustomizationColor definition
rg -n '(struct|class|interface|type)\s+CustomizationColor' | head -20Repository: Usercentrics/react-native-sdk
Length of output: 55
🏁 Script executed:
#!/bin/bash
# Also check if it's a TypeScript/JavaScript type
rg -n 'CustomizationColor\s*[:=]' --type=ts --type=js | head -20Repository: Usercentrics/react-native-sdk
Length of output: 55
🏁 Script executed:
#!/bin/bash
# Look for import statements for CustomizationColor in the extension file
grep -n 'import\|CustomizationColor' ios/Extensions/UsercentricsCMPData+Dict.swift | head -10Repository: Usercentrics/react-native-sdk
Length of output: 149
Add missing color fields to CustomizationColor.toDictionary().
Lines 292–293 correctly add moreBtnBackground and moreBtnText, but the serializer is missing three other color fields that appear in the mock data: tabsBorderColor, ccpaButtonColor, and ccpaButtonTextColor (see sample/ios/sampleTests/Mock/CMPData+Mock.swift lines 509–511). Ensure the bridge contract is complete and consistent between mock and implementation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@ios/Extensions/UsercentricsCMPData`+Dict.swift around lines 292 - 293, The
CustomizationColor.toDictionary() serializer is missing three color keys present
in the mock (tabsBorderColor, ccpaButtonColor, ccpaButtonTextColor); update the
toDictionary() implementation in the CustomizationColor type to include these
three keys (tabsBorderColor, ccpaButtonColor, ccpaButtonTextColor) alongside the
existing moreBtnBackground and moreBtnText so the bridge contract matches the
mock data (ensure you use the same dictionary key names and map them from the
corresponding CustomizationColor properties).
| "toggleDisabledBackground" : self.toggleDisabledBackground as Any, | ||
| "toggleDisabledIcon" : self.toggleDisabledIcon as Any, | ||
| "secondLayerTab" : self.secondLayerTab as Any, | ||
| "moreBtnBackground" : self.moreBtnBackground as Any, |
There was a problem hiding this comment.
Suggestion: The new customization color mapping is incomplete: ccpaButtonTextColor is now part of CustomizationColor (also added in the updated mock), but it is not serialized in this dictionary. This causes a schema mismatch where React Native receives an incomplete color payload and cannot access that field on iOS. [logic error]
Severity Level: Major ⚠️
- ⚠️ iOS getCMPData omits CustomizationColor.ccpaButtonTextColor property.
- ⚠️ React Native apps cannot theme CCPA button text color.
- ⚠️ iOS bridge diverges from underlying Usercentrics CustomizationColor model.
- ⚠️ Tests cannot assert ccpaButtonTextColor presence in settings payload.| "moreBtnBackground" : self.moreBtnBackground as Any, | |
| "ccpaButtonTextColor" : self.ccpaButtonTextColor as Any, |
Steps of Reproduction ✅
1. From JavaScript, call `Usercentrics.getCMPData()` as done in
`sample/src/screens/CustomUI.tsx:5-7`, which invokes the native iOS bridge to fetch CMP
data.
2. On iOS, this calls `RNUsercentricsModule.getCMPData` at
`ios/RNUsercentricsModule.swift:18-20`, which resolves
`usercentricsManager.getCMPData().toDictionary()` and returns the resulting NSDictionary
back to JS.
3. `UsercentricsManagerImplementation.getCMPData` at
`ios/Manager/UsercentricsManager.swift:88-89` returns
`UsercentricsCore.shared.getCMPData()`, which is converted via
`UsercentricsCMPData.toDictionary()` in
`ios/Extensions/UsercentricsCMPData+Dict.swift:4-13`. That method includes `"settings":
self.settings.toDictionary()`, where `UsercentricsSettings.toDictionary()` at
`ios/Extensions/UsercentricsCMPData+Dict.swift:17-51` serializes `"customization" :
self.customization?.toDictionary() as Any`.
4. `UsercentricsCustomization.toDictionary()` at
`ios/Extensions/UsercentricsCMPData+Dict.swift:243-252` serializes `"color" :
self.color?.toDictionary() as Any`, which calls `CustomizationColor.toDictionary()`
defined at `ios/Extensions/UsercentricsCMPData+Dict.swift:271-45`. This mapping includes
keys like `"primary"`, `"secondLayerTab"`, `"moreBtnBackground"`, and `"moreBtnText"`
(lines 273-44) but does not serialize any `"ccpaButtonTextColor"` key. However, the
`CustomizationColor` type in the SDK clearly has a `ccpaButtonTextColor` property, as
shown by the mock initializer in `sample/ios/sampleTests/Mock/CMPData+Mock.swift:58-67`
and `80-83`, where `CustomizationColor.mock()` sets `ccpaButtonTextColor:
"ccpaButtonTextColor"`. Because `CustomizationColor.toDictionary()` never includes this
field, the NSDictionary returned by `getCMPData()` to JavaScript lacks
`settings.customization.color.ccpaButtonTextColor`, so any React Native code attempting to
read `data.settings.customization.color.ccpaButtonTextColor` will always get `undefined`
despite the native SDK providing a value.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** ios/Extensions/UsercentricsCMPData+Dict.swift
**Line:** 292:292
**Comment:**
*Logic Error: The new customization color mapping is incomplete: `ccpaButtonTextColor` is now part of `CustomizationColor` (also added in the updated mock), but it is not serialized in this dictionary. This causes a schema mismatch where React Native receives an incomplete color payload and cannot access that field on iOS.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.| "moreBtnBackground" : self.moreBtnBackground as Any, | ||
| "moreBtnText" : self.moreBtnText as Any, |
There was a problem hiding this comment.
🟠 Architect Review — HIGH
The new "More" button color fields (moreBtnBackground, moreBtnText) are only exposed in the iOS CMP data serialization, while the Android serializer (CustomizationColor.serialize in UsercentricsCMPDataExtensions.kt) still stops at secondLayerTab, breaking the otherwise platform-symmetric getCMPData contract for custom UI colors.
Suggestion: Update the Android CustomizationColor.serialize() implementation to include moreBtnBackground and moreBtnText (mirroring the iOS CustomizationColor.toDictionary()), so getCMPData returns a consistent customization color payload on both platforms.
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** ios/Extensions/UsercentricsCMPData+Dict.swift
**Line:** 292:293
**Comment:**
*HIGH: The new "More" button color fields (`moreBtnBackground`, `moreBtnText`) are only exposed in the iOS CMP data serialization, while the Android serializer (`CustomizationColor.serialize` in UsercentricsCMPDataExtensions.kt) still stops at `secondLayerTab`, breaking the otherwise platform-symmetric `getCMPData` contract for custom UI colors.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.|
CodeAnt AI finished reviewing your PR. |
CodeAnt-AI Description
Release 2.26.2
What Changed
Impact
✅ Clearer release tracking✅ Fewer banner style issues on iOS✅ More accurate version reporting across platforms🔄 Retrigger CodeAnt AI Review
Details
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
Summary by CodeRabbit
New Features
Bug Fixes