Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Sep 15, 2025

WOOMOB-1248

Description

Make Totals (Checkout) view more adaptable for smaller window heights to support iPadOS 26 window resizing, and smaller iPads like iPad Mini.

I explored a few solutions and settled on this one:

  • Make card present payment state view image self-sizing between max and min height, to the image size would shrink before any other content
  • Add .scrollVerticallyIfNeeded() for TotalsView content so the scrolling would kick in when the content doesn't fit.

In most cases, it results in this behavior:

  1. If the content fits fully, all the elements appear in the expected size
  2. If the content doesn't fit, the image starts shrinking
  3. If the content doesn't fit, the text starts shrinking (based on minimumScaleFactor)
  4. If the content still doesn't fit, scrollVerticallyIfNeeded kicks-in

The visual drawback may be that when scrolling kicks in, the elements return to their full size. However, I found the only way to control this behavior was to inject some sort of environment variable so elements could stay in their most compact size once the content no longer fits. However, it introduced too many changes without a clear benefit.

Steps to reproduce

  1. Open POS on iPadOS 26 device or simulator
  2. Add items to cart and check out
  3. Resize the window in various card present payment states
  4. Confirm that images and text shrink and eventually scrolling kicks-in

Testing information

  • Tested on iPad Mini, iPad Air simulator, and iPad Air device
  • Extensive testing on Previews

Screenshots

iPad Air Simulator - resizing windows

resizing.windows.mov

iPhone - Previews (to show small window height behavior)

iphone.mov

iPad Mini - Previews (to show small image behavior)

iPad.Mini.mov

iPad Air - Previews (to show full size behavior)

ipad.air.mov

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

@staskus staskus added this to the 23.3 milestone Sep 15, 2025
@staskus staskus added type: task An internally driven task. iOS 26 Specific to iOS 26 labels Sep 15, 2025
@staskus staskus force-pushed the woomob-1248-ipados-26woo-pos-adjust-layout-for-smaller-window-heights branch from 1a5dea0 to 7280dc6 Compare September 15, 2025 08:58
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 15, 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 Numberpr16129-e7f9351
Version23.3
Bundle IDcom.automattic.alpha.woocommerce
Commite7f9351
Installation URL5v1h9d9bl2evg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@iamgabrielma iamgabrielma self-assigned this Sep 18, 2025
@iamgabrielma
Copy link
Contributor

I've assigned myself to this one, but most likely I'll handle it after HACK week. Let me know if you would prefer to have it prioritized this week though 🙇

@staskus
Copy link
Contributor Author

staskus commented Sep 18, 2025

@iamgabrielma all good. Whenever you have time to test it out and review it 👍

@iangmaia iangmaia modified the milestones: 23.3, 23.4 Sep 19, 2025
@iangmaia
Copy link
Contributor

Version 23.3 has now entered code-freeze, so the milestone of this PR has been updated to 23.4.

Copy link
Contributor

@iamgabrielma iamgabrielma left a comment

Choose a reason for hiding this comment

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

Works well! Tested on iPad Pro 12.9 inch running iOS 26.0

The card reader connection button overlaps most screens and some flows, do you know if this is logged already as part of iOS16 work? Happy to open it otherwise.

IMG_0653

Thoughts if we still need the min width view with iOS26? If we do, we should also change the text to not mention only split views. I can log that one as well 👍

IMG_0651

.resizable()
.aspectRatio(contentMode: .fit)
.frame(
minWidth: PointOfSaleCardPresentPaymentLayout.headerSize.width * 0.3,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move/declare this 0.3 somewhere else? Just to avoid magic numbers

@staskus
Copy link
Contributor Author

staskus commented Sep 29, 2025

@iamgabrielma thanks for the review!

The card reader connection button overlaps most screens and some flows, do you know if this is logged already as part of iOS16 work? Happy to open it otherwise.

It's not logged by design. This iOS 26 works to make views a bit more flexible does not aim to do full small screen support. If we do, then we have a phone POS. I realize that the current views are not 100% optimal when the height is super-small but it's just better to what was before.

Thoughts if we still need the min width view with iOS26? If we do, we should also change the text to not mention only split views. I can log that one as well 👍

Yes, we still do need it. I haven't done any work on supporting more screen widths. This was focused on height.

Should we move/declare this 0.3 somewhere else? Just to avoid magic numbers

I'll address it.

@staskus staskus enabled auto-merge September 29, 2025 10:55
@staskus staskus merged commit b30c5c7 into trunk Sep 29, 2025
13 checks passed
@staskus staskus deleted the woomob-1248-ipados-26woo-pos-adjust-layout-for-smaller-window-heights branch September 29, 2025 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

iOS 26 Specific to iOS 26 type: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants