OneBusAway / onebusaway-iphone

OBA development has moved!
https://github.com/OneBusAway/OBAKit
Apache License 2.0
219 stars 117 forks source link

Improve appearance of AlertPresenter error messages #1102

Closed aaronbrethorst closed 7 years ago

aaronbrethorst commented 7 years ago

The URL is ugly, but it's also been consistently the best way to diagnose and explain a couple classes of errors to users.

Design

We'll build a custom UI for the Swift Messages component. It'll use a light blur effect view as the background, have 16px borders around the edges, and a full width Dismiss button across the bottom separated from the rest of the UI by a 0.5px hairline.

This design will be used for all SwiftMessage-based alerts for the user, including errors and warnings. Ideally, we'd supply a tint color (red tint for errors, e.g.), but I don't think this is possible with UIVisualEffectView.

iphone se

Message Body

The error messages presented will replace the URL with a new Reference value. This reference value will be calculated from the first 10 digits of the SHA1 of the URL in question. This SHA1 value will be presented on screen and also logged with Crashlytics via its -recordError:withAdditionalUserInfo: method. Specifically, the SHA1 will be included with the key reference. i.e. [Crashlytics sharedInstance recordError:error withAdditionalUserInfo:@{@"reference": [self calculateSHA1FromURL:URL]}];

Where the SHA1 calculation method grabs the first 10 characters from the method described here: https://stackoverflow.com/questions/7570377/creating-sha1-hash-from-nsstring


This could stand to look more polished :-\

simulator screen shot apr 28 2017 12 26 18 am

cathy810218 commented 7 years ago

@aaronbrethorst Is it necessary to have the url presented to users? If removing the url will make it look better, I think I can fix this real quick.

ualch9 commented 7 years ago

Maybe log it in console, but don't show in alert

aaronbrethorst commented 7 years ago

I've included a design and an alternative to the URL, which I agree is ugly.