[ENHANCEMENT] Scroll active (HEAD-pointed) local branch into view (when LOCAL BRANCHES list is tall)
Opened this issue · 3 comments
NOTE: This is a low-prio suggestion, but would still be nice to have.
Problem: The LOCAL BRANCHES list is expanded by default, and if there are a lot of local branches the active (HEAD-pointed, green checkmark, if any) branch could be scrolled out of view - which can be a bit disorienting. (NOTE: When re-activating a repo-tab, the LOCAL BRANCHES list is scrolled-to-top and its selection is cleared.)
Solution: Make the active branch be automatically scrolled-into-view in the LOCAL BRANCHES list, whenever a repo-tab becomes (re-)activated (switched-to). (NOTE: No selection needs to be changed, I just want to be able to see the green checkmark in the list.)
Motivation: A similar feature is already implemented for the graph/log area, where the currently selected commit is automatically scrolled-into-view. (Also, this feature is not affected by my suggestion, which does not change any selection.)
I've pushed a commit that when you click the Navigate to HEAD button in toolbar, the current branch will be selected and scrolled into view.
Thanks, @love-linger! That's a nice addition. However, the issue I had was that if I switch to another repo-tab and then back, the branch list(s) are scrolled-to-top again. The Graph remembers its earlier selection and scrolls it into view when switching back to the previous tab, but not so with the branch lists... (Basically, it would be easier to retain focus when switching back-and-forth between a couple repos if the lists retained their scroll positions.)
A slightly related idea is the following:
- Add context commands "Select tracking branch" / "Select local branch" (or similar) as a way to "jump" back-and-forth between a LOCAL branch and its REMOTE tracking-branch (causing selection of the "opposite" branch in the respective sidebar list).
- This is especially useful if a local branch is not on the same commit as its remote tracking branch, which means selection in sidebar will also cause a selection change (and re-focus) in the Graph view.
- Even when they are at the same commit, it would still be useful to locate the related branch in the other list - especially if the lists are long (usually the remote list has more branches than the local list, making it necessary to scroll before finding the tracking branch).
- A similar context command "Select in branch-list" (or similar) could be used to navigate from a branch in the Graph to the corresponding branch in the relevant sidebar list.
(NOTE: This could be made into a separate feature-request, if you prefer...)