-
Notifications
You must be signed in to change notification settings - Fork 120
Top Performers Mark3: User Interface #305
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
Conversation
… feature/178-top-performers-mark3 * 'develop' of github.com:woocommerce/woocommerce-ios: Increasing version to Mark 0.7 Clear barChart data after period VC disappears
… feature/178-top-performers-mark3 * 'develop' of github.com:woocommerce/woocommerce-ios: (25 commits) SyncingCoordinator: Adding Documentation Note! OrdersViewController: Updating pageSize SyncCoordinator: Fixing faulty logic OrdersViewController: Decreasing the pageSize OrdersViewController: Restores pageSize Revert to this commit to test PR 295 Implements SyncingCoordinator Unit Tests OrdersViewController: New FSM State NewOrdersViewController: Updates constants SyncCoordinator: Renames Public API SyncCoordinator: Fixing condition OrdersViewController: SyncingCoordinatorDelegate Conformance SyncCoordinator: Documenting API NewOrdersViewController: Wiring updated synchronizeOrders Action OrderAction: Page > PageNumber OrderAction: Renames parameters OrdersViewController: Wiring Sync Coordinator Implements SyncingCoordinator NewOrdersViewController: Wiring new Sync API OrderAction: Synchronize Orders now expects pageSize and pageNumber ...
… feature/178-top-performers-mark3 * 'develop' of github.com:woocommerce/woocommerce-ios: OrdersViewController: Reverts Testing Code Revert to this commit to test Error State Revert to this commit to test Empty Unfiltered State OrdersViewController: Notice as Error Handler OrdersViewController: Nukes FSM Error State
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bummytime code looks great!! few issues i've hit:
Issue A: Suck in No Activity
- Log into a WC Store
- Open the Dashboard
- Top Performers display
No Activity - Buy an item (on the web)
- Pull to refresh
As a result, i'm stuck in the No Activity state.
I'm triggering this in (my) Store. Julia's works just fine... am i missing something? is there a minimum sale threshold?
Issue B: Logout > Not Sync'ing
- Log into Account A
- Logout
- Log into Account B
I'm still having the "Dashboard not syncing" (after an account switch).
Issue C: Pull to Refresh Flicker
- Open the Dashboard
- Pull to Refresh
As a result, the spinner is hidden immediately (zero delay). Feels a bit off, maybe we could do something like what we have in OrderDetailsViewController? (dispatch group + multiple sync OPs)
Issue D: Empty State Bottom Padding
This is not an issue, actually, a detail that we need to spin over!.
Whenever (everything) is in the Empty State, the bottom padding between the placeholder asset and the edge of the screen is huuuge. Maybe we could:
A. Reduce the bottom padding?
B. Add top padding so that it's... balanced?
Still, any alternative i could come up falls short: whenever any of the tabs happens not to be empty... well, the assymetry will be even worse right?.
Please let me know if i did something wrong, the first issue (empty state in my blog) feels like there is something i'm not doing?
Thanks Matt, looks amazing!!!
| if let productURLString = statsItem?.imageUrl { | ||
| productImage.downloadImage(from: URL(string: productURLString), placeholderImage: UIImage.productPlaceholderImage) | ||
| } else { | ||
| productImage.image = UIImage.productPlaceholderImage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(No need to change anything, just passing along an awesome trick!!) You can just do as follows, because the UIImage is inferred from the context:
productImage.image = .productPlaceholderImage
|
Thanks for the thorough review @jleandroperez!
We chatted offline about this and "fixed the glitch" on the site itself ;-)
Yeah, this is a known issue and will get fixed in #260 (before open beta!)
Good catch, I will see if I can address this here without a ton of code. If not I may open another issue.
Yeah, I am not satisfied with the current state of this either. I will update it in this PR! |
mindgraffiti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Minor edits needed for some code comments. Needs a little polish to the line height on the Top Performers name label. I know, I know, autolayout :shakesfistatsky: :)
|
|
||
| extension Collection { | ||
|
|
||
| /// Returns the element at the specified index iff it is within bounds, otherwise nil. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra f in if
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mindgraffiti That is the old programmer in me — I meant to do that (meaning: "if and only if..." ). I'll remove it for clarity. 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL there is notation for "if and only if". please keep that!
| return Locale(identifier: identifier).currencySymbol ?? currency | ||
| } | ||
|
|
||
| /// Returns the a friendly-formatted total string including the currency symbol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete "the"
| /// Returns the a friendly-formatted total string including the currency symbol | ||
| /// | ||
| var formattedTotalString: String { | ||
| return currencySymbol + total.friendlyString() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once I'm done with the MoneyFormatter struct, we'll have new toys to use!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay!
| @@ -0,0 +1,77 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not certain what's going on here, but the nameLabel has too much height / padding / line height. I tried switching the label to multiline, checking for height constraints, and checking the stackview (but none of that is fixing the issue).
| UINavigationBar.appearance().isTranslucent = false | ||
| UINavigationBar.appearance().tintColor = .white | ||
| UIApplication.shared.statusBarStyle = .lightContent | ||
| UILabel.appearance(whenContainedInInstancesOf: [UITableViewHeaderFooterView.self]).textColor = StyleManager.sectionTitleColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
|
||
| class IntrinsicTableView: UITableView { | ||
|
|
||
| override var contentSize:CGSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Colons should be next to the identifier when specifying a type and next to the key in dictionary literals. |
jleandroperez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great!!! discussed over slack, we're addressing the pendings in smaller issues, we need to move this puppy!!
Thanks Bummy!!!
![]()
|
Thanks @jleandroperez — issues are logged! |
|
Thanks for doing that sir!!! 🙇 |
Generated by 🚫 dangerJS |
This PR wraps up the work on Top Performers. It mainly contains UI additions:
Just like
NewOrdersViewController, the top performers table uses aResultsControllerinstance not attached to a tableview. Updates should be reflects as soon as new data is inserted into Storage.Other Misc things:
Array+Helpers.swiftadded a helper func to safely grab a value from aCollectionregardless of boundsAppDelegate.swift, updated theUITableViewHeaderFooterViewtext color via appearance proxy (the Orders List screen had the wrong color for section headers)UIImage+Woo.swift, added a GridIcon that i used for a product image placeholder if a valid URL is not availablebuildDateString()a static func onStatsStoreUIImageView+NetworkinginWordPressUI🎉Also note that I addressed the "stale data after logout" issue (#300) in this PR. Both New Orders and Top performers should correctly reset after the user logs out. The revenue chart data does NOT reset correctly after a log out, however this will be addressed when #258 is completed.
Fixes: #178
Fixes #300
Testing
Preconditions: Start with a fresh install of the app. Log into a your store of choice (ideally one with recent-ish orders).
Give the UI a good test drive here. Things to consider:
@jleandroperez and @mindgraffiti would you mind taking this for a spin? Thanks!