Skip to content

Moving the selection up (in history) should not loop #7679

Open

Description

@sandstrom

Description:

Moving the selection up (in history), when on the topmost commit, should not loop around to the last commit. It doesn't make sense to loop around, would be better if it did nothing when trying to move the selection 'up' when already at the most recent commit.

To reproduce:

  1. Select the topmost commit
  2. Press the up key
  3. [loop around]

Screenshots:

Before pressing the up-key:

image

After pressing the up-key:

image

Versions:

  • GitHub Desktop: 1.6.6
  • Operating system: macOS 10.14.5

Activity

  1. billygriffin commented on Jun 4, 2019

    @billygriffin
    Contributor

    Hi @sandstrom, thanks for the issue! Would you mind providing a bit more detail in your issue so we can understand the reproduction steps? It would be helpful to know which version of Desktop and which OS version you're using as well so we can better diagnose the issue. Thanks!

  2. added
    more-info-needed
    on Jun 4, 2019
  3. sandstrom commented on Jun 4, 2019

    @sandstrom
    Author

    @billygriffin Sure, I pressed save too early 😄

    Updated just now.

  4. billygriffin commented on Jun 4, 2019

    @billygriffin
    Contributor

    Thanks @sandstrom. Looks like we've seen this issue before, but your description is excellent so I closed the previously open issue in favor of this one. Based on @shiftkey's response in #4582, looks like it may not be super straight-forward to fix, so if you have ideas on how to prevent that looping in this case, we'd definitely be interested in those.

  5. added and removed
    more-info-needed
    on Jun 4, 2019
  6. sandstrom commented on Jun 4, 2019

    @sandstrom
    Author

    @billygriffin Here is a stab: #7680

    Need some more work though + I haven't tested, that was only based on me browsing through the source code for a few minutes. In short, preventing wrapping seems fairly straight forward (or I've missed something obvious, hehe 😅).

    If anyone would like to carry this over the finish line that would be great. Perhaps someone on the Github team, that is getting paid to work on it?

  7. tierninho commented on Jun 4, 2019

    @tierninho
    Contributor

    Can I assume we are keeping the loop functionality when pressing the down arrow at the bottom of the History list?

  8. shiftkey commented on Jun 12, 2019

    @shiftkey
    Member

    @tierninho I think it depends on the situation and what makes sense for keyboard navigation

  9. sandstrom commented on Jun 13, 2019

    @sandstrom
    Author

    @tierninho I would disable loop in both directions for that list.

  10. 0xdevalias commented on Dec 17, 2023

    @0xdevalias

    From one of the linked duplicates, this explanation of why fixing this is a good idea seemed pretty good/useful:

    When holding up key when looking at history to scroll to the top of the list, the up key press on the top history item wraps back down to the bottom of the loaded history list. Can't imagine anyone wanting this wrapping behavior as the history item it jumps to is arbitrary based on the amount of history that has been loaded, and is "down" not "up". And because history continues to load when you press down instead of cycling back to the top, there's no quick way to get back to the top of the list (one's goal when holding the up key). The up key should simply be ignored once your selection is at the top of the history list.

    Originally posted by @BryanCrow in #11657 (comment)

    Also:

    In branch history, if you hold the up arrow key you can scroll through all of your history and when the top is reached it will cycle from the bottom again. If you try to do the same holding the down arrow key it will not cycle starting from the top and you will need to perform a click on a history item from your history list before you can select an item again and use the down arrow key to navigate through the list again.

    Originally posted by @iking7 in #15290 (comment)


    Here is a stab: #7680

    Originally posted by @sandstrom in #7679 (comment)

    The original PR seemed to only be a single line change in findNextSelectableRow app/src/ui/lib/list/list.tsx that added wrap: false.

    There were some concerns raised in that PR (Ref), and some other areas that should be covered for this as well (including how to test it), but if someone was looking to explore this further, that would be a good place to start.

  11. added
    not-planned
    on Jul 8, 2024
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

    enhancementnot-planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions