Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
13cfee8
Update POSOrderListRow style according to designs
staskus Sep 29, 2025
2eb6e42
Update POSOrderBadgeView to reuse a coloring schema from the main app
staskus Sep 29, 2025
eed7e73
Merge branch 'trunk' into woomob-1142-woo-poshistorical-orders-order-…
staskus Sep 30, 2025
adacedf
Update POSOrderRowView sizing according to designs
staskus Sep 30, 2025
5ffe5a9
Add preview helper for order with refund scenario
staskus Sep 30, 2025
c80be38
Update header to use POSPageHeaderView with email receipt button
staskus Sep 30, 2025
f232038
Remove actions section and update layout padding
staskus Sep 30, 2025
e2799f9
Add order badge to header bottom content
staskus Sep 30, 2025
728b933
Add dividers between product items
staskus Sep 30, 2025
0693b0c
Update product row alignment and remove padding
staskus Sep 30, 2025
4d1b113
Update product details layout and fonts
staskus Sep 30, 2025
190b3fd
Update totals section with consistent dividers and spacing
staskus Sep 30, 2025
97805cf
Update totals row fonts, colors and spacing
staskus Sep 30, 2025
a6f98d5
Remove actions section and add divider helper
staskus Sep 30, 2025
3eee4ef
Add preview for order details with refund
staskus Sep 30, 2025
d005e6e
Configure spacing between product row title and details
staskus Sep 30, 2025
3d569f9
Move bottomContent under whole page header content to put it under th…
staskus Sep 30, 2025
2863b8a
Spacing and divider adjustments for POSOrderDetailsView
staskus Sep 30, 2025
c0316f6
Update POSOrderDetailsView background color
staskus Sep 30, 2025
2b0b0c7
Update POSOrderDetailsLoadingView
staskus Sep 30, 2025
ff2292d
Limit dynamicTypeSize growth for POSOrderDetailsView header
staskus Sep 30, 2025
8a90d0d
Use static height for POSOrderListView ghost row
staskus Sep 30, 2025
6c376f0
Merge branch 'trunk' into woomob-1142-woo-poshistorical-orders-order-…
staskus Oct 1, 2025
23d535a
Change selection stile to rounded stroke
staskus Oct 1, 2025
982b219
Add more previews for the order list and order details view
staskus Oct 1, 2025
cb21331
Set unfocusedBorderColor for POSOrderListView
staskus Oct 1, 2025
147be52
Improve POSPageHeaderView element alignment in order details
staskus Oct 1, 2025
8e2b547
Update POSOrderDetailsLoadingView to show shimmering instead of order…
staskus Oct 1, 2025
4db0e8b
Animate order details update
staskus Oct 1, 2025
217fc6f
Show product attributes view
staskus Oct 1, 2025
0e94d89
Localize orderTitle
staskus Oct 1, 2025
6d28c27
Address periphery warnings
staskus Oct 1, 2025
5bf18fd
Scroll to top when search term changes
staskus Oct 1, 2025
1718654
Merge branch 'trunk' into woomob-1142-woo-poshistorical-orders-order-…
staskus Oct 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ extension Yosemite.POSOrder {
formattedTotal: CopiableProp<String> = .copy,
formattedSubtotal: CopiableProp<String> = .copy,
customerEmail: NullableCopiableProp<String> = .copy,
paymentMethodID: CopiableProp<String> = .copy,
paymentMethodTitle: CopiableProp<String> = .copy,
lineItems: CopiableProp<[POSOrderItem]> = .copy,
refunds: CopiableProp<[POSOrderRefund]> = .copy,
Expand All @@ -82,7 +81,6 @@ extension Yosemite.POSOrder {
let formattedTotal = formattedTotal ?? self.formattedTotal
let formattedSubtotal = formattedSubtotal ?? self.formattedSubtotal
let customerEmail = customerEmail ?? self.customerEmail
let paymentMethodID = paymentMethodID ?? self.paymentMethodID
let paymentMethodTitle = paymentMethodTitle ?? self.paymentMethodTitle
let lineItems = lineItems ?? self.lineItems
let refunds = refunds ?? self.refunds
Expand All @@ -99,7 +97,6 @@ extension Yosemite.POSOrder {
formattedTotal: formattedTotal,
formattedSubtotal: formattedSubtotal,
customerEmail: customerEmail,
paymentMethodID: paymentMethodID,
paymentMethodTitle: paymentMethodTitle,
lineItems: lineItems,
refunds: refunds,
Expand Down
3 changes: 0 additions & 3 deletions Modules/Sources/Yosemite/PointOfSale/OrderList/POSOrder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public struct POSOrder: Equatable, Hashable, GeneratedCopiable {
public let formattedTotal: String
public let formattedSubtotal: String
public let customerEmail: String?
public let paymentMethodID: String
public let paymentMethodTitle: String
public let lineItems: [POSOrderItem]
public let refunds: [POSOrderRefund]
Expand All @@ -31,7 +30,6 @@ public struct POSOrder: Equatable, Hashable, GeneratedCopiable {
formattedTotal: String,
formattedSubtotal: String,
customerEmail: String? = nil,
paymentMethodID: String,
paymentMethodTitle: String,
lineItems: [POSOrderItem] = [],
refunds: [POSOrderRefund] = [],
Expand All @@ -46,7 +44,6 @@ public struct POSOrder: Equatable, Hashable, GeneratedCopiable {
self.formattedTotal = formattedTotal
self.formattedSubtotal = formattedSubtotal
self.customerEmail = customerEmail
self.paymentMethodID = paymentMethodID
self.paymentMethodTitle = paymentMethodTitle
self.lineItems = lineItems
self.refunds = refunds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct POSOrderMapper {
formattedTotal: currencyFormatter.formatAmount(order.total, with: order.currency) ?? "",
formattedSubtotal: order.subtotalValue(currencyFormatter: currencyFormatter),
customerEmail: customerEmail,
paymentMethodID: order.paymentMethodID,
paymentMethodTitle: order.paymentMethodTitle,
lineItems: posLineItems,
refunds: posRefunds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ struct POSSearchTextFieldModifier: ViewModifier {
private let focused: Bool
@Binding private var searchTerm: String
@ScaledMetric private var searchFieldHeight: CGFloat = 56.0
@Environment(\.posSearchTextFieldUnfocusedBorderColor) private var unfocusedBorderColor

init(focused: Bool, searchTerm: Binding<String>) {
self.focused = focused
Expand All @@ -17,7 +18,7 @@ struct POSSearchTextFieldModifier: ViewModifier {
.textFieldStyle(WooRoundedBorderTextFieldStyle(
focused: focused,
focusedBorderColor: .posPrimary,
unfocusedBorderColor: .posSurfaceBright,
unfocusedBorderColor: unfocusedBorderColor,
backgroundColor: .posSurfaceBright,
cornerRadius: POSCornerRadiusStyle.medium.value,
insets: EdgeInsets(top: POSPadding.small, leading: POSPadding.medium, bottom: POSPadding.small, trailing: POSPadding.medium),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import SwiftUI
import WooFoundation
import struct Yosemite.POSOrder

struct POSOrderBadgeView: View {
private let order: POSOrder

init(order: POSOrder) {
self.order = order
}

var body: some View {
Text(order.status.localizedName)
.font(.posCaptionRegular)
.foregroundStyle(.black)
.padding(.horizontal, POSPadding.small)
.padding(.vertical, POSPadding.xSmall)
.background(statusBackgroundColor)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
}

private var statusBackgroundColor: Color {
switch order.status {
case .completed:
return Color(uiColor: .withColorStudio(.blue, shade: .shade5))
case .failed:
return Color(uiColor: .withColorStudio(.red, shade: .shade5))
case .processing:
return Color(uiColor: .withColorStudio(.green, shade: .shade5))
case .onHold:
return Color(uiColor: .withColorStudio(.orange, shade: .shade5))
default:
return Color(uiColor: .gray(.shade5))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ import SwiftUI

struct POSOrderDetailsLoadingView: View {
var body: some View {
VStack(spacing: 0) {
VStack(spacing: POSSpacing.none) {
POSPageHeaderView(
title: Localization.orderDetailsTitle,
title: "",
backButtonConfiguration: nil,
leadingContent: { shimmeringHeaderLeadingContent },
trailingContent: { shimmeringHeaderTrailingContent },
bottomContent: { shimmeringHeaderBottomContent }
)
.dynamicTypeSize(...DynamicTypeSize.xxxLarge)

ScrollView {
VStack(alignment: .leading, spacing: POSSpacing.medium) {
shimmeringProductsSection
shimmeringTotalsSection
}
.padding(.top, POSPadding.xSmall)
.padding(.horizontal, POSPadding.medium)
.padding(.bottom, POSPadding.medium)
}
}
.background(Color.posSurface)
Expand All @@ -24,33 +28,49 @@ struct POSOrderDetailsLoadingView: View {

// MARK: - Shimmer Components

@ViewBuilder
private var shimmeringHeaderLeadingContent: some View {
HStack {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.longRowWidth, height: POSPadding.xxLarge)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
Spacer()
}
}

@ViewBuilder
private var shimmeringHeaderTrailingContent: some View {
GeometryReader { geometry in
HStack {
Spacer()
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.3, height: 16)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()
}
HStack {
Spacer()
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.shortRowWidth, height: POSPadding.large)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
}
.frame(height: 16)
}

@ViewBuilder
private var shimmeringHeaderBottomContent: some View {
GeometryReader { geometry in
VStack(alignment: .leading, spacing: POSSpacing.xSmall) {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.5, height: 16)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()
}
VStack(alignment: .leading, spacing: POSSpacing.xSmall) {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.longRowWidth, height: POSPadding.medium)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()

Spacer().frame(height: POSSpacing.xSmall)

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.shortRowWidth, height: POSPadding.medium)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
}
.frame(height: 16)
.padding(.top, POSPadding.medium)
.multilineTextAlignment(.leading)
}

@ViewBuilder
Expand All @@ -61,8 +81,12 @@ struct POSOrderDetailsLoadingView: View {
.foregroundStyle(Color.posOnSurface)

VStack(spacing: POSSpacing.small) {
ForEach(0..<2, id: \.self) { _ in
ForEach(0..<2, id: \.self) { index in
shimmeringProductRow

if index < 1 {
divider
}
}
}
}
Expand All @@ -73,39 +97,35 @@ struct POSOrderDetailsLoadingView: View {

@ViewBuilder
private var shimmeringProductRow: some View {
GeometryReader { geometry in
HStack(alignment: .top, spacing: POSSpacing.medium) {
HStack(alignment: .center, spacing: POSSpacing.medium) {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: POSPadding.xxLarge, height: POSPadding.xxLarge)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()

VStack(alignment: .leading, spacing: POSSpacing.xSmall) {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: 40, height: 40)
.frame(width: Constants.longRowWidth, height: POSPadding.medium)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()

VStack(alignment: .leading, spacing: POSSpacing.xSmall) {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.45, height: 20)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.35, height: 16)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()
}

Spacer()

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.2, height: 20)
.clipShape(RoundedRectangle(cornerRadius: 4))
.frame(width: Constants.shortRowWidth, height: POSPadding.medium)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
}
.padding(.vertical, POSPadding.small)

Spacer()

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.shortRowWidth, height: POSPadding.medium)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
}
.frame(height: 60)
}

@ViewBuilder
Expand All @@ -120,10 +140,10 @@ struct POSOrderDetailsLoadingView: View {
shimmeringTotalsRow
shimmeringTotalsRow

Divider()
.background(Color.posSurfaceDim)

divider
shimmeringTotalsRow

divider
shimmeringTotalsRow
}
}
Expand All @@ -134,34 +154,38 @@ struct POSOrderDetailsLoadingView: View {

@ViewBuilder
private var shimmeringTotalsRow: some View {
GeometryReader { geometry in
HStack {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.3, height: 20)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()

Spacer()

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: geometry.size.width * 0.25, height: 20)
.clipShape(RoundedRectangle(cornerRadius: 4))
.shimmering()
}
HStack {
Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.mediumRowWidth, height: POSPadding.large)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()

Spacer()

Rectangle()
.fill(Color.posOnSurfaceVariantLowest)
.frame(width: Constants.shortRowWidth, height: POSPadding.large)
.clipShape(RoundedRectangle(cornerRadius: POSCornerRadiusStyle.small.value))
.shimmering()
}
.frame(height: 20)
}

@ViewBuilder
private var divider: some View {
Divider()
.overlay(Color.posOutlineVariant.opacity(0.5))
.padding(.vertical, POSSpacing.small)
}
}

private enum Localization {
static let orderDetailsTitle = NSLocalizedString(
"pos.orderDetailsLoadingView.title",
value: "Order",
comment: "Title for the order details screen when no specific order is selected"
)
private enum Constants {
static let longRowWidth: CGFloat = 120
static let mediumRowWidth: CGFloat = 100
static let shortRowWidth: CGFloat = 80
}

private enum Localization {
static let productsTitle = NSLocalizedString(
"pos.orderDetailsLoadingView.productsTitle",
value: "Products",
Expand Down
Loading