Skip to content

Move retry clone dialog into AppError - #9944

Merged
niik merged 21 commits into
developmentfrom
retry-action-in-app-error
Jun 9, 2020
Merged

niik merged 21 commits into
developmentfrom
retry-action-in-app-error

Conversation

@niik

@niik niik commented Jun 5, 2020

Copy link
Copy Markdown
Member

Description

@rafeca ran into an edge case where a clone failed due to some refspec tomfoolery he was up to and noticed that the dialog presenting the error extended way beyond the window dimensions.

image

That's certainly not great UX. Upon seeing the image I was surprised that the git error output wasn't monospaced as I'd done some work to ensure that it was in #8964. Turns out that's because it's a custom dialog invoked through an error handler and as such doesn't enjoy any of the improvements we've made to app errors recently.

It also meant that the error text wasn't selectable, and that the error message didn't overflow using a capped max-height like in the AppError case.

What I've done now instead is to remove the custom error handler and move the detection logic for this particular error into the AppError dialog similar to how we've had custom support for auth errors there.

Note: this does complicate the logic of the AppError component in a fairly nasty way since it means we'll have to check for this error in three places (when determining the title, when rendering the contents, and when rendering the footer). This is a limitation that me and @rafeca discussed and that we think we can get around with some refactoring of the AppError component but not something I want to tackle in this PR.

Screenshots

Before

Screen Shot 2020-06-05 at 13 08 20

After

Screen Shot 2020-06-05 at 13 06 29

Release notes

Notes: [Improved] Clearer presentation of error message when a clone fails

@rafeca rafeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yay!! This is so much better than before! I agree about refactoring the <AppError/> component (and also agree that we should do it separately from this).

I've made a few suggestions (all of them stylistic I think).

Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
Comment thread app/src/ui/app-error.tsx Resolved
@@ -1,76 +0,0 @@
import * as React from 'react'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So good to delete this file!!! 🌶️

* Handle git clone errors to give chance to retry error.
* Doesn't handle auth errors.
*/
export async function gitCloneErrorHandler(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yay!

@niik
niik requested a review from rafeca June 8, 2020 17:51
rafeca
rafeca previously approved these changes Jun 9, 2020

@rafeca rafeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great! Just added a comment but approving since I don't think it's worth blocking the merge.

Comment thread app/src/ui/app-error.tsx Resolved
@niik
niik requested a review from rafeca June 9, 2020 08:34

@rafeca rafeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@niik
niik merged commit 0c3fe5f into development Jun 9, 2020
@niik
niik deleted the retry-action-in-app-error branch June 9, 2020 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants