Skip to content

Discarding wrong items #4788

Closed
Closed

Description

@IanKeen

Description

Right clicking and choosing to 'discard changes' works as expected, however it seems selection jumps to the first item in the list and a subsequent right click and choosing 'discard changes' appears to be choosing the right row visually... but it actually discards the first time in the list

Version

  • GitHub Desktop: 1.2.0
  • Operating system: 10.13.4 (17E199)

Steps to Reproduce

  1. have a repo with unstaged changes
  2. right click on something down the list
  3. choose 'discard changes'
  4. without clicking anywhere else first, right click on something else down the list
  5. choose 'discard changes'

Expected Behavior

I expect the second thing I right clicked on to be discarded

Actual Behavior

The first item in the list is discarded

Additional Information

Logs

2018-05-25.desktop.production.log

Activity

  1. added
    bug
    on May 25, 2018
  2. steveward commented on May 25, 2018

    @steveward
    Contributor

    Good catch @IanKeen! I was able to reproduce this as well, so I'm going to mark this as a 🐛 .

  3. self-assigned this
    on Jun 19, 2018
  4. DanTup commented on Jul 14, 2018

    @DanTup

    I wonder if this is what I've been seeing. On several occasions the wrong files have been discarded, but I could never repro.

    Luckily the changes go to Trash, but unlike on Windows it seems on a Mac I have to then manually navigate to the specific folder and drag them back, which is a bit tedious.

    I think the times I've seen this I've been debugging something, so had debug prints and a fix in my working directory. I switched back to GHD, aimed to discard the debug prints, but somehow lost the fix. I think it's happened with a multi-file selection but I can't say for sure - every time it happens and I tried to repro, I failed.

  5. removed their assignment
    on Jul 16, 2018
  6. DanTup commented on Jul 18, 2018

    @DanTup

    Ok I just saw my issue again; though I'm not sure if it's exactly what's reported above. Basically, if you right-click on any file that is not selected, then click Discard, the prompt has the previously-selected file in it (like the context menu decides which item is selected before the visual selection moves to the item under the mouse on the click).

    The file shown in the discard prompt is, as far as I can tell, accurate to what gets discarded. So the danger is if you don't read the filename in the prompt rather than it just deleting a different file.

  7. billygriffin commented on Jul 18, 2018

    @billygriffin
    Contributor

    Confirmed @DanTup's feedback that it's the previously selected file that is the one shown in the prompt. Thanks for clarifying!

  8. self-assigned this
    on Jul 18, 2018
  9. added this to the 1.3.0 milestone on Jul 19, 2018
  10. locked as resolved and limited conversation to collaborators on Sep 18, 2018
  11. 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

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions