Skip to content

Conversation

@iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Jul 2, 2025

Closes WOOMOB-707 , only 1 review is needed!

Description

This PR adds the POS label to the order details view, for those orders which their created_via property is pos-rest-api. As with the badge, there are no final designs yet, so we just render the text as the kick-off proposal in pdfdoF-7rY-p2

Changes

  • Switched the feature flag from false to buildConfig == .localDeveloper || buildConfig == .alpha, since POS labels now show only when appropriate.
  • Moved SummaryTableViewCellViewModel to its own file
  • Added a new salesChannelLabel label property to the .xib file for the cell, and wrapped it into an horizontal stack along with the existing subtitleLabel

Testing information

  • On a store with POS orders (fresh orders, backfilling the created_via property is not supported), observe how the POS label appears in the top right corner of order details view, along the order date.
  • Switch pointOfSaleOrdersi1 flag to false, re-run the app, we should see no POS labels in order details, nor in order list.

Screenshots

Order List Order Details
Simulator Screenshot - iPhone 16 Plus - US store - 2025-07-02 at 15 54 36 Simulator Screenshot - iPhone 16 Plus - US store - 2025-07-02 at 15 54 42

Simulator Screenshot - iPad mini (A17 Pro) - US store - 2025-07-02 at 15 52 15


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jul 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 Number30951
VersionPR #15857
Bundle IDcom.automattic.alpha.woocommerce
Commit70df74e
Installation URL30mjalqpl90ko
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Comment on lines +54 to +64
var formattedSalesChannel: String? {
guard let salesChannel = salesChannel else {
return nil
}
switch salesChannel {
case "pos-rest-api":
return "POS"
default:
return nil
}
}
Copy link
Contributor Author

@iamgabrielma iamgabrielma Jul 2, 2025

Choose a reason for hiding this comment

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

This formattedSalesChannel is a code duplication with the order list badge that we can resolve moving the logic to Yosemite, I'll investigate this separately tomorrow as there's some build errors when trying to extend the Order, otherwise we can use some sort of simple object to share logic from Yosemite without needing to extend anything. Ref: p1751433227323889-slack-CGPNUU63E

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: order details Related to order details. feature: POS labels Jul 2, 2025
@iamgabrielma iamgabrielma added this to the 22.8 milestone Jul 2, 2025
@iamgabrielma iamgabrielma requested review from jaclync and staskus July 2, 2025 10:27
@iamgabrielma iamgabrielma marked this pull request as ready for review July 2, 2025 10:28
@jaclync jaclync self-assigned this Jul 2, 2025
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.

LGTM! 🚀 The label feels quite hidden, but I understand we'll update when the design is ready.

  • xib looks good without warnings
  • tested POS orders with largest font size in portrait where POS label is shown
  • tested non-POS orders
  • tested with feature flag disabled

Comment on lines -172 to -174

// MARK: - VoiceOver
///
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: any reasons for removing the comments here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, mostly cleaning up since I found them to be not very useful in this case (ie marking as voiceover the only voiceover function, or marking as private a private extension). Other places are way more blatant with this, for example in places like UIImage+Woo the file is double the size just because we do things like:

    /// Search Image
    ///
    static var searchImage: UIImage {
        UIImage(named: "search")!
    }

The variable or function name already tells us what we need to know. I'm fine with bringing them back if you'd prefer 👍

func configure(_ viewModel: SummaryTableViewCellViewModel) {
titleLabel.text = viewModel.billedPersonName
subtitleLabel.text = viewModel.subtitle
salesChannelLabel.text = viewModel.formattedSalesChannel
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might we want to hide the label if the text is nil? since this is in a stack view, if the stack view has a non-zero spacing (from the xib it looks like it has 4px spacing), the spacing still takes up space even if the label has zero width from nil text when it's not hidden.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
salesChannelLabel.text = viewModel.formattedSalesChannel
salesChannelLabel.text = viewModel.formattedSalesChannel
salesChannelLabel.isHidden = salesChannelLabel.text == nil

This fixes the order date not taking up the horizontal space when the sales channel label isn't shown, which is more obvious in large font sizes:

Simulator Screenshot - iPad (A16) - 2025-07-02 at 11 12 59

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if the stack view has a non-zero spacing (from the xib it looks like it has 4px spacing), the spacing still takes up space even if the label has zero width from nil text when it's not hidden.

TIL. Thanks for sharing the solution. Updated on 70df74e

@iamgabrielma
Copy link
Contributor Author

Thanks for the review @jaclync !

The label feels quite hidden, but I understand we'll update when the design is ready.

Yeah, designs might still change so I'm not optimizing much for it. For the moment I've logged WOOMOB-751 to be sure we tackle it and displays correctly in all sizes.

@iamgabrielma iamgabrielma enabled auto-merge July 3, 2025 04:56
@iamgabrielma iamgabrielma merged commit 780a18d into trunk Jul 3, 2025
13 checks passed
@iamgabrielma iamgabrielma deleted the task/WOOMOB-707-display-pos-badge-in-order-details branch July 3, 2025 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: order details Related to order details. feature: POS type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants