Skip to content

[RBB] Compare to Branch #3967

Closed
Closed

Description

@nerdneha

This is part of #3956 and is for viewing changes as compared to any branch (ex: master).

Changes:

  • create a feature flag (ideally we don't change anything in the HistorySideBar component)
  • copy change (history -> compare, changes -> commit [may not be reflected in mocks, talk to @niik])
  • branch selecting input with new icon in input
  • list of branches on branch selecting input click (if it's empty) which can be "x"ed out
  • clicking on a branch shows commits ahead of the target branch
  • filtering

User Flow to check functionality:

  • click on compare tab and see the commits you made on your branch + all commits from where you branched off of (existing behavior)
  • click into the "compare a branch..." input and see a list of branches just like you would for switching branches if you clicked on the "current branch" menu item
  • click on "master" and "master" becomes the text in the input and you see all the commits you have ahead of "master"
  • press "x" in the branch input and see list of branches again
  • select another branch, ex: "new-branch" and "new-branch" becomes the text in the input and you see all the commits you have ahead of "new-branch"
  • press "x" in the branch input and see list of branches again
  • start typing the name of an existent branch in "compare a branch..." input
  • see all branches filtered with same behavior as we have for the branches container
  • select a new target branch, ex: "filtered-branch" and "filtered-branch" becomes the text in the input and you see all the commits you have ahead of "filtered-branch"
  • press "x" in the branch input and see list of branches again
  • see the compare tab return to default state

Other pieces:

Notes:
@donokuda said this may change soon

Before:
screen shot 2018-02-08 at 2 11 27 am

(branch list in app for reference)
screen shot 2018-02-12 at 11 02 10 pm

After:
(default view)
default view

(select branch options)
select branch options

(selecting branch)
selecting branch

(filtering branch)
filtering branch

Activity

  1. added this to the milestone on Feb 8, 2018
  2. nerdneha commented on Feb 8, 2018

    @nerdneha
    ContributorAuthor

    @donokuda @niik
    does the branch list grouping of recent v other exactly match the behavior we have in the branches list for "current branch"?

  3. niik commented on Feb 9, 2018

    @niik
    Member

    does the branch list grouping of recent v other exactly match the behavior we have in the branches list for "current branch"?

    It should, yeah.

  4. iAmWillShepherd commented on Feb 27, 2018

    @iAmWillShepherd
    Contributor

    Question:

    1. Where does the list of branches come from? Remote, local, or both?
    2. When the branch textbox has focus, do I render all branches as a branch list or is this more similar in behavior to a select element?
    3. Where can I get the icon asset for the branch textbox?
  5. shiftkey commented on Feb 27, 2018

    @shiftkey
    Member

    Where can I get the icon asset for the branch textbox?

    I know this one! It should be this icon which can be rendered as an Octicon React component using the OcticonSymbol.gitBranch symbol.

  6. donokuda commented on Feb 28, 2018

    @donokuda
    Contributor

    Because the branch-icon-inside-of-the-text-field is something new, I'm not necessarily sure what the implications are for implementing it.

    I did a scrappy little prototype of how I imagined it to behave; but in the potential situation where the cost of implementation is higher than the value of its worth, I think a potential compromise is to always have the icon showing:

    image

  7. iAmWillShepherd commented on Feb 28, 2018

    @iAmWillShepherd
    Contributor

    copy change (history -> compare, changes -> commit [may not be reflected in mocks, talk to @niik])

    @nerdneha could you clarify ☝️ ?

  8. donokuda commented on Feb 28, 2018

    @donokuda
    Contributor

    @iAmWillShepherd That's around changing the tab label from "Changes" to "Commit"

    image

    Sorry for the confusion there 😭

  9. changed the title [-]Compare to Branch[/-] [+][RBB] Compare to Branch[/+] on Mar 19, 2018
  10. iAmWillShepherd commented on Mar 21, 2018

    @iAmWillShepherd
    Contributor

    @desktop/design, any reason we made the decision to use a TextBox and FilterList instead of something like a select DOM element or a combo box?

    As I've been building this, it feels like the selection of the branch should happen from something closer in behavior to a select list. I believe we can style each option so that we see the ahead/behind info as well.

  11. donokuda commented on Mar 21, 2018

    @donokuda
    Contributor

    @desktop/design, any reason we made the decision to use a TextBox and FilterList instead of something like a select DOM element or a combo box?

    I'd be interested in trying out the combo box approach.

    The main reason why we went down the FilterList route is because it's an interaction that already exists in the app itself. My concern with going with just the <select> approach is that you can't necessarily search for a branch.

  12. donokuda commented on Mar 21, 2018

    @donokuda
    Contributor

    In a past life, I've also explored a combo box in a mock (albeit without behind/ahead information.)

  13. shiftkey commented on Mar 23, 2018

    @shiftkey
    Member

    I'd be interested in trying out the combo box approach.

    The main reason why we went down the FilterList route is because it's an interaction that already exists in the app itself.

    Somewhat related: I've not used downshift yet, but it's been on my radar since i came across it
    months ago.

    To quote the elevator pitch:

    downshift 🏎 is the primitive you need to build simple, flexible, WAI-ARIA compliant React autocomplete/typeahead/dropdown/select/combobox/etc (AKA “item selection”) (p)react ⚛️ components.

    This seems like an ideal opportunity to explore the a combined "select with autocomplete" input element and see if it feels better than our current FilterList experience.

    The examples in this post give a pretty good idea of what's possible with it, FWIW: https://blog.kentcdodds.com/introducing-downshift-for-react-b1de3fca0817

  14. locked as resolved and limited conversation to collaborators on Jul 17, 2018
  15. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions