Skip to content

Conversation

@jaypanchal-13
Copy link
Contributor

@jaypanchal-13 jaypanchal-13 commented Jul 28, 2025

Product Description

Ticket -> https://dimagi.atlassian.net/browse/CCCT-844
Updated msg for all languages and updated color of progressbar to green when daily visits >= max daily limit

Technical Summary

Feature Flag

Safety Assurance

Safety story

Automated test coverage

QA Plan

Labels and Review

  • Do we need to enhance the manual QA test coverage ? If yes, the "QA Note" label is set correctly
  • Does the PR introduce any major changes worth communicating ? If yes, the "Release Note" label is set and a "Release Note" is specified in PR description.
  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

📝 Walkthrough

Walkthrough

The changes update the string resource connect_progress_warning_daily_max_reached_single across multiple language files (English, Spanish, French, Hindi, Portuguese, Swahili) to alter the message from a definitive statement about progress restriction to a more tentative one, indicating that users may not earn progress or access further work after reaching the daily maximum. Additionally, in the ConnectProgressJobSummaryAdapter.java file, a conditional check was introduced to set the progress bar color to green when the payment unit amount meets or exceeds the maximum daily payment unit.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Adapter
    participant ProgressBar

    User->>Adapter: Triggers onBindViewHolder
    Adapter->>Adapter: Check if paymentUnitAmount >= maxDailyPaymentUnit
    alt Condition met
        Adapter->>ProgressBar: Set color to green
    end
    Adapter->>ProgressBar: Set progress percentage
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

cross requested

Suggested reviewers

  • shubham1g5
  • OrangeAndGreen

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Bug-CCCT-844

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (5)
app/res/values-pt/strings.xml (1)

343-343: Use “acessar” instead of “aceder” to stay consistent with Brazilian-Portuguese wording

Most strings in this file adopt Brazilian vocabulary (e.g., “aplicativo”, “Gerenciador”).
“aceder” is European; prefer “acessar” for dialect consistency.

-    <string name="connect_progress_warning_daily_max_reached_single">Atingiu o número máximo de visitas para hoje. Talvez não consiga aceder a mais tarefas.</string>
+    <string name="connect_progress_warning_daily_max_reached_single">Atingiu o número máximo de visitas para hoje. Talvez não consiga acessar mais tarefas.</string>
app/res/values-hi/strings.xml (1)

332-332: Avoid English loan-word “एक्सेस”; use a Hindi equivalent for consistency

The surrounding strings keep Hindi wording (e.g., “प्रगति”, “कार्य”). Replacing “एक्सेस” with “पहुंच” maintains linguistic coherence.

-    <string name="connect_progress_warning_daily_max_reached_single">आप आज के लिए अधिकतम विज़िट संख्या तक पहुँच चुके हैं। हो सकता है कि आप आगे कोई कार्य एक्सेस न कर पाएँ।</string>
+    <string name="connect_progress_warning_daily_max_reached_single">आप आज के लिए अधिकतम विज़िट संख्या तक पहुँच चुके हैं। हो सकता है कि आप आगे कोई कार्य तक पहुँच न कर पाएँ।</string>
app/src/org/commcare/adapters/ConnectProgressJobSummaryAdapter.java (1)

43-45: LGTM! Good visual feedback for completed daily maximums.

The conditional logic correctly identifies when users have reached or exceeded their daily maximum visits and provides appropriate visual feedback by changing the progress bar color to green.

Consider using the non-deprecated ContextCompat.getColor() method for better compatibility:

-holder.lpPrimaryVisitProgress.setProgressColor(holder.lpPrimaryVisitProgress.getResources().getColor(R.color.green));
+holder.lpPrimaryVisitProgress.setProgressColor(ContextCompat.getColor(holder.itemView.getContext(), R.color.green));

You'll need to add the import: import androidx.core.content.ContextCompat;

app/res/values-sw/strings.xml (1)

336-336: Refine Swahili phrasing for clarity and voice

kutembelewa is passive (being visited) while the English intent is active visits performed by the user; ziara is clearer here. Likewise, “majukumu yoyote zaidi” sounds awkward; “kazi zozote zaidi” is the more common phrasing for additional tasks.

-    <string name="connect_progress_warning_daily_max_reached_single">Umefikia idadi yako ya juu zaidi ya kutembelewa leo. Huenda usiweze kufikia majukumu yoyote zaidi.</string>
+    <string name="connect_progress_warning_daily_max_reached_single">Umefikia idadi yako ya juu zaidi ya ziara leo. Huenda usiweze kukamilisha kazi zozote zaidi.</string>
app/res/values-fr/strings.xml (1)

333-333: Polish French wording for naturalness

“Aux tâches suivantes” reads literal; “de tâches supplémentaires” better matches “any more tasks”. Also adjust article for smoother flow.

-    <string name="connect_progress_warning_daily_max_reached_single">Vous avez atteint le nombre maximal de visites pour aujourd'hui. Vous ne pourrez peut-être plus accéder aux tâches suivantes.</string>
+    <string name="connect_progress_warning_daily_max_reached_single">Vous avez atteint votre nombre maximal de visites aujourd'hui. Vous ne pourrez peut-être pas effectuer de tâches supplémentaires.</string>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between add2c5d and 30e39ba.

📒 Files selected for processing (7)
  • app/res/values-es/strings.xml (1 hunks)
  • app/res/values-fr/strings.xml (1 hunks)
  • app/res/values-hi/strings.xml (1 hunks)
  • app/res/values-pt/strings.xml (1 hunks)
  • app/res/values-sw/strings.xml (1 hunks)
  • app/res/values/strings.xml (1 hunks)
  • app/src/org/commcare/adapters/ConnectProgressJobSummaryAdapter.java (1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: shubham1g5
PR: dimagi/commcare-android#0
File: :0-0
Timestamp: 2025-05-08T11:08:18.530Z
Learning: PR #3048 "Phase 4 Connect PR" introduces a substantial feature called "Connect" to the CommCare Android app, which includes messaging, job management, delivery tracking, payment processing, authentication flows, and learning modules. It follows a modern architecture using Navigation Components with three navigation graphs, segregated business logic in Manager classes, and proper database persistence.
Learnt from: Jignesh-dimagi
PR: dimagi/commcare-android#0
File: :0-0
Timestamp: 2025-05-08T13:40:19.645Z
Learning: PR #3048 introduces a comprehensive messaging system in the Connect feature, implementing secure encryption using AES-GCM for message content, proper channel management with consent flows, and a well-designed UI separation between sent and received messages with real-time notification integration.
Learnt from: OrangeAndGreen
PR: dimagi/commcare-android#3121
File: app/res/values-ti/strings.xml:350-350
Timestamp: 2025-05-22T14:32:53.133Z
Learning: PersonalID and Connect features haven't been translated to Spanish, Lithuanian, or Norwegian yet, so users with those language settings see the English strings by default.
app/res/values-es/strings.xml (2)

Learnt from: OrangeAndGreen
PR: #3121
File: app/res/values-ti/strings.xml:350-350
Timestamp: 2025-05-22T14:32:53.133Z
Learning: PersonalID and Connect features haven't been translated to Spanish, Lithuanian, or Norwegian yet, so users with those language settings see the English strings by default.

Learnt from: Jignesh-dimagi
PR: #3070
File: app/res/values/strings.xml:73-73
Timestamp: 2025-05-07T06:50:52.518Z
Learning: The empty remote_form_payload_url string resource in strings.xml is intentional legacy code and should be preserved as-is.

app/res/values-sw/strings.xml (1)

Learnt from: Jignesh-dimagi
PR: #3070
File: app/res/values/strings.xml:73-73
Timestamp: 2025-05-07T06:50:52.518Z
Learning: The empty remote_form_payload_url string resource in strings.xml is intentional legacy code and should be preserved as-is.

app/res/values-pt/strings.xml (1)

Learnt from: OrangeAndGreen
PR: #3121
File: app/res/values-ti/strings.xml:350-350
Timestamp: 2025-05-22T14:32:53.133Z
Learning: PersonalID and Connect features haven't been translated to Spanish, Lithuanian, or Norwegian yet, so users with those language settings see the English strings by default.

app/src/org/commcare/adapters/ConnectProgressJobSummaryAdapter.java (2)

Learnt from: shubham1g5
PR: dimagi/commcare-android#0
File: :0-0
Timestamp: 2025-05-08T11:08:18.530Z
Learning: PR #3048 "Phase 4 Connect PR" introduces a substantial feature called "Connect" to the CommCare Android app, which includes messaging, job management, delivery tracking, payment processing, authentication flows, and learning modules. It follows a modern architecture using Navigation Components with three navigation graphs, segregated business logic in Manager classes, and proper database persistence.

Learnt from: OrangeAndGreen
PR: #3108
File: app/src/org/commcare/models/connect/ConnectLoginJobListModel.java:79-92
Timestamp: 2025-06-20T15:51:14.157Z
Learning: The ConnectLoginJobListModel class in app/src/org/commcare/models/connect/ConnectLoginJobListModel.java does not need to implement Parcelable interface as it is not passed between Android activities or fragments.

app/res/values/strings.xml (1)

Learnt from: OrangeAndGreen
PR: #3121
File: app/res/values-ti/strings.xml:350-350
Timestamp: 2025-05-22T14:32:53.133Z
Learning: PersonalID and Connect features haven't been translated to Spanish, Lithuanian, or Norwegian yet, so users with those language settings see the English strings by default.

🔇 Additional comments (2)
app/res/values/strings.xml (1)

442-442: LGTM! Improved user messaging tone.

The change from "You will not earn any progress" to "You may not earn any progress" appropriately softens the messaging to be less definitive and more user-friendly when users reach their daily maximum visits.

app/res/values-es/strings.xml (1)

334-334: LGTM! Consistent translation of improved messaging.

The Spanish translation appropriately reflects the same softening of language from definitive to tentative messaging, maintaining consistency with the English version change. The translation "Es posible que no obtengas progreso" correctly conveys the uncertainty aspect.

@jaypanchal-13 jaypanchal-13 changed the title Updated message and color of progress bar for user visit Updated warrning message and color of progress bar for user visit Jul 28, 2025
@jaypanchal-13 jaypanchal-13 changed the title Updated warrning message and color of progress bar for user visit Updated warning message and color of progress bar for user visit Jul 28, 2025
@jaypanchal-13 jaypanchal-13 merged commit 6a0c572 into feature/connect Jul 29, 2025
1 of 2 checks passed
@OrangeAndGreen OrangeAndGreen added this to the 2.59 milestone Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-integration-tests Skip android tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants