Skip to content

lock file state when in rebase conflicts#7377

Merged
iAmWillShepherd merged 28 commits intodevelopmentfrom
lock-file-state-when-in-rebase-conflicts
Apr 25, 2019
Merged

lock file state when in rebase conflicts#7377
iAmWillShepherd merged 28 commits intodevelopmentfrom
lock-file-state-when-in-rebase-conflicts

Conversation

@shiftkey
Copy link
Member

@shiftkey shiftkey commented Apr 22, 2019

Overview

Closes #7006

Description

This PR updates the ChangesList component to lock down the checkboxes when rebase conflicts are detected.

Currently you can change all the checkboxes in the list, but these choices are ignored because the rebase flow needs to stage all tracked files (untracked files are ignored by git when rebasing) to continue correctly:

With this PR, we now:

  • disable all checkboxes while you are dealing with rebase conflicts
  • lock the checkbox state to include tracked files, and exclude untracked files

This is how the underlying git rebase works by default, and Desktop needs to follow this convention when staging files before continuing the rebase.

TODO:

  • lock down checkbox state
  • warn when untracked files exist
  • show a subset of the context menu options when in the middle of a rebase

Release notes

Notes: [Improved] Changes list state better reflects rebase flow when handling conflicts

@shiftkey shiftkey added this to the 1.7.0 milestone Apr 22, 2019
@shiftkey shiftkey marked this pull request as ready for review April 22, 2019 14:06
@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 22, 2019
@billygriffin
Copy link
Contributor

This is great! The only thing I'm curious about is whether people might be confused by the unchecked portion and not being able to do anything about it.

@shiftkey
Copy link
Member Author

The only thing I'm curious about is whether people might be confused by the unchecked portion and not being able to do anything about it.

We could use the commit form to provide more context:

Maybe an ⚠️ icon above the button alongside a message like Untracked files excluded from rebase when they're in this situation? I can noodle on how this would look if this feels on the right track.

@tierninho
Copy link
Contributor

Tested the functionality and LGTM.

@outofambit outofambit self-requested a review April 22, 2019 22:26
@shiftkey shiftkey removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 23, 2019
@shiftkey
Copy link
Member Author

Dropping ready-to-review while I implement this suggested change #7377 (comment)

@donokuda
Copy link
Contributor

Maybe an ⚠️ icon above the button alongside a message like Untracked files excluded from rebase when they're in this situation? I can noodle on how this would look if this feels on the right track.

The ⚠️icon might feel like there's an issue that a user needs to fix in order to move on (like a merge conflict.) Maybe using an ℹ️icon or something to visually associate it more closer to the file it's referencing (for example, like the diff-added octicon):

Another consideration is to hide the checkboxes for all files since it seems like we wouldn't want users to interact with the list at all.

@shiftkey
Copy link
Member Author

@donokuda that's a good shout - I'll try it out!

Another consideration is to hide the checkboxes for all files since it seems like we wouldn't want users to interact with the list at all.

I worry about removing the checkboxes because their state is still helpful to indicate what will be rebased and what will be skipped, and for any unexpected side-effects in the DOM (we've not tried this before).

@donokuda
Copy link
Contributor

Thoughts on going even more minimal and starting off with no octicon and putting the text below the button? After looking at my original proposal again, I'm not really sold on how it visually looks with the added icon.

If we find out that it's confusing to a lot of people, we can go back to the drawing board.

I worry about removing the checkboxes because their state is still helpful to indicate what will be rebased and what will be skipped, and for any unexpected side-effects in the DOM (we've not tried this before).

Makes sense, I'd rather keep this as simple as possible than adding more scope without realizing the consequences of it.

@billygriffin
Copy link
Contributor

I'm a big fan of minimal, especially since my concern might be completely unfounded and people will just be like, "yeah, of course it works that way."

@shiftkey
Copy link
Member Author

@donokuda I dig the mininalism. Let me push some changes to this branch and get a working demo together...

@shiftkey shiftkey force-pushed the lock-file-state-when-in-rebase-conflicts branch from 6fc74e0 to 58f28ce Compare April 23, 2019 16:12
@shiftkey
Copy link
Member Author

Latest screenshots - warning when there are untracked files:

After removing the untracked change, the warning goes away:

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Apr 23, 2019
@billygriffin
Copy link
Contributor

@shiftkey Looks good! Is it "Uncommitted" or "Untracked"? I assume you've got it right - just making sure.

@shiftkey
Copy link
Member Author

The last item on my list is what to do with the context menu that is shown:

My current thinking on this is that, when in the middle of a rebase conflict, these options should only be enabled:

We could also show "Discard Changes" if the file is untracked, as a convenient way to address the warning.

I need to do some internals refactoring to be able to change this behaviour, but let me know if you have suggestions about the list to show in this state.

@shiftkey
Copy link
Member Author

shiftkey commented Apr 23, 2019

Is it "Uncommitted" or "Untracked"? I assume you've got it right - just making sure.

@billygriffin "Uncommitted" is too vague for my liking in this situation. Git has two terms which are more explicit:

  • "Unstaged file" - changes to a tracked that have not been added to the index
  • "Untracked file" - a new files in the repository which is not yet tracked by Git

That's why I've settled on "Untracked" here...

EDIT: I meant to use Untracked in the UI, but didn't notice. 🤦‍♂️

@shiftkey
Copy link
Member Author

Here's the context menu entries for a tracked file in the middle of a rebase:

And here's what you see for an untracked file:

Copy link
Contributor

@billygriffin billygriffin left a comment

Choose a reason for hiding this comment

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

Changed other uncommitted references to "untracked"

Co-Authored-By: shiftkey <brendan@github.com>
@shiftkey shiftkey requested a review from a team April 23, 2019 19:55
@tierninho
Copy link
Contributor

Tested and functionally working 👍

We could also show "Discard Changes" if the file is untracked, as a convenient way to address the warning.

Did catch one thing:
The right-click on the n files changed still shows the Discard All Changes option.

Screen Shot 2019-04-23 at 11 07 18 AM

3e3c288, mac

@iAmWillShepherd iAmWillShepherd self-assigned this Apr 23, 2019
@iAmWillShepherd
Copy link
Contributor

Holding off on final review until we decide if https://github.com/desktop/desktop/pulls?q=is%3Aopen+is%3Apr+no%3Aassignee+label%3Aready-for-review#issuecomment-485977147 should be addressed in this PR.

@shiftkey
Copy link
Member Author

The right-click on the n files changed still shows the Discard All Changes option.

Nice find @tierninho. I feel bad for hiding it away, given how not discoverable it is. There's some extra context here that I'll write up into a fresh issue in the morning before I do disable it.

@shiftkey
Copy link
Member Author

There's some extra context here that I'll write up into a fresh issue in the morning before I do disable it.

#7394

Copy link
Contributor

@iAmWillShepherd iAmWillShepherd left a comment

Choose a reason for hiding this comment

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

No need to block based on a comment

@iAmWillShepherd iAmWillShepherd merged commit dc978d3 into development Apr 25, 2019
@iAmWillShepherd iAmWillShepherd deleted the lock-file-state-when-in-rebase-conflicts branch April 25, 2019 16:49
@iAmWillShepherd
Copy link
Contributor

Merged without updating since doing so would have been the 4th time.

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.

restrict checkbox state when dealing with rebase conflicts

5 participants