-
Notifications
You must be signed in to change notification settings - Fork 121
[Woo POS][Barcodes] Show barcode scanning information from the menu #15750
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
[Woo POS][Barcodes] Show barcode scanning information from the menu #15750
Conversation
…exibility PointOfSaleBarcodeScannerInformationModal can use PointOfSaleInformationModal and built it more flexibly using PointOfSaleInformationParagraphView with its styles.
Generated by 🚫 Danger |
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.
Pull Request Overview
This PR introduces a reusable information modal component for POS, adds a dedicated barcode-scanning info modal, and updates the floating control menu to expose this new modal.
- Introduce
PointOfSaleInformationModalandPointOfSaleInformationModalParagraphViewfor consistent info‐modal styling. - Implement
PointOfSaleBarcodeScannerInformationModalwith localized messages and link support. - Refactor
SimpleProductsOnlyInformationto use the new modal and add a “Barcode scanning” button inPOSFloatingControlView.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WooCommerce/WooCommerce.xcodeproj/project.pbxproj | Added new modal source file references |
| WooCommerce/Classes/POS/Presentation/SimpleProductsOnlyInformation.swift | Refactored to use PointOfSaleInformationModal |
| WooCommerce/Classes/POS/Presentation/PointOfSaleInformationModal.swift | New reusable POS information modal and paragraph view |
| WooCommerce/Classes/POS/Presentation/PointOfSaleBarcodeScannerInformationModal.swift | New barcode scanning info modal |
| WooCommerce/Classes/POS/Presentation/POSFloatingControlView.swift | Added “Barcode scanning” button and modal integration |
Comments suppressed due to low confidence (4)
WooCommerce/Classes/POS/Presentation/PointOfSaleInformationModal.swift:48
- Using a fixed width of 896 points may cause overflow on smaller devices. Consider using
.frame(maxWidth: Constants.modalFrameWidth)or constraining to the screen width.
.frame(width: Constants.modalFrameWidth)
WooCommerce/Classes/POS/Presentation/PointOfSaleInformationModal.swift:1
- No UI or snapshot tests were added for this new reusable modal. Consider adding tests to verify layout, spacing, and behavior when
isPresentedtoggles.
import SwiftUI
WooCommerce/Classes/POS/Presentation/PointOfSaleBarcodeScannerInformationModal.swift:1
- The Foundation import isn’t used in this file. You can remove it to keep the imports minimal.
import Foundation
WooCommerce/Classes/POS/Presentation/PointOfSaleInformationModal.swift:70
- Ensure a custom
.ifview‐modifier extension is available in scope, or replace this with a standard conditional modifier pattern to avoid compile errors.
.if(style == .default, transform: { view in
|
|
joshheald
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.
Some suggestions inline, but generally looks good, thanks for doing this 👍
| @Binding private var showSupport: Bool | ||
| @Binding private var showDocumentation: Bool | ||
| @State private var showProductRestrictionsModal: Bool = false | ||
| @State private var showBarcodeScanning: Bool = false |
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.
| @State private var showBarcodeScanning: Bool = false | |
| @State private var showBarcodeScanningInformation: Bool = false |
Nit: with plans to add camera-based scanning, which will also have a view to show, this might be a bit clearer in the future.
|
|
||
| private var bulletPointWithLink: AttributedString { | ||
| var secondary = AttributedString(Localization.barcodeInfoSecondaryMessage + " ") | ||
| var moreDetails = AttributedString(Localization.barcodeInfoMoreDetailsLink) |
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.
This link relates primarily to setting up barcodes. I mentioned to Andrey that it should be on the first item in the list, not the second, and I believe he changed it there, the screenshot from Android is probably out of date.
Could you move this to the first bullet point please?
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.
Yes, moved.
| ) | ||
| static let barcodeInfoTertiaryMessage = NSLocalizedString( | ||
| "pos.barcodeInfoModal.tertiaryMessage", | ||
| value: "• Connect your barcode scanner in System Bluetooth settings.", |
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.
"System" here was to avoid it being platform specific in the wireframes. I think we should say "iOS Bluetooth settings" or just "Bluetooth settings". cc @kidinov
| static let barcodeInfoQuinaryMessage = NSLocalizedString( | ||
| "pos.barcodeInfoModal.quinaryMessage", | ||
| value: "The scanner emulates a keyboard, so sometimes it will prevent the software keyboard from showing, e.g. in search. " + | ||
| "Tap on the keyboard icon to show the software keyboard back.", |
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.
| "Tap on the keyboard icon to show the software keyboard back.", | |
| "Tap on the keyboard icon to show it again.", |
Just a slight tweak here to make it read a little better – cc @kidinov
| let content: Content | ||
|
|
||
| // Used to make ScrollView height increase together with the content height. | ||
| @State private var contentHeight: CGFloat = 0 |
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 think that this (or something else about this struct) makes the modals grow as they transition for presentation/dismissal as well. That didn't happen in the past, they just faded in. It would be good if they could already have the correct size when we try to present them...
I'm not sure the best way to do it though...
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.
It's only an iOS 17 animation issue, not for the first time.
Yes, it's likely related to contentHeight, I haven't found a quick way to properly size content within the ScrollView.
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 found a quick workaround, applying a 0-second ease-in animation to contentHeigh transition does the job:
Simulator.Screen.Recording.-.iPad.Air.11-inch.17.5.-.2025-06-18.at.17.45.30.mp4
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.
Nice one, and thanks for commenting about it too. I checked on device and it looks good.
| PointOfSaleInformationModal(isPresented: $isPresented, title: AttributedString(Localization.modalTitle)) { | ||
| PointOfSaleInformationModalParagraphView { | ||
| Text(issueMessage) |
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.
Nice one for sharing this code 👍 Looks better all round
…nning-information-from-the
…nning-information-from-the

WOOPRD-565
Description
Show barcode scanning information, used Android as an example for copy and structure:
Solution
Steps to reproduce
Testing information
Tested on iPad Air 13 Inch M3
Screenshots
Barcode
Product Limitations
Dynamic Type
dynamic.type.mp4
RELEASE-NOTES.txtif necessary.