Open jason5122 opened 3 years ago
I noticed this just the other day. Fixing the top one is a simple bounds check to make sure we don't select above the top. The bottom is trickier because the selection is based off of the top file visible, which if the files are small changes can result in it being a few more files down.
Is there anything wrong with the bottom overscroll one? I just added it for comparison with the top overscroll but I might have missed it.
For the bottom case, the list on the left has selected the file at the top of the right side, it's not the last file on the right. To see it, you have to manually scroll on the left list.
Ah I see. I actually thought it was correct as technically the file on the top of the right window isn't the bottommost file, but a few files above. However, you're right that it doesn't make much sense, since you get something like this if you select the last file(s) on the left list:
Maybe we should allow for an overscroll so that the bottom file can truly be on the bottom? I'd say that would make the most sense. I could try to create a pull request but I'm very new to macOS GUIs, so I'd need some time to learn first.
Maybe just fixing the top one would be a good fix for now. The bottom selection is difficult to resolve and would change some scrolling behavior most likely.
Agreed. Is the top an easy fix?
I think it would be relatively straightforward. I haven't looked at the code, but my guess would be that the selection is being updated by NSScrollView callbacks for position and then we'd check which row/section is in that position.
In Quick View for a commit, the changed files are listed on the left and the diff is on the right. As you scroll through the diff, the highlighted file changes to correspond to the diff. The normal behavior is shown below:
Top
Bottom
However, there is a situation in which no file is highlighted on the left, shown below. If you scroll up past the topmost file, nothing is selected. If you scroll up past the bottommost file, the bottommost file remains selected.
Top, overscroll
Bottom, overscroll
Is this intentional?