Skip to content

fix(explore-dash): open a gift card bought via Show all locations - #1437

Merged
ross-dash merged 1 commit into
developfrom
fix/show-all-locations-gift-card
Nov 17, 2026
Merged

ross-dash merged 1 commit into
developfrom
fix/show-all-locations-gift-card

Conversation

@ross-dash

@ross-dash ross-dash commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #1396: a gift card bought from a location reached through Show all locations now completes like one bought from the merchant's details: the app returns to Explore and opens the card.

POIDetailsViewController handed "Show all locations" the pay and sell handlers but not onGiftCardPurchased, so the details screen opened from there had no completion for a purchase. The push now goes through makeAllLocationsController(searchRadius:), which passes all three handlers; AllMerchantLocationsViewController already forwards them to the details it opens.

No visual change.

Test plan

  • ExploreListNavigationTests.testShowAllLocationsCarriesTheDetailsHandlers (new): the all-locations screen calls the details screen's pay, sell and gift-card handlers
  • ExploreListNavigationTests pass
  • Simulator: Where to Spend → Starbucks → Show all locations → a location opens its details with "Buy a Gift Card"
  • Not done: completing a gift card purchase (needs a real payment)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • “Show all locations” now preserves gift-card purchase actions alongside payment and Dash-selling actions when opening the locations list.

The details screen handed Show all locations the pay and sell handlers
but not onGiftCardPurchased, so a purchase from a location opened there
never returned to Explore or showed the card. A factory now passes all
three handlers.

Fixes #1396

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The “Show all locations” flow now forwards the payment, Dash-selling, and gift-card-purchase handlers to the all-locations controller. A test verifies that each handler receives its callback.

Changes: All-locations handler forwarding

Layer / File(s) Summary
Forward handlers and verify callbacks
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift, DashWalletTests/ExploreListNavigationTests.swift
A helper creates the all-locations controller with the current search parameters and all three handlers. The “Show all locations” action uses the helper. A test verifies that the payment, sale, and gift-card-purchase callbacks reach their original handlers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Suggested reviewers: jeanpierreroma, tikhop, thepastaclaw

Merge Risk: Minimal · up to cb5e1

Gift cards bought from a location opened through "Show all locations" should now return to Explore and open the purchased card, as they do from merchant details. The change is small and covered by a handler-forwarding test. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the fixed behavior: a gift card bought through Show all locations now opens after purchase. The changeset matches it. POIDetailsViewController routes Show all locations through makeAll…
Linked Issues check Passed Issue #1396 requires that the "Show all locations" push pass onGiftCardPurchased with the pay and sell handlers. The diff at the reviewed head adds POIDetailsViewController.makeAllLocationsController(…
Out of Scope Changes check Passed All changed code serves #1396. The POIDetailsViewController change extracts the all-locations construction into a helper and adds onGiftCardPurchased forwarding. The test file adds a test for that for…
Full details: Title check

Explanation

The title names the fixed behavior: a gift card bought through Show all locations now opens after purchase. The changeset matches it. POIDetailsViewController routes Show all locations through makeAllLocationsController(searchRadius:), which now forwards the gift-card-purchase handler with the pay and sell handlers. A new test in ExploreListNavigationTests checks that all three handlers reach the original callers. The title is specific and uses the conventional fix(scope) prefix, so it is a clear match for the main change.

Full details: Linked Issues check

Explanation

Issue #1396 requires that the "Show all locations" push pass onGiftCardPurchased with the pay and sell handlers. The diff at the reviewed head adds POIDetailsViewController.makeAllLocationsController(searchRadius:), which sets payWithDashHandler, sellDashHandler, and onGiftCardPurchased on the AllMerchantLocationsViewController it creates. The former inline push in the Show all locations action (line ~188) now calls this helper, so the gift-card handler is passed. The new unit test testShowAllLocationsCarriesTheDetailsHandlers in ExploreListNavigationTests.swift checks that all three handlers reach the returned controller. The forwarding from AllMerchantLocationsViewController to its opened details is not shown in the diff. This relies on the issue text and the PR description, which both state that it already exists. The gift-card completion behavior itself was not exercised, and the PR states that a real payment was not tested.

Full details: Out of Scope Changes check

Explanation

All changed code serves #1396. The POIDetailsViewController change extracts the all-locations construction into a helper and adds onGiftCardPurchased forwarding. The test file adds a test for that forwarding and a comment line describing the behavior. The diff contains no visual or unrelated changes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f0730e8-15ee-4488-8e14-d9d33e93d67f
Commits

Reviewing files that changed from the base of the PR and between 9ef62d8 and cb5e112.

Files selected for processing: 2

  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift
  • DashWalletTests/ExploreListNavigationTests.swift

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

@thepastaclaw

thepastaclaw commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit cb5e112) · triage: low

@thepastaclaw thepastaclaw 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.

Final validation — Phase 1 + Phase 2

The PR correctly preserves all three completion handlers when constructing the all-locations screen, allowing gift-card purchases from a location reached through “Show all locations” to use the existing completion flow. The regression test directly verifies handler forwarding without loading views, and the target-membership, title, workflow, accessibility, and CodeRabbit checks pass; the simulator test remains in progress. No in-scope defects were found.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — This is a small, well-contained navigation-handler propagation fix with a focused regression test and no changes to funds movement or other critical surfaces.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 97% left, weekly 99% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer

@romchornyi romchornyi 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.

✅ No blockers · no majors · 2 non-blocking recommendations — reviewed at cb5e112c8d

Level Verdict
1 · Idea ✅ valid The cause in #1396 holds: the "Show all locations" push carried two of the three handlers, so onGiftCardPurchased was dropped; the fix addresses that directly
2 · Architecture ✅ right layer Handlers travel down the navigation chain; the hand-off now lives in one factory, makeAllLocationsController(searchRadius:)
3 · Completeness ✅ complete Every place that builds POIDetailsViewController or AllMerchantLocationsViewController (merchant list, POI list, all-locations pushDetails, the new factory) now passes onGiftCardPurchased; both openers (Explore pops to root, the Home shortcut dismisses its modal) complete correctly at any stack depth
4 · Code ✅ clean The factory reproduces the old construction plus the missing handler; [weak self] is unchanged; the new test checks all three handlers pass through
2 non-blocking recommendations
  1. The test covers the factory, not the tap — POIDetailsViewController.swift#L191 — if the closure ever builds the controller inline again, the test still passes. Acceptable for a one-line call.
  2. No end-to-end purchase — as the test plan says, completing a real gift card purchase through this path was not exercised; it needs a real payment.
Review details Layered review (idea → architecture → completeness → code). Level 3 traced every construction site of the details and all-locations controllers and both `onGiftCardPurchased` openers (`ExploreMenuScreen.showMerchants`, `HomeViewController.showGiftCardDetails`) at the reviewed head.

🤖 Reviewed with Claude Code

@ross-dash
ross-dash merged commit b2f0069 into develop Nov 17, 2026
8 checks passed
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.

Gift card bought via "Show all locations" does not open the gift card

3 participants