-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS] Modularization: fix most Periphery warnings #16185
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
Conversation
…ting - barcode scanning.
…private API `_body`.
Generated by 🚫 Danger |
|
|
staskus
left a comment
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 very much for this! I tested the described cases, it continues to work.
Respect for addressing all these past warnings. I remember I just rebuilt Periphery cache to avoid this but of course this is much better and beneficial when moving to POS module. We will be in much cleaner state.
| import enum Yosemite.PointOfSaleBarcodeScanError | ||
|
|
||
| protocol PointOfSaleAggregateModelProtocol { | ||
| var orderStage: PointOfSaleOrderStage { get } |
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.
Well, I guess it's a fair call from Periphery. We include many of these in the protocol, but never really use them when injecting aggregate modal as a protocol. We can always included when needed.
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.
Yea, I think it's good to only include what's used. It could also help break up the big protocol into smaller ones for different use cases from the aggregate model.
| /// Text field style for search fields that includes a magnifier icon and clear button | ||
| struct POSSearchTextFieldStyle: TextFieldStyle { | ||
| /// View modifier for search fields that includes a magnifier icon and clear button | ||
| struct POSSearchTextFieldModifier: ViewModifier { |
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.
I see the commit is:
Refactor POSSearchTextFieldStyle to a view modifier to avoid using private API _body
That's interesting! Did we use an disallowed way to create our own text field style? I looked up online, and this is how it's created in the examples. Should we just ignore this file or is this change safe? 🤔
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.
I saw the examples online too, but only in personal blog posts and not official Apple doc. It's already using a custom text field style WooRoundedBorderTextFieldStyle, which does use _body to customize the text field. The original POSSearchTextFieldStyle is more like a wrapper of the text field style to configure WooRoundedBorderTextFieldStyle and that's why I changed it to a view modifier. When it comes to WooRoundedBorderTextFieldStyle, I'd still keep the _body until there's a more official solution. Generally, I think APIs with _ prefix are not for official app usage and subject to change.
Hah it depends on the scale of the warnings, if there had been more than 100 I'd have done the same to reset the Periphery cache. |
|
@staskus Btw, if you tested barcode scanning on a physical iOS 26 tablet, did you notice that there was no way to recover the software keyboard unless the barcode scanner is disconnected? Similar to the previous Android issue pdfdoF-7J6-p2. Before iOS 26, I used to see a small software keyboard icon but in iOS 26 I didn't see any keyboard CTAs anymore. |
@jaclync, it can be recovered, but a bit harder. You need to do that through the system top bar menu. |

Part of WOOMOB-935
Just one review is required.
Description
This PR fixes most of Periphery warnings from POS modularization #16176 by removing unused code and refactoring code that was flagged but is actually in use (like from using a private API).
Key changes:
DynamicHStackandDynamicVStackcomponentsbackgroundColorparameter fromRasterizedShadowBackgroundPOSSearchTextFieldStylefrom using private API_bodyto a properViewModifierConnectivityObserverprotocol by removing unused functionsThese changes help improve code maintainability by removing dead code and ensuring we're not using private APIs.
Steps to reproduce
Regression testing:
Testing information
RELEASE-NOTES.txtif necessary.