Skip to content

feat(ui): redesign all merchant locations experience - #820

Merged
romchornyi merged 11 commits into
masterfrom
feat/all-locations-redesign
Jul 21, 2026
Merged

romchornyi merged 11 commits into
masterfrom
feat/all-locations-redesign

Conversation

@romchornyi

@romchornyi romchornyi commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

Redesigns the all merchant locations experience in Explore Dash. The previous list-only "all locations" screen is replaced with a redesigned, map-and-list experience and a dedicated "where to spend" navigation flow, along with supporting data-layer and merchant-details improvements.

What was done?

  • Redesigned all-merchant-locations screen — new SwiftUI-based AllMerchantLocationsView, AllMerchantLocationsViewController, and AllMerchantLocationsViewModel, plus a new MerchantCellRow; the old List/AllMerchantLocationsViewController is removed.
  • Custom "where to spend" navigation bar flow for the redesigned experience.
  • Point-of-use details refactor — POIDetailsViewController, POIDetailsView, and POIDetailsViewModel reworked (significant simplification of the view controller).
  • Merchant list / cells — added MerchantItemCell, updated PointOfUseItemCell, MerchantListViewController, ExplorePointOfUseListViewController, and list model/data-provider changes.
  • Data layer — MerchantDAO improvements (pagination behavior, coordinate validation), ExploreDatabaseConnection and ExploreDash updates, ExplorePointOfUse preview mocks.
  • Misc — map view / list handler / empty-results / location-service popup updates, navigation bar icon assets, Home shortcut and bridging-header adjustments.

Approx. 1,842 insertions / 657 deletions across 32 files.

How Has This Been Tested?

Manual testing in the Explore Dash flow:

  • Where to Spend → merchant list, Nearby tab, and Show all locations (map + list).
  • Merchant details screen (POI details) for online and physical merchants.
  • Pagination and coordinate/tap validation on the all-locations list.

Reviewers: please confirm coverage on your device/simulator matrix and network (mainnet/testnet); automated test coverage for the new screens is not yet added.

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • New Features
    • Added an “All Merchant Locations” screen with map integration, merchant details, filtering, and infinite scrolling.
    • Improved “Where to Spend” navigation with a custom title and back control.
  • Bug Fixes
    • Improved location counting and pagination, including more consistent ordering and refined radius filtering.
    • Fixed merchant-details and payment/gift-card modal/dismissal flow so navigation occurs reliably after sheets close.
    • Prevented duplicate development/test merchant seeding and reduced setup errors when triggers already exist.
  • Improvements
    • Merchant addresses are now displayed in a consistent, formatted style.

jeanpierreroma and others added 8 commits June 1, 2026 23:05
Why:
- consolidate the local explore redesign work into a single reviewable changeset
- keep the where-to-spend and all-locations flows aligned after the sheet, navigation, and pagination updates
- bump the build number to 14 for the next app build

What:
- add custom where-to-spend navigation bar assets and related SwiftUI navigation updates
- finalize merchant details and all-locations redesign flows, including native sheet behavior and map integration
- add paginated all-locations loading, real total counts, infinite scroll, and segmented-bar visibility fixes
- update project build settings to 8.6.0 (14)

Validation:
- build was not reliably runnable in this environment because xcodebuild was blocked by CoreSimulatorService issues
Why:
- keep paginated all-locations results deterministic across pages
- preserve the current radius when navigating between all-locations and details

What:
- add a stable secondary sort for all-locations pagination
- validate coordinates in the all-locations count path
- pass the current search radius back into merchant details
- narrow POIDetailsViewController initializer visibility to internal

Validation:
- no reliable xcodebuild validation was available in this environment because CoreSimulatorService remained unavailable
…difier

Update Explore Dash database layer and clean up unused UI components:
- Optimize ExploreDatabaseConnection query performance
- Remove SelfSizingSheetModifier (consolidated into unified sheet infrastructure)
- Update bridging header configuration
- Update project configuration

This improves database efficiency in the all-locations redesign.
@romchornyi romchornyi changed the title feat(explore): redesign all merchant locations experience feat(ui): redesign all merchant locations experience Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea93e20d-4139-44d7-af87-845f09287723

📥 Commits

Reviewing files that changed from the base of the PR and between 814bc8e and 613513f.

📒 Files selected for processing (4)
  • DashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewModel.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/Components/MerchantCellRow.swift
🚧 Files skipped from review as they are similar to previous changes (4)
  • DashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/Components/MerchantCellRow.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewModel.swift

📝 Walkthrough

Walkthrough

Explore Dash now supports paginated merchant-location lists with count-based loading, new SwiftUI/UIKit location screens, system detail sheets, custom navigation bars, improved map/list coordination, merchant address formatting, debug previews, and updated Xcode project wiring.

Changes

Explore Dash merchant locations

Layer / File(s) Summary
Location data and pagination
DashWallet/Sources/Models/Explore Dash/...
Merchant queries now support deterministic offset pagination, geometry-based filtering, count queries, improved PiggyCards handling, synchronized fetching state, and guarded test-merchant seeding.
All merchant locations UI
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/...
New SwiftUI list, view model, UIKit host, merchant rows, map synchronization, distance formatting, loading states, and infinite pagination were added.
Details sheets and navigation
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/..., DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/..., DashWallet/Sources/UI/Home/HomeViewController+Shortcuts.swift
Details use page sheets and dismiss them before navigation; Where to Spend screens support custom navigation bars and sheet-aware table insets.
Preview support and project wiring
DashWallet.xcodeproj/project.pbxproj, DashWallet/Sources/..., DashWallet/dashwallet-Bridging-Header.h
Debug preview factories and previews were added, model address composition was introduced, and source, package, group, target, and bridging-header references were updated.

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

Possibly related PRs

Suggested reviewers: hashengineering

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main UI change: a redesign of the all merchant locations experience.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/all-locations-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.

Resolve project.pbxproj conflicts by keeping both sides (branch's
AllMerchantLocations* / ExplorePointOfUse+PreviewMock entries and master's
Uphold-Info.plist entries), matching the resolution already made on
feat/release-8.7.0.

Also repair the DashUIKit SwiftPM wiring inherited from master, again
following feat/release-8.7.0: point the project's packageReferences at the
package object that actually exists, declare packageProductDependencies on
both the dashwallet and dashpay targets, and define the PBXBuildFile backing
dashpay's "DashUIKit in Frameworks" entry. Before this, xcodebuild did not
resolve the package graph at all.

Drop pbxproj cruft carried over from master: 14 orphan PBXBuildFile entries,
an empty "Recovered References" group, and a duplicated definition of the
AddRedeemUrlChallengeToGiftCardsTable build files.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@romchornyi

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (4)
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/POIDetailsViewModel.swift (1)

23-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider making isRunningInPreview a static property.

Making this property static aligns with existing project patterns (e.g., in AboutDashViewModel) and prevents redundant evaluations of the ProcessInfo environment dictionary for every instance initialization.

♻️ Proposed refactor
-private var isRunningInPreview: Bool {
+private static var isRunningInPreview: Bool {
    ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"
}

Note: If you apply this change, you will also need to update the calls in the initializer (lines 75 & 77) to use Self.isRunningInPreview.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/Details/Views/POIDetailsViewModel.swift around lines 23 - 26, Convert the
isRunningInPreview property to a static property, matching the existing project
pattern, and update both initializer references to access it through
Self.isRunningInPreview.
DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewController.swift (1)

29-49: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor SwiftLint cleanups: avoid IUO, mark unimplemented init unavailable.

🧹 Proposed cleanup
-    private var mapView: ExploreMapView!
+    private var mapView: ExploreMapView?
+    `@available`(*, unavailable)
     required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/AllMerchantLocations/AllMerchantLocationsViewController.swift around
lines 29 - 49, Update AllMerchantLocationsViewController to avoid the implicitly
unwrapped mapView property by using an appropriate non-IUO declaration and
initialization pattern. Mark required init?(coder:) as unavailable while
preserving its existing fatal-error behavior.

Source: Linters/SAST tools

DashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swift (1)

676-777: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Gift-card provider enrichment logic is now tripled across the file.

This block re-implements, near verbatim, the same provider-fetch/rebuild-ExplorePointOfUse logic already present twice in items(...) (Lines ~208-299 and ~452-544). Any future fix to provider filtering (e.g., PiggyCards restrictions) now needs to be applied in three places consistently. SwiftLint also flags allLocations for cyclomatic complexity 14 (Line 618), which extracting this block into a shared private helper (e.g. fetchGiftCardProviders(for: merchant:) -> ExplorePointOfUse.Merchant.GiftCardProviderInfo]) would help reduce.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/Models/Explore` Dash/Infrastructure/DAO
Impl/MerchantDAO.swift around lines 676 - 777, Extract the duplicated gift-card
provider query and enrichment logic from all three locations in items(...) into
one shared private helper, such as fetchGiftCardProviders(for:merchant:), and
replace each inline block with that helper while preserving PiggyCards
filtering, provider mapping, and merchant/item reconstruction behavior. Ensure
allLocations uses the shared path so its cyclomatic complexity is reduced.

Source: Linters/SAST tools

DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/MerchantListViewController.swift (1)

117-118: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional: avoid implicitly-unwrapped optional for infoButton.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/MerchantListViewController.swift around lines 117 - 118, Update the
infoButton property in MerchantListViewController to use a safely initialized
optional or non-optional UIBarButtonItem instead of an implicitly unwrapped
optional, and adjust its initialization and usages as needed while preserving
the existing behavior.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@DashWallet/Sources/Models/Explore`
Dash/Model/Entites/ExplorePointOfUse.swift:
- Around line 209-219: Update the computed property ExplorePointOfUse.address to
remove name from the joined address components, while preserving the existing
trimming, empty-value filtering, and separator behavior for address1 through
territory.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/Details/Views/POIDetailsView.swift:
- Line 274: Update the contentShape modifier in POIDetailsView to use the iOS
15-compatible Rectangle() shape instead of the iOS 17-only .rect shorthand,
preserving the existing interaction area.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/AllMerchantLocations/AllMerchantLocationsView.swift:
- Around line 104-118: Update the merchant logo rendering in the body of
AllMerchantLocationsView to provide an error fallback for WebImage failures.
When loading the valid pointOfUse.logoLocation URL fails, display
pointOfUse.emptyLogoImageName instead of leaving the image slot blank, while
preserving the existing URL and non-URL paths.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/AllMerchantLocations/AllMerchantLocationsViewModel.swift:
- Around line 109-115: Update AllMerchantLocationsViewModel.onAppear() to avoid
clearing the cache and calling model.refreshItems() on every view appearance.
Track whether locations have already loaded, or reuse the existing refresh
state, so the initial appearance performs the load while subsequent appearances
retain and display cached items; keep explicit refresh() behavior unchanged.
- Line 33: Remove the explicit “= nil” initializer from the `@Published`
selectedItem property in AllMerchantLocationsViewModel, allowing its optional
type to provide the default nil initialization.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/AllMerchantLocations/Components/MerchantCellRow.swift:
- Around line 60-61: Move the `@ViewBuilder` attribute onto the same line as the
distanceLabel property declaration, preserving the existing private some View
property and its behavior.

---

Nitpick comments:
In `@DashWallet/Sources/Models/Explore` Dash/Infrastructure/DAO
Impl/MerchantDAO.swift:
- Around line 676-777: Extract the duplicated gift-card provider query and
enrichment logic from all three locations in items(...) into one shared private
helper, such as fetchGiftCardProviders(for:merchant:), and replace each inline
block with that helper while preserving PiggyCards filtering, provider mapping,
and merchant/item reconstruction behavior. Ensure allLocations uses the shared
path so its cyclomatic complexity is reduced.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/Details/Views/POIDetailsViewModel.swift:
- Around line 23-26: Convert the isRunningInPreview property to a static
property, matching the existing project pattern, and update both initializer
references to access it through Self.isRunningInPreview.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/AllMerchantLocations/AllMerchantLocationsViewController.swift:
- Around line 29-49: Update AllMerchantLocationsViewController to avoid the
implicitly unwrapped mapView property by using an appropriate non-IUO
declaration and initialization pattern. Mark required init?(coder:) as
unavailable while preserving its existing fatal-error behavior.

In `@DashWallet/Sources/UI/Explore` Dash/Merchants &
ATMs/List/MerchantListViewController.swift:
- Around line 117-118: Update the infoButton property in
MerchantListViewController to use a safely initialized optional or non-optional
UIBarButtonItem instead of an implicitly unwrapped optional, and adjust its
initialization and usages as needed while preserving the existing behavior.
🪄 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: b0269ca8-78d1-4dcd-8423-378bb1760923

📥 Commits

Reviewing files that changed from the base of the PR and between 9c26231 and 814bc8e.

📒 Files selected for processing (27)
  • DashWallet.xcodeproj/project.pbxproj
  • DashWallet/Sources/Models/Explore Dash/ExploreDash.swift
  • DashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swift
  • DashWallet/Sources/Models/Explore Dash/Infrastructure/Database Connection/ExploreDatabaseConnection.swift
  • DashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse+PreviewMock.swift
  • DashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse.swift
  • DashWallet/Sources/UI/Explore Dash/ExploreViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/POIDetailsView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/POIDetailsViewModel.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewModel.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/Components/MerchantCellRow.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocationsViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Cells/MerchantItemCell.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Cells/PointOfUseItemCell.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/ExplorePointOfUseListViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/MerchantListViewController.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Model/AllMerchantLocationsDataProvider.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Model/PointOfUseListModel.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/ExploreMapView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/ListHandlerView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/PointOfUseListEmptyResultsView.swift
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/PointOfUseLocationServicePopup.swift
  • DashWallet/Sources/UI/Home/HomeViewController+Shortcuts.swift
  • DashWallet/dashwallet-Bridging-Header.h
💤 Files with no reviewable changes (1)
  • DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocationsViewController.swift

Drop the merchant name from ExplorePointOfUse.address: the name is already
shown once by MerchantHeaderView, so every location row repeated it. The
property is new in this branch and MerchantCellRow is its only consumer, so
no other screen changes. MerchantCellRow falls back to the name when a record
carries no address parts at all, to avoid rendering an empty row.

Show the empty-logo asset when a merchant logo fails to load. WebImage without
a placeholder left the slot blank on a 404 or timeout; the content/placeholder
initializer covers the failure state as well as loading.

Skip the reload in AllMerchantLocationsViewModel.onAppear after the first one,
so a re-appearance does not drop the cache and show the empty-state spinner
again. Note this is latent today: the view controller dismisses and rebuilds
the sheet (and with it the view model) when returning from location details.

Two SwiftLint fixes: @ViewBuilder moved onto the property's line (attributes),
and the redundant "= nil" removed (implicit_optional_initialization).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@romchornyi

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

LGTM

@romchornyi
romchornyi merged commit 07a5514 into master Jul 21, 2026
2 checks passed
@romchornyi
romchornyi deleted the feat/all-locations-redesign branch July 21, 2026 16:53
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