-
Notifications
You must be signed in to change notification settings - Fork 406
Display warning notification when pull results in merge conflicts #877
Conversation
Actually, maybe better to temporarily replace the ⬇️ 1 ⬆️ 1 with a |
👍 on switching the push/pull status to a merge conflict warning and not displaying a notification. |
Oooh interesting idea. After thinking a bit about how this would look I have a couple of concerns around tradeoffs - mainly inconsistency, loss of data and access to functionality. Concerns: If we add a And I hesitate to replace the ahead/behind count because that would again make for an inconsistent experience where sometimes it's there, sometimes it's not, and perhaps it's not immediately obvious to the user that it was replaced by the So if anything I'd advocate for having both shown independently, but I'm not confident that it's worth it to add the Notification good enough for now? So I think I'm inclined to leave this as-is for now. Happy to revisit it if people feel strongly about it. |
Hmm.. not sure if super new Git users would know what to do. 😜 But yeah, since it's already an improvement, we can revisit in another PR. Edit: Just saw that the file count increases. So another idea is to add an |
I'm personally not sure a status-bar icon is enough for this scenario. If the Git panel is closed, and the user pulls and gets merge conflicts, and the only thing that happens is a small icon appears in the status bar, it's very likely they'll continue with their work never realizing there's a merge conflict. |
@kuychaco Maybe the language in the notification could be improved? Perhaps something like:
(where we would need to create the associated help article — or maybe even embed it in the package as a pane item?) Perhaps also we can toggle the Git panel open...? |
All great suggestions. I think for now I'll do the following:
|
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.
Two suggestions you may or may not want to follow 😄
@@ -194,17 +195,26 @@ export default class StatusBarTileController extends React.Component { | |||
}); | |||
} | |||
|
|||
async attemptGitOperation(operation, errorTransform = message => ({message})) { | |||
async attemptGitOperation(operation, errorTransform = error => ({message: error.stdErr})) { |
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.
👍
{description, dismissable: true}, | ||
); | ||
const {type, message, description} = errorTransform(error); | ||
if (type === 'Error') { |
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.
Care to make these Symbols instead of Strings? 🤔
Or: because the difference between the two arms of the if
statements is the method called on this.props.notificationManager
, why not pass the name of the method directly (and maybe default to addError
)? Something like this:
const {notificationMethod = 'addError', message, description} = errorTransform(error);
this.props.notificationManager[notificationMethod](
message || 'Cannot complete remote interaction',
{description, dismissable: true},
);
message: 'Your pull resulted in merge conflicts', | ||
description: `Your last pull resulted in merge conflicts between your local changes | ||
and the changes on the remote. You can resolve the conflicts with the Git panel | ||
and commit them to continue.`, |
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.
To bikeshed this message a little more, how about:
{
message: 'Merge conflicts',
description: `Your local changes conflicted with changes made on the remote branch. Resolve the conflicts
with the Git panel and commit to continue.`
}
Same basic message content, but (a) slightly shorter and (b) imperative tense rather than second-person.
I don't know, maybe that's too terse. What do you think?
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.
I actually brevity makes more sense for a notification. Easier to scan, and not feel overwhelmed by text. Thanks for the great suggestions :)
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.
👍 LGTM
Fixes #821
I started implementing a fix for #821 that involves using a warning notification rather than an error notification when there are merge conflicts as a result of a pull. Here's what it looks like:
I'm thinking that a notification might not be that helpful, and that it might be more of an annoyance. In my opinion it's pretty clear what's happening based on the fact that merge conflicts appear and the commit box is populated with a message:
Another alternative I'm considering is simply removing the notification.