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

Create PR interstitial dialog refinements #2280

Merged
merged 27 commits into from
Jul 26, 2017
Merged

Conversation

niik
Copy link
Member

@niik niik commented Jul 19, 2017

I started out with the intention of just adding progress indication to the create PR interstitial dialog but got a bit carried away and did some refactoring, cleanup and style changes along the way.

Before

image

image

After

image

The dialog title as well as the content are rewritten to form an answerable question. The branch name has been emphasized using the new Ref component instead of <b> which matches what we use elsewhere (we'll gradually move other custom styles over to this new component). I've also broken up the text a bit for readability.

image

Here I've simply wired up the completion of the dispatcher promise to the Dialog's loading prop which disables all buttons and adds the spinner up top.

image

Finally I made the same text changes in the ahead view of the dialog to have the text form an answerable question. Note that the Cancel button have changed here to No, meaning that if you click No here we won't push the branch but will still open the browser. Conceivably we could make this a Yes No Cancel dialog but since the Create PR action is a non-destructive one (just opening a web page) I didn't feel that was warranted.

Fixes #2265

Sidenote, @donokuda: I wonder if we should play around with a dedicated question dialog in the same vein as #2277 with a question octicon offsetting the content. Might be worth thinking about. With it we could enforce (albeit only by documentation) that such dialogs should pose an answerable question.

@niik niik added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 19, 2017
@joshaber joshaber self-assigned this Jul 19, 2017
Copy link
Contributor

@joshaber joshaber left a comment

Choose a reason for hiding this comment

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

Lovely 😍

* that will be pushed to the user. If only one commit is to be pushed
* we return the singular 'commit', if any other amount of commits
* are to be pushed we return the plural 'commits'. If the
* capitalize parameter is true we'll capitalize the 'c' in commit

This comment was marked as spam.

return (
<ButtonGroup destructive={true}>
<Button type="submit">Cancel</Button>
<Button onClick={this.onPushOrPublishButtonClick}>Yes</Button>

This comment was marked as spam.

This comment was marked as spam.

<Button type="submit" onClick={this.onCreateWithoutPushButtonClick}>
No
</Button>
<Button onClick={this.onPushOrPublishButtonClick}>Yes</Button>

This comment was marked as spam.

* it appears in the general style is an inline-box with a suitable background
* color, using a fixed-width font.
*/
export class Ref extends React.Component<{}, {}> {

This comment was marked as spam.


/**
* A simple style component used to mark up arbitrary references such as
* branches, commit shas, paths or other content which needs to be presented

This comment was marked as spam.

@@ -0,0 +1,8 @@
em.ref {

This comment was marked as spam.

@niik
Copy link
Member Author

niik commented Jul 21, 2017

I tried out a new approach for the buttons. What I'm trying to achieve here that I think is important is that we ask an answerable question in these types of dialogs.

image

image

@joshaber how do you feel about that?

Note that I haven't applied title casing here, I wanted to see if it's an acceptable approach on macOS first

@joshaber
Copy link
Contributor

joshaber commented Jul 21, 2017

It's better than the plain Yes/No, though:

What I'm trying to achieve here that I think is important is that we ask an answerable question in these types of dialogs.

I agree, but conventionally these answers don't actually say "yes" or "no" on Mac, at least. For example:

screen shot 2017-07-21 at 1 13 46 pm

@niik
Copy link
Member Author

niik commented Jul 26, 2017

Alright, I want to get this in before my vacation so I'll just remove the Yes, No completely but I would like to look at platform use of Yes No buttons as I do suspect that they're a de-facto convention on Windows.

Updated images with the dialog refinements from #2277 brought in

image

image

@joshaber joshaber merged commit 005100e into master Jul 26, 2017
@joshaber joshaber deleted the create-pr-dialog-refinements branch July 26, 2017 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants