Skip to content

Discard All Changes isn't discoverable #4197

Closed

Description

@mdiep

Description

One of the things I miss most from Classic Desktop (apart from my beloved comparison graph) is the ability to discard all changes. I've used this pretty frequently after commiting the subset of the changes that I care about. I'd love to have this option back.

The alternatives, discarding the files one-by-one or resorting to the terminal (🙀), take quite a bit more time.

❤️

Activity

  1. donokuda commented on Mar 7, 2018

    @donokuda
    Contributor

    Hi @mdiep!

    If I understand correctly, you can discard all changes by right clicking in the X Changed Files header:

  2. mdiep commented on Mar 7, 2018

    @mdiep
    Author

    Wow. That is… not discoverable.

    In that case, I'd like to see a menu item for this. ☺️

  3. added
    design-input-needed
    on Mar 7, 2018
  4. mdiep commented on Mar 7, 2018

    @mdiep
    Author

    Classic Desktop also had this as an option in the context menu on the individual files. It might not be a bad idea to add it back there too.

    Also, discarding an individual file isn't in the main menu either.

  5. changed the title [-]Discard All Changes[/-] [+]Discard All Changes isn't discoverable[/+] on Mar 7, 2018
  6. donokuda commented on Mar 7, 2018

    @donokuda
    Contributor

    Wow. That is… not discoverable.

    I totally agree 😄

    Classic Desktop also had this as an option in the context menu on the individual files. It might not be a bad idea to add it back there too.

    👍I'm for this since it's more discoverable than the header.

  7. donokuda commented on Mar 10, 2018

    @donokuda
    Contributor

    If anyone wanted to tackle this, I think this will make a good issue for someone to pick up! 😄

    For the UI, we'll want to implement the right click menu item:

    The relevant lines of code to add the menu item can be found here:

    const items: IMenuItem[] = [
    {
    label: __DARWIN__ ? 'Discard Changes…' : 'Discard changes…',
    action: () => this.props.onDiscardChanges(this.props.path),
    },
    { type: 'separator' },
    {
    label: 'Ignore',
    action: () => this.props.onIgnore(this.props.path),
    enabled: fileName !== GitIgnoreFileName,
    },
    ]

    You'll want to add similar to how the "Discard All Changes" item is implemented in the changes list:

    {
    label: __DARWIN__ ? 'Discard All Changes…' : 'Discard all changes…',
    action: this.onDiscardAllChanges,
    enabled: this.props.workingDirectory.files.length > 0,
    },

    @desktop/core + @desktop/comrades Am I missing anything for this one?

  8. added
    help wanted
    and removed
    design-input-needed
    on Mar 10, 2018
  9. nerdneha commented on Mar 12, 2018

    @nerdneha
    Contributor

    @xamm go for it!

    Some helpful tips for completing a PR:

    • Open up a PR when you have your first commit
    • Include Fixes #4197 at the top of the description for your PR and a checklist as you progress through (helpful for you and us!)
    • Read our PR process doc to understand how we do PRs in this repo and what code review looks like
    • When you finish the PR, add a comment saying it's ready for review, include before/after screenshots in the description, and describe any major changes
    • Make sure to test on both Windows and MacOS
    • cc @desktop/design in your PR
  10. tierninho commented on Mar 12, 2018

    @tierninho
    Contributor

    @xamm That's a great question! We plan to add automated end-to-end coverage in the future for some general use cases, in fact this is something we're actively working on. We have a few unit test files in app/test/unit but I don't think we have coverage for this file right now. Thanks for asking!

    PS. No need to add test coverage with your pull request.

  11. locked as resolved and limited conversation to collaborators on Jul 18, 2018
  12. 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

No one assigned

    Labels

    enhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions