Skip to content

Comments

Support of new cell bounty boost rewards#325

Merged
pantelisss merged 5 commits intomainfrom
feature/fe-2056-support-of-new-cell-bounty-boost-rewards
Nov 27, 2025
Merged

Support of new cell bounty boost rewards#325
pantelisss merged 5 commits intomainfrom
feature/fe-2056-support-of-new-cell-bounty-boost-rewards

Conversation

@pantelisss
Copy link
Collaborator

@pantelisss pantelisss commented Nov 26, 2025

Why?

Handle cell bounty boost

How?

Added cell bounty boost code and it's handling

Testing

Test using the api-dev or the mock scheme playing with get_device_rewards_analytics_7d.json file

Additional context

fixes fe-2056

Summary by CodeRabbit

  • New Features
    • Added Cell Bounty as a new reward type. Users can now view Cell Bounty rewards in their reward analytics and daily rewards details with dedicated styling and localization support.

✏️ Tip: You can customize this high-level summary in your review settings.

@pantelisss pantelisss requested a review from PavlosTze November 26, 2025 12:37
@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

This PR introduces support for a new "cellBounty" boost type by adding color assets, localization strings, enum cases, and business logic handling across the presentation, domain, and data layers, with corresponding mock data updates.

Changes

Cohort / File(s) Summary
Color Assets
wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesFill.colorset/Contents.json, wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesPrimary.colorset/Contents.json
Added two new color sets for cellBounties with light and dark mode variants; cellBountiesFill uses full opacity (1.0), cellBountiesPrimary uses 70% opacity (0.7).
Localization & Strings
wxm-ios/Resources/Localizable/Localizable.xcstrings, wxm-ios/Resources/Localizable/LocalizableString+RewardAnalytics.swift
Added two new localizable strings (reward_analytics_cell_bounty and reward_analytics_cell_bounty_rewards) with English translations and corresponding enum cases in RewardAnalytics extension.
Enum & Domain Layer
PresentationLayer/Constants/ColorEnum.swift, wxm-ios/DomainLayer/DomainLayer/Entities/Codables/Me/Network/NetworkDeviceRewardDetailsResponse.swift
Added cellBountiesFill and cellBountiesPrimary color enum cases; introduced cellBounty(String) case to BoostCode enum with decoding logic for "cell_bounty" prefix strings.
Boost Extension & UI Logic
PresentationLayer/Extensions/DomainExtensions/BoostCode+.swift, PresentationLayer/UIComponents/Screens/DailyRewards/RewardDetailsViewModel.swift
Extended BoostCode computed properties (displayName, primaryColor, fillColor, chartColor, legendTitle) to handle cellBounty case; updated RewardDetailsViewModel to recognize cellBounty in switch cases alongside existing boost types.
Mock Data
wxm-ios/DataLayer/DataLayer/Networking/Mock/Jsons/get_device_rewards_analytics_7d.json
Added sample cellBounty reward entries with code "cell_bounty_873f728d0ffffff" across multiple daily reward arrays and a corresponding details section entry.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify consistency of RGB color values between light/dark mode variants across both new color sets
  • Confirm BoostCode string decoding correctly identifies "cell_bounty" prefix and encodes back to raw string
  • Ensure RewardDetailsViewModel explicit case handling for cellBounty is complete and doesn't inadvertently affect fallback behavior
  • Validate mock JSON structure mirrors existing boost entries and aligns with NetworkDeviceRewardDetailsResponse expected format

Possibly related PRs

  • Handle TRO boost code #316: Modifies the same files and code paths (ColorEnum, BoostCode extension, RewardDetailsViewModel, NetworkDeviceRewardDetailsResponse, assets/localization) to add new boost case support.
  • Handle correction boost code #308: Adds support for a new boost type by updating BoostCode enum, ColorEnum, localization, RewardDetailsViewModel, and chart/asset mappings.
  • Chart issue in reward anaytics #172: Modifies the BoostCode enum in NetworkDeviceRewardDetailsResponse.swift with structural changes to the same enum.

Suggested reviewers

  • PavlosTze

Poem

🐰 A bounty from cells, shiny and bright,
With colors that dance in dark and light,
New cases mapped through every layer deep,
Localized strings for rewards we reap!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding support for a new cell bounty boost rewards feature across the codebase.
Description check ✅ Passed The description includes most required sections (Why, How, Testing, Additional context) with reasonable detail, though Testing section could be more specific about verification steps.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fe-2056-support-of-new-cell-bounty-boost-rewards

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed0618f and a0ec9b0.

📒 Files selected for processing (9)
  • PresentationLayer/Constants/ColorEnum.swift (1 hunks)
  • PresentationLayer/Extensions/DomainExtensions/BoostCode+.swift (5 hunks)
  • PresentationLayer/UIComponents/Screens/DailyRewards/RewardDetailsViewModel.swift (1 hunks)
  • wxm-ios/DataLayer/DataLayer/Networking/Mock/Jsons/get_device_rewards_analytics_7d.json (5 hunks)
  • wxm-ios/DomainLayer/DomainLayer/Entities/Codables/Me/Network/NetworkDeviceRewardDetailsResponse.swift (3 hunks)
  • wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesFill.colorset/Contents.json (1 hunks)
  • wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesPrimary.colorset/Contents.json (1 hunks)
  • wxm-ios/Resources/Localizable/Localizable.xcstrings (1 hunks)
  • wxm-ios/Resources/Localizable/LocalizableString+RewardAnalytics.swift (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
PresentationLayer/UIComponents/Screens/DailyRewards/RewardDetailsViewModel.swift (1)
PresentationLayer/UIComponents/ViewModelsFactory.swift (1)
  • getRewardsBoostViewModel (187-190)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: WeatherXM | Unit tests | wxm-ios - iOS
🔇 Additional comments (9)
PresentationLayer/Constants/ColorEnum.swift (1)

75-76: New reward color cases look consistent

cellBountiesFill and cellBountiesPrimary follow the existing reward/boost naming pattern and are grouped appropriately with related colors. No issues from a presentation-constants perspective.

wxm-ios/Resources/Localizable/Localizable.xcstrings (1)

8473-8494: Cell bounty reward analytics strings are consistent and ready to use

The new reward_analytics_cell_bounty and reward_analytics_cell_bounty_rewards entries match the existing naming and structure (beta, beta_rewards, etc.), with correct extractionState and translated values. No issues from a localization/formatting perspective; they should integrate cleanly with the new enum cases and UI usage.

PresentationLayer/Extensions/DomainExtensions/BoostCode+.swift (1)

20-21: Cell bounty mappings are wired consistently across UI properties

cellBounty now has dedicated localized labels and primary/fill/chart colors, and all BoostCode switches remain exhaustive. No issues from a code or behavior perspective.

Also applies to: 35-36, 50-51, 65-66, 80-81

wxm-ios/DataLayer/DataLayer/Networking/Mock/Jsons/get_device_rewards_analytics_7d.json (1)

46-51: Mock data correctly introduces a reusable cell_bounty boost code

The new "cell_bounty_873f728d0ffffff" entries in both data[].rewards and details[] follow the existing structure (type "boost", shared code across days) and align with the new BoostCode prefix logic. Looks good for exercising the new cell bounty path in the mock scheme.

Also applies to: 71-76, 101-106, 126-131, 188-195

wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesPrimary.colorset/Contents.json (1)

1-38: Primary color asset for cell bounty is well-formed

The colorset defines light/dark sRGB variants with consistent alpha and idiom, matching typical Xcode asset structure. No changes needed.

PresentationLayer/UIComponents/Screens/DailyRewards/RewardDetailsViewModel.swift (1)

225-232: Cell bounty tap handling integrated with existing boost flow

Including .cellBounty in the handled branch and routing unknown/none codes to the unhandled toast keeps behavior consistent and makes the switch exhaustive over BoostCode?. This is a clean extension of the existing UX.

wxm-ios/DomainLayer/DomainLayer/Entities/Codables/Me/Network/NetworkDeviceRewardDetailsResponse.swift (1)

118-129: BoostCode now cleanly models cell_bounty* codes

The new cellBounty(String) case, together with the hasPrefix("cell_bounty") check and rawValue passthrough, ensures all cell_bounty... strings round‑trip via Codable as a dedicated case instead of falling into .unknown. This is consistent with how correction* codes are handled.

Also applies to: 142-143

wxm-ios/Resources/Colors.xcassets/Boosts/cellBountiesFill.colorset/Contents.json (1)

1-38: Fill color asset for cell bounty is consistent with primary variant

The fill colorset correctly defines light/dark sRGB variants and complements cellBountiesPrimary; it should work seamlessly with the new ColorEnum cases.

wxm-ios/Resources/Localizable/LocalizableString+RewardAnalytics.swift (1)

27-29: New reward analytics localization keys follow existing conventions

Adding cellBounty / cellBountyRewards with corresponding reward_analytics_cell_bounty(_rewards) keys mirrors the existing beta/rollouts/compensation patterns and integrates cleanly with BoostCode+.displayName and legendTitle.

Also applies to: 89-92

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

@weatherxmdev
Copy link
Collaborator

Code Coverage Summary

Framework Source Files Coverage
DataLayer.framework 49 66.82%
DomainLayer.framework 67 83.70%
Toolkit.framework 30 53.38%
WeatherXM.app 406 14.17%
station-intent.appex 2 83.33%
station-widgetExtension.appex 45 33.98%

@pantelisss pantelisss merged commit 1925552 into main Nov 27, 2025
4 checks passed
@pantelisss pantelisss deleted the feature/fe-2056-support-of-new-cell-bounty-boost-rewards branch November 27, 2025 08:58
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