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

improve error dialogs #619

Merged
merged 3 commits into from May 24, 2020
Merged

Conversation

ianhi
Copy link
Collaborator

@ianhi ianhi commented Apr 23, 2020

close: #617

I added styling to the Discard dialog and the switching branch error dialog to make the filenames more visually distinct from the rest of the text. I also modified the text of a git checkout error to something that is hopefully clearer to beginners. In particular I followed the convention already used of saying "switch" instead of "checkout" and I added discarding the changes as an option for resolving the conflict.

New:
image

image

Old:
image

image

Emphasized the filenames in these dialogs to make it more
immediately obvious what files have conflicts/are being discarded.
if a name wasn't entered or an invalid branch name was entered then the
new branch dialog would close once you hit new branch. This makes it
so the create branch button is disabled when no name has been entered,
and keeps the dialog open until it is clear that branch creation was
successful.

I also removed the 'fatal' from the git error message as it was
redundant with the title of the dialog.
@ianhi ianhi changed the title make filenames more noticeable in error dialogs improve error dialogs Apr 25, 2020
@ianhi
Copy link
Collaborator Author

ianhi commented Apr 25, 2020

The new commit makes it so that the New Branch Dialog doesn't close too early. There were two things happening:

  1. Currently if you don't enter a name and click "Create Branch" the dialog will just close without doing anything because git checkout doesn't do anything. The documentation on this case is pretty fun:

You could omit <branch>, in which case the command degenerates to "check out the current branch", which is a glorified no-op with rather expensive side-effects to show only the tracking information, if exists, for the current branch.

  1. If you enter an invalid branch name such as definitely invalid.lock and try to create a branch the New Branch Dialog will close and then an error will be displayed explaining why a branch couldn't be created
    invalid_branch_early_close

I did three things:

  1. Disabled the create branch button when no name has been entered.
  2. Close the New Branch Dialog only after it is clear that a new branch has been created
  3. Removed the 'fatal:' from the error text as it wasn't adding more information to the error box.

Resulting in:
invalid_branch_later_closing

@ianhi
Copy link
Collaborator Author

ianhi commented May 1, 2020

A failed git pull/push could also be improved:
Failed pull:
image

could offer a button in the dialog to run the set-upstream-to command
push:
image
vs:
image

Unlike pull this is an edited version of the error text that git generates. Would be nice to prompt that a remote needs to be added.

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

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

LGTM thanks @ianhi

I modified the style for disabling the create branch button to fit the one of the commit button

@fcollonval fcollonval merged commit 792914b into jupyterlab:master May 24, 2020
@fcollonval
Copy link
Member

@meeseeksdev backport to 0.11.x

meeseeksmachine pushed a commit to meeseeksmachine/jupyterlab-git that referenced this pull request May 24, 2020
@ianhi ianhi deleted the style-discard-dialog branch May 24, 2020 14:45
fcollonval added a commit that referenced this pull request May 24, 2020
…on-0.11.x

Backport PR #619 on branch 0.11.x (improve error dialogs)
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.

Styling of filenames in error/warning dialogs
2 participants