-
Notifications
You must be signed in to change notification settings - Fork 119
Custom Fields: Update navigation behavior for list and editor screens. #14175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Fields: Update navigation behavior for list and editor screens. #14175
Conversation
…ble UIHostingController
Generated by 🚫 Danger |
|
|
WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldsListView.swift
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the navigation! I tested on both iPhone and iPad and it works as expected for both order and product custom field list 👍
I left some suggestions for code improvements, please check them out.
WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift
Outdated
Show resolved
Hide resolved
WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldEditorView.swift
Outdated
Show resolved
Hide resolved
| Button { | ||
| presentationMode.wrappedValue.dismiss() | ||
| } label: { | ||
| Text("Cancel") // todo-13493: set String to be translatable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Any reason why we should not handle the localization right away?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 255d9ac
Just out of caution in case we want to update the text, which had happened several times in this project already.
WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldsListView.swift
Outdated
Show resolved
Hide resolved
WooCommerce/Classes/ViewRelated/Custom Fields/CustomFieldsListView.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates!
Part of #13493
Description
This PR updates the navigation behavior for Custom Fields List and Custom Field Editor screens, as follows:
With this PR, the List now has a hosting controller that also manages its toolbar. This way, the design and behavior consistency are preserved, and the hacks can be removed.
.sheet, to present it modally. This is consistent with an existing flow in Order Details > View Billing Information > Edit Billing Address., and with the suggestion proposed by @itsmeichigo here.Steps to reproduce
Testing information
I tested this PR using simulator both iPhone and iPad version, following all the steps above.
Video
Phone mode:
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-10-21.at.17.42.37.mp4
Tablet mode:
Simulator.Screen.Recording.-.iPad.Pro.13-inch.M4.-.2024-10-21.at.17.38.32.mp4
Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: