Skip to content

Add a merge button to the branch selector - #5977

Merged
iAmWillShepherd merged 8 commits into
desktop:masterfrom
bruncun:feature-add-button-branch-selector
Oct 30, 2018
Merged

iAmWillShepherd merged 8 commits into
desktop:masterfrom
bruncun:feature-add-button-branch-selector

Conversation

@bruncun

@bruncun bruncun commented Oct 23, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #5929

Morning! This is an early PR for #5929 as requested by @iAmWillShepherd. So far it visually mocks out the new merge button - the following still needs to be done:

  • Interpolate current branch name into button label
  • Render button only in Branches list (currently also renders in Repositories list and merge dialog)
  • Wire button by duplicating 'Merge into Current Branch' Menu Item logic
  • Identify and prevent edge cases where button ought to be disabled or hidden (e.g. when selected branch matches current branch)
  • Tests?

My plan is to complete the above in order and just get it working before reviewing for potential refactors. Please let me know if I missed anything or whether I should go about this feature differently somehow.

@outofambit outofambit added this to the 1.5.0 milestone Oct 23, 2018
@iAmWillShepherd

Copy link
Copy Markdown
Contributor

@bruncun, the build is failing due to linter errors. Run yarn lint:fix on your machine and commit the changes it makes to get the build to pass.

@bruncun

bruncun commented Oct 23, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd Oops, sorry. 😅 Done.

@iAmWillShepherd iAmWillShepherd 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.

I know this is still a work in progress, but I figured I'd jump in early to make sure you were on the right track. I've included some guidance, let me know if it makes sense.

Comment thread app/src/ui/lib/filter-list.tsx Resolved
@tierninho

Copy link
Copy Markdown
Contributor

Two suggestions after taking an early look at this branch:

  • Remove the button if there is only one branch or just grey it out
  • The amount of white space looks odd... not sure if floating it up will look any better

screen shot 2018-10-24 at 9 09 43 am

@billygriffin

Copy link
Copy Markdown
Contributor

@desktop/design Would you mind taking a quick look at @tierninho's thoughts/questions above?

My thoughts:

Remove the button if there is only one branch or just grey it out

I definitely don't think we should remove it because I think it's important to convey an expectation that this is where they can merge from (like if they use multiple repos). It's not greyed out in the menu bar at present, so whichever direction we go, I think we should do the same thing in both places. I think greying it out in both places seems reasonable, as there's really nothing you can do in the modal at that point.

The amount of white space looks odd... not sure if floating it up will look any better

I agree that it looks a bit odd in the case when there are no branches or very few, but again I think the consistency of location might be a good idea to maintain, and I also don't think it floating would look very good unless we decided to change the visual representation of the entire dropdown to only drop vertically by the amount of space needed (I don't think we should consider that here).

@ampinsk

ampinsk commented Oct 24, 2018

Copy link
Copy Markdown
Contributor

I definitely don't think we should remove it because I think it's important to convey an expectation that this is where they can merge from (like if they use multiple repos). It's not greyed out in the menu bar at present, so whichever direction we go, I think we should do the same thing in both places. I think greying it out in both places seems reasonable, as there's really nothing you can do in the modal at that point.

👍 Agree with this. Maybe we leave it in case people are curious and want to get a sense of what clicking on it would do? Disabling it might be frustrating especially if it's not clear why it's disabled. I don't feel strongly though, would also be cool with disabling it

I agree that it looks a bit odd in the case when there are no branches or very few, but again I think the consistency of location might be a good idea to maintain, and I also don't think it floating would look very good unless we decided to change the visual representation of the entire dropdown to only drop vertically by the amount of space needed (I don't think we should consider that here).

👍 Also agree here.

@bruncun

bruncun commented Oct 24, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd I refactored the button into BranchesContainer as requested and also wired it to show the merge dialog. I believe this now works for the happy path.

@billygriffin

Copy link
Copy Markdown
Contributor

Based on @ampinsk's feedback above, let's go ahead and leave those things as is from @tierninho's questions.

@iAmWillShepherd

iAmWillShepherd commented Oct 24, 2018 •

Copy link
Copy Markdown
Contributor

Based on @ampinsk's feedback above, let's go ahead and leave those things as is from @tierninho's questions.

@billygriffin does that mean the PR is fine as is? Is it worth create issues to capture y'alls thoughts so we may evaluate them in the future? I'm happy to tackle those changes in a separate PR.

@bruncun it looks to me like this may be ready for review. Am I correct?
Also there is no need for tests here, we will verify it works as expected when we review your PR.

@tierninho

Copy link
Copy Markdown
Contributor

UI tested ✅, and no issues found.

@billygriffin

Copy link
Copy Markdown
Contributor

@billygriffin does that mean the PR is fine as is? Is it worth create issues to capture y'alls thoughts so we may evaluate them in the future? I'm happy to tackle those changes in a separate PR.

@iAmWillShepherd It means the things that @tierninho brought up we're going to leave as is for the moment, and if they present problems in the wild we'll re-evaluate. No issues needed at the moment, but thank you! I haven't looked at the rest of the PR, as I assume the review will ensure that it's in line with the designs from the issue and verify that the flow works as expected.

@bruncun

bruncun commented Oct 24, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd I believe that’s correct. 🎉

@iAmWillShepherd iAmWillShepherd changed the title [WIP] Add a merge button to the branch selector Add a merge button to the branch selector Oct 25, 2018
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 25, 2018
@iAmWillShepherd iAmWillShepherd self-assigned this Oct 25, 2018

@iAmWillShepherd iAmWillShepherd 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.

Almost there!

Comment thread app/src/ui/merge-branch/merge.tsx Resolved
ampinsk
ampinsk previously approved these changes Oct 25, 2018

@ampinsk ampinsk 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.

Looks good to me design wise!

@bruncun

bruncun commented Oct 26, 2018

Copy link
Copy Markdown
Contributor Author

@iAmWillShepherd Updated. 👍

@iAmWillShepherd
iAmWillShepherd merged commit f99989a into desktop:master Oct 30, 2018
@iAmWillShepherd iAmWillShepherd mentioned this pull request Oct 31, 2018
2 tasks done
@billygriffin

Copy link
Copy Markdown
Contributor

Hi @bruncun, thanks again for this great work and being so open to feedback and collaborative! For our 1.5 release one of the things we want to highlight is the contributions from our community and how grateful we are for them.

Would you mind if we use your GitHub handle and reference your participation in helping make this release possible in our blog post announcing the release?

@bruncun

bruncun commented Nov 5, 2018

Copy link
Copy Markdown
Contributor Author

@billygriffin The pleasure was mine. I don't mind at all being mentioned. 👍

@shiftkey shiftkey mentioned this pull request Nov 5, 2018
2 tasks done
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.

6 participants