Skip to content

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Oct 2, 2025

Closes WOOMOB-1406

Description

As with #16195, this PR updates the PaymentMethodsView component from Order > Collect Payment to not use deprecated NavigationLink(isActive:) API for navigation. It also fixes the file previews, which seem to crash in Xcode due missing dependencies.

Changes

  • Updates NavigationLink(isActive: in favor of .navigationDestination(isPresented: view modifier

Testing information

  • In the app, create an order and attempt to collect payment
  • Select Cash as payment method
  • It should navigate to the cash tender normally

Screenshots

Simulator Screen Recording - iPhone 16 Plus - US store - 2025-10-02 at 13 03 22

Seems to crash the previews macro if we do not provide a rootViewController, despite being optional
@iamgabrielma iamgabrielma added type: task An internally driven task. type: technical debt Represents or solves tech debt of the project. labels Oct 2, 2025
@iamgabrielma iamgabrielma added this to the 23.5 milestone Oct 2, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review October 2, 2025 06:25
@iamgabrielma iamgabrielma requested a review from jaclync October 2, 2025 06:27
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 2, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16196-84d2e6a
Version23.3
Bundle IDcom.automattic.alpha.woocommerce
Commit84d2e6a
Installation URL4u3e1vh38avqo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from task/wcios17-payment-row to trunk October 2, 2025 09:54
Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

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

Works well, thanks for fixing these deprecated usage! 🚀

.previewDisplayName("Light")
#Preview("Light") {
@Previewable @State var rootViewController = UIViewController()
NavigationView {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: as NavigationView is deprecated, would be nice to replace it with NavigationStack. Simply replacing it with NavigationStack seems to work. Similarly for other previews in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's very true, updated: 84d2e6a

)
.navigationBarTitleDisplayMode(.inline)
}
.environment(\.colorScheme, .dark)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unrelated to this PR, I think we could just keep one preview here since the differences are just the color scheme and accessibility font size which can be configured in SwiftUI previews. It's more worth having multiple previews when the data/states are different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that sounds good to me. Updated: 84d2e6a

@iamgabrielma iamgabrielma modified the milestones: 23.5, 23.4 Oct 3, 2025
@iamgabrielma iamgabrielma enabled auto-merge October 3, 2025 03:50
@iamgabrielma iamgabrielma disabled auto-merge October 3, 2025 06:56
@iamgabrielma iamgabrielma modified the milestones: 23.4, 23.5 Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task. type: technical debt Represents or solves tech debt of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants