Skip to content

[Orders] UI improvements for small tablets #14152

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

Merged

Conversation

samiuelson
Copy link
Contributor

@samiuelson samiuelson commented Jun 5, 2025

Fix support for large font scale size on small tablets

WOOMOB-537

Description

This PR adds a couple of improvements for Orders screen on small tablets, especially with increased size of font and increased pixel density:

  1. Ellipsizing texts
  2. Shrinking horizontal margins (only on small tablets in portrait)
  3. Optimizing widths ration of Orders | Order Details screen

Steps to reproduce

Testing information

Check if you can reproduce any UI glitches with accessibility size settings (screen size, font size).

The tests that have been performed

Tested Orders | Order details screen on different devices and configurations:

  1. Small tablet (10.2" 1280x800px)
  2. Medium tablet (10.9" 1440x2304px)
  3. Increased screen size (AS –> Running Devices –> Device UI Shortcuts)
  4. Increased font size (AS –> Running Devices –> Device UI Shortcuts)

Results below.

Images/gif

  • Small tablet with increased screen size scale and font size scale in accessibility settings
    Untitled1
  • Small tablet with very increased screen size scale and font size scale in accessibility settings
    Untitled2
  • Normal tablet landscape – bigger margins in details pane
    Untitled3
  • Normal tablet portrait - smaller margins in details pane
    Untitled4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Sorry, something went wrong.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 5, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitdc183a9
Direct Downloadwoocommerce-wear-prototype-build-pr14152-dc183a9.apk

@samiuelson samiuelson requested a review from kidinov June 5, 2025 16:36
@samiuelson samiuelson added feature: order list Related to the order list. category: tablet Specific to tablet devices such as a Galaxy Tab or an iPad. labels Jun 5, 2025
@samiuelson samiuelson added this to the 22.6 milestone Jun 5, 2025
@samiuelson samiuelson marked this pull request as ready for review June 5, 2025 16:38
@samiuelson samiuelson changed the title Woomob 537 order listtablet large font support is bad [Orders] UI improvements for small tablets Jun 5, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jun 5, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitdc183a9
Direct Downloadwoocommerce-prototype-build-pr14152-dc183a9.apk

@codecov-commenter
Copy link

codecov-commenter commented Jun 5, 2025

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 37.78%. Comparing base (d49fb2d) to head (dc183a9).
Report is 17 commits behind head on trunk.

Files with missing lines Patch % Lines
...n/com/woocommerce/android/extensions/ContextExt.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #14152      +/-   ##
============================================
- Coverage     37.78%   37.78%   -0.01%     
- Complexity     8945     8946       +1     
============================================
  Files          1956     1956              
  Lines        109561   109566       +5     
  Branches      14385    14387       +2     
============================================
+ Hits          41396    41397       +1     
- Misses        64388    64393       +5     
+ Partials       3777     3776       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kidinov kidinov self-assigned this Jun 9, 2025
@@ -108,6 +110,7 @@ class OrderDetailFragment :
companion object {
val TAG: String = OrderDetailFragment::class.java.simpleName
private const val MARGINS_FOR_TABLET: Float = 0.1F
private const val MARGINS_FOR_SMALL_TABLET: Float = 0.01F
Copy link
Contributor

@kidinov kidinov Jun 9, 2025

Choose a reason for hiding this comment

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

I believe we should use something like 16dp in this instance; otherwise, it may not adhere to the 4dp grid guideline and become noticeable as this is small padding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Set to fixed 16dp: f2a761d

@@ -97,7 +97,7 @@ class OrderListFragment :
const val FILTER_CHANGE_NOTICE_KEY = "filters_changed_notice"

private const val JITM_FRAGMENT_TAG = "jitm_orders_fragment"
private const val TABLET_LANDSCAPE_WIDTH_RATIO = 0.3f
private const val TABLET_LANDSCAPE_WIDTH_RATIO = 0.4f
Copy link
Contributor

Choose a reason for hiding this comment

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

While it's name "landscape" it's actually set 0.4 to both Portrait and landscape orientations. So:

  • Maybe name it properly
  • It feels that 0.3 is better for landscape, but 0.4 for portrait

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Yeah, it looks odd now in landscape on big tablets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to .4 in portrait and .3 in landscape: a3d096f

Copy link
Contributor

@kidinov kidinov left a comment

Choose a reason for hiding this comment

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

LGTM! I left a couple of suggestions please take a look

Also, I'll leave this up to you, but now, in some cases we show 2 panes in portrait and 1 pane in landscape, which is odd

06-09--11-57.mp4

@samiuelson
Copy link
Contributor Author

samiuelson commented Jun 9, 2025

Thanks for review, @kidinov.

Also, I'll leave this up to you, but now, in some cases we show 2 panes in portrait and 1 pane in landscape, which is odd

Good catch. Since this is a separate bug, and may require some more tests and discussion, I raised a separate PR with the fix: #14160. You can take a look.

@samiuelson samiuelson requested a review from kidinov June 9, 2025 15:21
Copy link
Contributor

@kidinov kidinov left a comment

Choose a reason for hiding this comment

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

@samiuelson I get this on a small tablet now (notice large paddings)

image image image

@samiuelson
Copy link
Contributor Author

samiuelson commented Jun 10, 2025

@samiuelson I get this on a small tablet now (notice large padding)

👋 @kidinov, I can't reproduce such large margins on a similar configuration.

Could you check the actual dp size of the screen, for example, by measuring the dp size of the root container using the layout inspector in AS? It's the dp value of the shorter dimension that is being classified in Context.windowWidthSizeClass.

I suspect your device has larger dp screen width class than MEDIUM_SCREEN_MAX_WIDTH and that's why it shows larger margins.

@samiuelson samiuelson requested a review from kidinov June 10, 2025 13:27
@kidinov
Copy link
Contributor

kidinov commented Jun 10, 2025

@samiuelson

image image

@kidinov
Copy link
Contributor

kidinov commented Jun 11, 2025

@samiuelson 👋

I just realised that I tested it on the products screen, not orders. Sorry about that. We'd need to implement this on the products though, otherwise it looks inconsistent.

@samiuelson samiuelson enabled auto-merge June 12, 2025 13:42
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 22.6. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@samiuelson samiuelson merged commit a10f2dc into trunk Jun 12, 2025
17 checks passed
@samiuelson samiuelson deleted the woomob-537-order-listtablet-large-font-support-is-bad branch June 12, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tablet Specific to tablet devices such as a Galaxy Tab or an iPad. feature: order list Related to the order list.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants