Skip to content

"Discard Changes" menu item assumes you want to discard your selected items - #5187

Merged
nerdneha merged 5 commits into
masterfrom
context-menu-should-discard-right-change
Jul 20, 2018
Merged

nerdneha merged 5 commits into
masterfrom
context-menu-should-discard-right-change

Conversation

@shiftkey

@shiftkey shiftkey commented Jul 18, 2018 •

Copy link
Copy Markdown
Member

Fixes #4788

Current behaviour

Here's some example scenarios where the app currently doesn't discard the right files. The lack of a confirmation dialog makes this worse, because you don't see the files are different when discarding.

Select a single file, then right-click discard on a different file

Select a group of files, then right-click discard on a different file

This PR

Select a single file, then right-click discard on a different file

Select a group of files, then right-click discard on a different file

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jul 18, 2018
@nerdneha nerdneha self-assigned this Jul 19, 2018
@shiftkey shiftkey added this to the 1.3.0 milestone Jul 19, 2018

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

made an assumption here that the previous selected files vs. currently selected files applies to both discarding and ignoring.

because of this, i suggested we have more general comments so it doesn't apply that only deleting would be affected. i might be wrong so i'm not requiring these changes.

Comment thread app/src/ui/changes/changes-list.tsx Outdated

if (this.props.selectedFileIDs.includes(id)) {
// user has selected a file inside an existing selection
// -> they may want to discard multiple changes

This comment was marked as spam.

This comment was marked as spam.

Comment thread app/src/ui/changes/changes-list.tsx Outdated
this.props.selectedFileIDs.forEach(addItemToArray)
} else {
// this is outside their previous selection
// -> they just want to discard the selected file

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member Author

🍎

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

behavior works and code is clean ✨

@nerdneha
nerdneha merged commit 0ec5b64 into master Jul 20, 2018
@nerdneha
nerdneha deleted the context-menu-should-discard-right-change branch July 20, 2018 05:42
@lock lock Bot locked as resolved and limited conversation to collaborators Sep 18, 2018
@desktop desktop unlocked this conversation Sep 27, 2018
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.

2 participants