Repository navigation
feat(ui): redesign all merchant locations experience - #820
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughExplore 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. ChangesExplore Dash merchant locations
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
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]>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
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 valueConsider making
isRunningInPreviewa static property.Making this property
staticaligns with existing project patterns (e.g., inAboutDashViewModel) and prevents redundant evaluations of theProcessInfoenvironment 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 valueMinor 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 liftGift-card provider enrichment logic is now tripled across the file.
This block re-implements, near verbatim, the same provider-fetch/rebuild-
ExplorePointOfUselogic already present twice initems(...)(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 flagsallLocationsfor 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 valueOptional: 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
📒 Files selected for processing (27)
DashWallet.xcodeproj/project.pbxprojDashWallet/Sources/Models/Explore Dash/ExploreDash.swiftDashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swiftDashWallet/Sources/Models/Explore Dash/Infrastructure/Database Connection/ExploreDatabaseConnection.swiftDashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse+PreviewMock.swiftDashWallet/Sources/Models/Explore Dash/Model/Entites/ExplorePointOfUse.swiftDashWallet/Sources/UI/Explore Dash/ExploreViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/POIDetailsViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/POIDetailsView.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/POIDetailsViewModel.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsView.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/AllMerchantLocationsViewModel.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocations/Components/MerchantCellRow.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/AllMerchantLocationsViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Cells/MerchantItemCell.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Cells/PointOfUseItemCell.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/ExplorePointOfUseListViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/MerchantListViewController.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Model/AllMerchantLocationsDataProvider.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Model/PointOfUseListModel.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/ExploreMapView.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/ListHandlerView.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/PointOfUseListEmptyResultsView.swiftDashWallet/Sources/UI/Explore Dash/Merchants & ATMs/List/Views/PointOfUseLocationServicePopup.swiftDashWallet/Sources/UI/Home/HomeViewController+Shortcuts.swiftDashWallet/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]>
|
@coderabbitai review |
✅ Action performedReview finished.
|
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?
AllMerchantLocationsView,AllMerchantLocationsViewController, andAllMerchantLocationsViewModel, plus a newMerchantCellRow; the oldList/AllMerchantLocationsViewControlleris removed.POIDetailsViewController,POIDetailsView, andPOIDetailsViewModelreworked (significant simplification of the view controller).MerchantItemCell, updatedPointOfUseItemCell,MerchantListViewController,ExplorePointOfUseListViewController, and list model/data-provider changes.MerchantDAOimprovements (pagination behavior, coordinate validation),ExploreDatabaseConnectionandExploreDashupdates,ExplorePointOfUsepreview mocks.Approx. 1,842 insertions / 657 deletions across 32 files.
How Has This Been Tested?
Manual testing in the Explore Dash flow:
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit