You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Moving the selection up (in history) should not loop #7679
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:
Select the topmost commit
Press the up key
[loop around]
Screenshots:
Before pressing the up-key:
After pressing the up-key:
Versions:
GitHub Desktop: 1.6.6
Operating system: macOS 10.14.5
Reacted by Takahiko Inayama, BryanCrow, mrlife, Daniel Standish and Jonathan MacKenzie
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!
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.
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?
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.
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.
The original PR seemed to only be a single line change in findNextSelectableRowapp/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.
Activity
billygriffin commentedon Jun 4, 2019
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!
sandstrom commentedon Jun 4, 2019
@billygriffin Sure, I pressed save too early 😄
Updated just now.
billygriffin commentedon Jun 4, 2019
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.
sandstrom commentedon Jun 4, 2019
@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?
tierninho commentedon Jun 4, 2019
Can I assume we are keeping the loop functionality when pressing the
downarrow at the bottom of the History list?shiftkey commentedon Jun 12, 2019
@tierninho I think it depends on the situation and what makes sense for keyboard navigation
sandstrom commentedon Jun 13, 2019
@tierninho I would disable loop in both directions for that list.
0xdevalias commentedon Dec 17, 2023
From one of the linked duplicates, this explanation of why fixing this is a good idea seemed pretty good/useful:
Also:
The original PR seemed to only be a single line change in
findNextSelectableRowapp/src/ui/lib/list/list.tsxthat addedwrap: 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.
Add rebase, cherry-pick, squash, reorder and conflicts
feat: multi-commit operations — rebase, cherry-pick, squash, reorder,…
Add rebase, cherry-pick, squash, reorder and conflicts
Add rebase, cherry-pick, squash, reorder and conflicts
feat: multi-commit operations — rebase, cherry-pick, squash, reorder,…