Skip to content

It's unclear which branch is being merged into another in the merge dialog #5930

Closed

Description

@iAmWillShepherd

The directional merge flow is not as obvious as it could be. It should be perfectly clear which branch you're merging into which branch.

⚠️ See #5555 for additional context ⚠️

This issue is marked as help wanted to gives others the chance to get involved in feature iteration.

Current Merge Dialog
screen shot 2018-10-17 at 4 42 51 pm
Note that we are merging git-store-cache into master.

Goal

We want to make it clearer what branch will be merged into another.

Proposed Solution

Make two changes:

  1. use the title of the dialog to state what branch is being merged and the direction it's being merged
  2. Move the conflicts hint above the Merge button

Mockup
46981644-233e0280-d08e-11e8-9a17-c76e9dca38b5-2

Risks

  • Branch names can be an arbitrary length, so it's worth thinking about how to present a longer branch names in a fixed width window.

The CSS that controls the ellipsis is located here:

.name {
flex-grow: 2;
@include ellipsis;
max-width: 65%;
margin-right: var(--spacing-half);
/* Used to highlight substring matches in filtered lists */
mark {
font-weight: bold;
/* Reset browser defaults */
background-color: inherit;
color: currentColor;
}
}
for some prior art in that area.

Activity

  1. added
    help wanted
    on Oct 17, 2018
  2. JQuinnie commented on Oct 17, 2018

    @JQuinnie
    Contributor

    Hi,
    I’d like to take a stab and work on this issue, thanks!

  3. added this to the milestone on Oct 17, 2018
  4. added
    good first issue
    on Oct 17, 2018
  5. JQuinnie commented on Oct 19, 2018

    @JQuinnie
    Contributor

    Hi @iAmWillShepherd ,

    Love to get a sanity check before I move into the other portion of this issue.

    See current modal output below;

    image

    Question:

    1. I could not seem to replicate the merge conflict in your 2nd screenshot, for me it does not show a conflict and allows merging from modal, but after you click the button, it goes into a different view that brings up the merge conflict diffs... is this a feature for later as discussed in Improve merge flow #5555 ? Just double checking...
    2. Both screenshots have an icon above merge dialog (green check and orange warning), are those features to be pulled in on this issue? If so, can you point me to where I would be able to get those icons?
    3. Styling in the form of a line break between dialog and button, would you like some?
  6. removed their assignment
    on Oct 19, 2018
  7. removed this from the milestone on Oct 19, 2018
  8. iAmWillShepherd commented on Oct 19, 2018

    @iAmWillShepherd
    ContributorAuthor

    I could not seem to replicate the merge conflict in your 2nd screenshot, for me it does not show a conflict and allows merging from modal, but after you click the button, it goes into a different view that brings up the merge conflict diffs... is this a feature for later as discussed in #5555 ? Just double checking...

    No need to replicate the merge conflict as this issue is about presentation. So long as this bit of code is above the ButtonGroup component, you should be fine.

    {enableMergeConflictDetection()
    ? this.renderNewMergeInfo()
    : this.renderOldMergeMessage()}

    If you're curious how to see the conflict warning, you have to try to merge a branch that would produce conflicts.

    Both screenshots have an icon above merge dialog (green check and orange warning), are those features to be pulled in on this issue? If so, can you point me to where I would be able to get those icons?

    Merge info is encapsulated within the renderNewMergeInfo function.

    private renderNewMergeInfo() {
    const { currentBranch } = this.props
    const { selectedBranch, mergeStatus, commitCount } = this.state
    if (
    mergeStatus == null ||
    currentBranch == null ||
    selectedBranch == null ||
    currentBranch.name === selectedBranch.name ||
    commitCount == null
    ) {
    return null
    }
    return (
    <div className="merge-status-component">
    <MergeStatusHeader status={this.state.mergeStatus} />
    <p className="merge-info">
    {this.renderMergeStatusMessage(
    mergeStatus,
    selectedBranch,
    currentBranch,
    commitCount
    )}
    </p>
    </div>
    )
    }

    Controlling which icon to render is encapsulated in the MergeStatusHeader component.

    function getSymbolForState(status: MergeResultKind): OcticonSymbol {
    switch (status) {
    case MergeResultKind.Loading:
    return OcticonSymbol.primitiveDot
    case MergeResultKind.Conflicts:
    return OcticonSymbol.alert
    case MergeResultKind.Invalid:
    return OcticonSymbol.x
    case MergeResultKind.Clean:
    return OcticonSymbol.check
    }

    As these pieces are already implemented, you don't have to worry about pulling in any new features.

    Styling in the form of a line break between dialog and button, would you like some?

    I think you could use use some margin to separate the merge info from the button.

    cc @ampinsk to get her input on your third question.

  9. ampinsk commented on Oct 19, 2018

    @ampinsk
    Contributor

    @JQuinnie thanks for picking this up! Some more margin between the text and button on the bottom would be great.

  10. tierninho commented on Oct 22, 2018

    @tierninho
    Contributor

    Maybe this issue should be addressed here too? #5970

    Secondly, should we edit the merge hint text "This branch is up to date with..." with the actual branch name? It will match our other iterations. This is in regards to

    {`This branch is up to date with `}

  11. iAmWillShepherd commented on Oct 23, 2018

    @iAmWillShepherd
    ContributorAuthor

    Maybe this issue should be addressed here too? #5970

    @tierninho Let's keep the PR for this issue focused. We can get that fix in as a separate PR.

    @JQuinnie, if you're interested in tackling #5970 as well, could you open a new PR for it? Since the merge flow is iteration on feature work we expect to deliver in the next beta, adding additional scope could delay getting this shipped by next week.

  12. iAmWillShepherd commented on Oct 31, 2018

    @iAmWillShepherd
    ContributorAuthor

    The final piece of this was completed in #6027.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions