Skip to content

CCCT-2535 Show Payment Unit Cards On The Delivery Visits Tab - #3883

Merged
Jignesh-dimagi merged 4 commits into
masterfrom
ccct-2535-delivery-visit-tab-redesign
Aug 31, 2026
Merged

CCCT-2535 Show Payment Unit Cards On The Delivery Visits Tab#3883
Jignesh-dimagi merged 4 commits into
masterfrom
ccct-2535-delivery-visit-tab-redesign

Conversation

@Jignesh-dimagi

@Jignesh-dimagi Jignesh-dimagi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

CCCT-2535

Screen_recording_20260826_112258.mp4
Screenshot_20260826_112428

Please ignore the bottom spacing for the CTA bar—it will be fixed in a follow-up task.

Product Description

The Visits tab of a delivery opportunity was empty. It now lists a card per payment
unit with that unit's approved visits, amount earned and visits remaining, and tapping
a card opens the visit list filtered to that unit.

Technical Summary

Restores the previous card layout design.

The identity handed to the detail screen is the payment unit's UUID rather than its
name — two payment units can carry the same name by mistake, a UUID cannot — so that
screen now filters deliveries on slugUUID, which is also what the dashboard's own
per-unit counts key on.

Safety Assurance

Safety story

What gives confidence:

  • I tested this by running it on a device.
  • I ran the new test class and the existing ConnectDeliveryHomeFragmentTest suite; both
    pass. I also confirmed the new tests fail when the unit filter and the approved-only
    filter are broken, so they are not vacuous.
  • Scope is one tab plus one filter predicate. No schema, migration or storage changes.

Automated test coverage

ConnectDeliveryVisitsFragmentTest adds nine Robolectric tests driving the tab end to
end — the job seeded through the real Connect database, deliveries arriving over the real
networking stack from a mock server. They lock down the per-unit figures, that only
approved visits count, each phrasing of the remaining-visits line, and the tap-through
that opens the detail screen listing that unit's visits and no others.

Jignesh-dimagi and others added 2 commits August 26, 2026 11:43
The Visits tab was empty. Restore the previous card layout, its adapter and
the view model behind it as Kotlin, and drive them from the worker's own
per-unit progress. Tapping a card opens that unit's visit list.

The detail screen identifies the unit by UUID rather than name, since two
payment units can carry the same name; it filters deliveries on slugUUID,
the key the dashboard's per-unit counts already use.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc2WGfedqbxgBasYvpUJy4
Drives the tab end to end against the real Connect database and a mock
server, through to the tap that opens a single unit's visit list.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc2WGfedqbxgBasYvpUJy4
@Jignesh-dimagi Jignesh-dimagi self-assigned this Aug 26, 2026
@Jignesh-dimagi

Copy link
Copy Markdown
Contributor Author

Suggested Review Order

  • app/src/org/commcare/models/connect/ConnectDeliveryDetails.kt — the model the cards read
  • app/res/layout/connect_delivery_progress_item.xml — the restored card design
  • app/src/org/commcare/adapters/ConnectDeliveryProgressReportAdapter.kt — binds the model to the card
  • app/src/org/commcare/fragments/connect/ConnectDeliveryVisitsFragment.kt — builds the per-unit figures and handles the tap
  • app/src/org/commcare/fragments/connect/ConnectDeliveryVisitsDetailFragment.java — filters by UUID instead of name
  • app/res/navigation/nav_graph_connect.xml — the action the tap navigates through
  • app/unit-tests/src/org/commcare/fragments/connect/ConnectDeliveryVisitsFragmentTest.kt — end-to-end coverage of the above

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8aa1c29-d333-4d74-8137-91365a70530b

📥 Commits

Reviewing files that changed from the base of the PR and between aef4da2 and 93d9a05.

📒 Files selected for processing (8)
  • app/res/layout/connect_delivery_progress_item.xml
  • app/res/layout/fragment_connect_delivery_visits.xml
  • app/res/navigation/nav_graph_connect.xml
  • app/src/org/commcare/adapters/ConnectDeliveryProgressReportAdapter.kt
  • app/src/org/commcare/fragments/connect/ConnectDeliveryVisitsDetailFragment.java
  • app/src/org/commcare/fragments/connect/ConnectDeliveryVisitsFragment.kt
  • app/src/org/commcare/models/connect/ConnectDeliveryDetails.kt
  • app/unit-tests/src/org/commcare/fragments/connect/ConnectDeliveryVisitsFragmentTest.kt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The delivery visits screen now displays payment-unit progress cards with approved counts, earnings, pending counts, percentages, and remaining-status text. Selecting a card opens unit-specific visit details. Detail filtering uses payment-unit UUIDs, while the action-bar title uses the matching unit name. Robolectric tests cover progress calculations, rendering, synchronization, navigation, and filtering.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 93d9a

This PR adds payment-unit cards to the Delivery Visits tab and filters the detail view by payment-unit UUID; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant ConnectDeliveryVisitsFragment
  participant ConnectDeliveryProgressReportAdapter
  participant RecyclerView
  participant ConnectDeliveryVisitsDetailFragment
  ConnectDeliveryVisitsFragment->>ConnectDeliveryVisitsFragment: calculate payment-unit progress
  ConnectDeliveryVisitsFragment->>ConnectDeliveryProgressReportAdapter: updateData(progress details)
  RecyclerView->>ConnectDeliveryProgressReportAdapter: bind delivery card
  ConnectDeliveryProgressReportAdapter-->>RecyclerView: render progress and status
  ConnectDeliveryProgressReportAdapter->>ConnectDeliveryVisitsFragment: report selected unit UUID
  ConnectDeliveryVisitsFragment->>ConnectDeliveryVisitsDetailFragment: navigate with unit UUID
  ConnectDeliveryVisitsDetailFragment-->>ConnectDeliveryVisitsFragment: display filtered unit visits
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 17.02% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 5 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding payment unit cards to the delivery Visits tab.
Description check ✅ Passed The description is complete and directly related to the change. It covers the product impact, technical design, safety considerations, testing, and ticket reference. The Labels and Review checklist is…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is complete and directly related to the change. It covers the product impact, technical design, safety considerations, testing, and ticket reference. The Labels and Review checklist is not included, but the required change rationale and validation details are present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 17.02% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 5 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ccct-2535-delivery-visit-tab-redesign

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.

@Jignesh-dimagi
Jignesh-dimagi marked this pull request as ready for review August 26, 2026 06:20
@Jignesh-dimagi
Jignesh-dimagi requested review from a team and conroy-ricketts and removed request for a team August 26, 2026 06:20
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 33.42%. Comparing base (bc5cd55) to head (1ffdaf5).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3883      +/-   ##
============================================
+ Coverage     33.04%   33.42%   +0.37%     
- Complexity     5864     5944      +80     
============================================
  Files           999     1002       +3     
  Lines         59398    59598     +200     
  Branches       7093     7121      +28     
============================================
+ Hits          19628    19918     +290     
+ Misses        37528    37404     -124     
- Partials       2242     2276      +34     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@conroy-ricketts conroy-ricketts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The UI looks fantastic! The Delivery page is really coming together

Comment thread app/res/layout/connect_delivery_progress_item.xml
Comment thread app/res/layout/connect_delivery_progress_item.xml
Comment thread app/src/org/commcare/adapters/ConnectDeliveryProgressReportAdapter.kt Outdated
Comment thread app/src/org/commcare/adapters/ConnectDeliveryProgressReportAdapter.kt Outdated
Comment thread app/src/org/commcare/adapters/ConnectDeliveryProgressReportAdapter.kt Outdated
Comment thread app/src/org/commcare/adapters/ConnectDeliveryPaymentUnitAdapter.kt

@conroy-ricketts conroy-ricketts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚀

@Jignesh-dimagi Jignesh-dimagi added the skip-integration-tests Skip android tests. label Aug 31, 2026
@Jignesh-dimagi
Jignesh-dimagi merged commit 0585bc3 into master Aug 31, 2026
41 of 42 checks passed
@Jignesh-dimagi
Jignesh-dimagi deleted the ccct-2535-delivery-visit-tab-redesign branch August 31, 2026 05:00
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.

2 participants