Skip to content
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

[Tablet Orders] Order list UI updates #12214

Merged
merged 16 commits into from
May 17, 2024

Conversation

iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Mar 5, 2024

Partially closes #12149

Description

This PR addresses most of the UI issues from the design review regarding the Order list. We have left outside of this PR those changes related to semantic colours, since all might need to be reviewed as per p1709628907203209/1708465836.162389-slack-C0354HSNUJH . This will be prioritized and tackled separately.

Changes

  • Adds a divider line to the top of the OrderListTableViewController
Screenshot 2024-02-29 at 19 19 18
  • Adds divider lines to the selected cell in the order list, it would seem these were overwritten by the background colour
Screenshot 2024-02-29 at 19 22 42
  • Updates the Empty Orders screen with a new image (we do not tackle the background colour update, nor removing the navigation bar)

simulator_screenshot_88F19ADC-1F69-4724-859F-D4606402A23D

Testing instructions

  • With sideBySideViewForOrderForm enabled, on a tablet or large iPhone.
  • Go to Orders. Observe that the dividers appear in the Order list to the left, both at the top, as well as between all Order cells.
  • On the same device, on a freshly created store (or a store with no orders), go to Orders. Observe the new "shopping bags" image and the "No Order Selected" text below it. (PD: This is something we could improve in the future, the "Waiting for your first Order" text should be more prominent in this case)

@iamgabrielma iamgabrielma added type: task An internally driven task. feature: order list Related to the order list. category: tablet Specific to tablet devices such as a Galaxy Tab or an iPad. labels Mar 5, 2024
@iamgabrielma iamgabrielma added this to the 17.7 milestone Mar 5, 2024
@iamgabrielma iamgabrielma added the status: draft This is a draft, still need more work but can be reviewed and commented if asked. label Mar 5, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Mar 5, 2024

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

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr12214-ffed3e9
Version18.4
Bundle IDcom.automattic.alpha.woocommerce
Commitffed3e9
App Center BuildWooCommerce - Prototype Builds #8913
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

The current Woo colors might be out of date across the board, so we’re reverting the specific change on this commit. More details in the PR description.
@iamgabrielma iamgabrielma removed the status: draft This is a draft, still need more work but can be reviewed and commented if asked. label Mar 6, 2024
@@ -439,20 +449,23 @@ extension EmptyStateViewController {

fileprivate var message: NSAttributedString {
switch self {
case .simpleTextWithDescription:
return NSAttributedString(string: "")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot break here without retuning something, and making the message an optional NSAttributedString involves a bunch of changes everywhere we use the message. Returning an empty attributed string that is not being used seemed to fit our case without complicating it too much.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider mentioning this in a comment to save someone else refactoring unneccesarily

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Added: abf24bd

@joshheald
Copy link
Contributor

* Updates the Empty Orders screen with a new image (we do not tackle the background colour update, nor removing the navigation bar)

simulator_screenshot_88F19ADC-1F69-4724-859F-D4606402A23D

The two types of empty state for the list/details panes look a bit rubbish next to each other. Let's try to update both, at least as a follow up issue...
@joe-keenan if you happen to have images for the ones on the left, that'd be appreciated, but it's super low priority and we can muddle through if not.

IMG_8F6A4EE8FA99-1

Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

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

Not sure this one's ready, we can keep working on it after release...

Comment on lines 154 to 164
func configureBordersWhenHighlighted() {
let topBorder = CALayer()
let bottomBorder = CALayer()
let borderWidth = 0.5

topBorder.frame = CGRect(x: 0, y: 0, width: frame.width, height: borderWidth)
bottomBorder.frame = CGRect(x: 0, y: 0, width: frame.width, height: borderWidth)
topBorder.backgroundColor = UIColor.divider.cgColor
layer.addSublayer(topBorder)
layer.addSublayer(bottomBorder)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These dividers don't quite look right, e.g. they're full width, and in this screenshot, one is placed over the default divider:
cropped double divider

Given that only the selected cell dividers are missing, I think it's better to leave the existing behaviour than apply this change. There's probably a better way to do it...

Copy link
Contributor

Choose a reason for hiding this comment

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

The fix should probably be in UITableViewCell.updateDefaultBackgroundConfiguration(using:style:) so we get it everywhere...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix should probably be in UITableViewCell.updateDefaultBackgroundConfiguration(using:style:) so we get it everywhere...

Yeah. I experimented with different approaches and the simplest one seems to be using the .stroke... properties inside the cell configuration. Here's the change: ffed3e9

I wasn't able to find a good way to apply this change only to top and bottom:

  • If we use CALayer we have to also play with removing them after a cell stops being selected/highlighted, which I wasn't able to do without crashing when populating the cells. This also adds additional unexpected lines around the first order and we'll have to add additional handling most likely by overriding layoutSubviews
  • Using the customView property feels a bit overkill to add these borders, at least for the moment. If we happen to redo the cells across the app this could make more sense.

The downside of the approach is that we can see the lateral border a bit wider when a cell is selected, but I think it makes sense and overall is an improvement:
simulator_screenshot_39C4B052-902D-4FA2-B141-D366C88AF3E6

Comment on lines 334 to 339
// Adds a border to the top of tableview
let topBorder = CALayer()
let borderWidth = 0.5
topBorder.frame = CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: borderWidth)
topBorder.backgroundColor = UIColor.divider.cgColor
tableView.layer.addSublayer(topBorder)
Copy link
Contributor

Choose a reason for hiding this comment

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

This one's in the wrong place – when you pull to refresh, the divider comes with it. It should be at the bottom of the header, I think...
IMG_5593BBA5DCD0-1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated! 03f5cb6

@@ -439,20 +449,23 @@ extension EmptyStateViewController {

fileprivate var message: NSAttributedString {
switch self {
case .simpleTextWithDescription:
return NSAttributedString(string: "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider mentioning this in a comment to save someone else refactoring unneccesarily

@joshheald joshheald modified the milestones: 17.7, 17.8 Mar 8, 2024
@joe-keenan
Copy link

Hey @joshheald, just acknowledging that I’ve seen this and will get back to you with something for the empty state next week. Let me know if you need it sooner.

@iamgabrielma iamgabrielma modified the milestones: 17.8, 17.9 Mar 15, 2024
@bozidarsevo bozidarsevo modified the milestones: 17.9, 18.0 Mar 21, 2024
@jaclync jaclync modified the milestones: 18.0, 18.1 Mar 29, 2024
@iamgabrielma iamgabrielma removed this from the 18.1 milestone Apr 5, 2024
@iamgabrielma
Copy link
Contributor Author

something for the empty state

👋 @joe-keenan did you had the chance to look into this? Don't worry if not, as Josh mentioned is very low priority, I'm just catching up with this issue so I wanted to be sure before I update the existing ones.

@iamgabrielma
Copy link
Contributor Author

iamgabrielma commented May 2, 2024

@joshheald this is ready for review when you have the time:

Adressed:

  • Moved the border/separator line from the top or the orders to the bottom of the search component, so it looks fine when we pull to refresh
  • Moved the border/separator lines for highlighted cells to the UITableViewCell.updateDefaultBackgroundConfiguration(using:style:) method
  • Added internal comments

Not addressed:

@iamgabrielma iamgabrielma added this to the 18.6 milestone May 2, 2024
@joe-keenan
Copy link

something for the empty state

👋 @joe-keenan did you had the chance to look into this? Don't worry if not, as Josh mentioned is very low priority, I'm just catching up with this issue so I wanted to be sure before I update the existing ones.

Hey @iamgabrielma, sorry about the delay. I was about to say I hadn’t done anything for this, but then I realised I had made a similar empty state for Analytics a while back.

I reused the format and illustration to fit the orders list. I also feel like the Clear Filters CTA overwhelms the error message, so I changed it to a secondary button style.

Let me know if you have any issues with it!

6kkCwI9VOEYcidp6UT5bln-fi-1725_29745

image

@iamgabrielma
Copy link
Contributor Author

iamgabrielma commented May 9, 2024

I reused the format and illustration to fit the orders list. I also feel like the Clear Filters CTA overwhelms the error message, so I changed it to a secondary button style.

Thanks! Looks good! I tried to update this today but requires a bit more work than I expected. Eg:

  • We reuse this view's configuration in different places, eg: changing the colour of the button forces us to change it in other "empty" views that are be unrelated to orders, or contain just a link rather than a button.
  • Moving order of the image and the text forces us to create an entire new view, since what we have cannot be reused.
  • It also has to be updated when the modal-on-modal returns an empty search.

With the current focus I'll move this latest update to the issue that is already open on #12625 for empty states, so we can merge the order improvements for the time being. I haven't made any further changes since the latest update, so the addressed vs not addressed items remains the same 👍

@iamgabrielma iamgabrielma disabled auto-merge May 9, 2024 10:22
@iamgabrielma iamgabrielma modified the milestones: 18.6, 18.7 May 10, 2024
@joe-keenan
Copy link

With the current focus I'll move this latest update to the issue that is already open on #12625 for empty states, so we can merge the order improvements for the time being.

That’s fine. I also would like a more cohesive approach to error states. Thanks for creating a separate issue for it.

Copy link
Contributor

@joshheald joshheald left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, they look good to me 👍

@iamgabrielma iamgabrielma merged commit 237740f into trunk May 17, 2024
24 of 25 checks passed
@iamgabrielma iamgabrielma deleted the issue/12149-order-list-ui-updates branch May 17, 2024 00:43
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. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tablet Orders] Order List: UI updates
6 participants