-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pinned repos handling #11779
base: master
Are you sure you want to change the base?
Improve pinned repos handling #11779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 As I complained about when the regarding config form was modified, the term "pinned" may apply for the dashboard. But it does not correctly describe the behavior of the repo dropdown - at least not for the mode I use:
(Yes, this is how it looks. And the single column is not resizable!)
In this dropdown, the first list is just the MRU entries (sorted by usage), the second list is - more or less - the list of all repos I use - in alphabetical order.
Deduplication really needs to optional. A regarding screenshot of the setting is missing in the PR description.
The "Maximum number of pinned recent repositories" needs to be kept as I do not pin repos and do not want to do it (as well as I do not know how to pin them except using the dashboard).
Failing tests need to be adapted.
This is due to the value 40 that you put in "Combobox minimum width" setting. I don't really know the goal of this setting and always untouched the default 0 value. And investigating the code, that's the reason of your not readable display in #11768 |
This comment was marked as off-topic.
This comment was marked as off-topic.
392712e
to
d186804
Compare
2nd version a lot simplified that handle all your remarks... |
2efcbd7
to
bf916d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"number of pinned repos" is the wrong term for this dropdown.
Have a look at the screenshot of deduplication in the PR description.
public static bool HidePinnedFromRecentList | ||
{ | ||
get => GetBool("HidePinnedFromRecentList", false); | ||
set => SetBool("HidePinnedFromRecentList", value); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it like ShowSearchCommit
.
@@ -331,6 +331,7 @@ static IEnumerable<(PropertyInfo property, object defaultValue, bool isNullable, | |||
yield return (properties[nameof(AppSettings.RecursiveSubmodules)], 1, false, false); | |||
yield return (properties[nameof(AppSettings.ShorteningRecentRepoPathStrategy)], ShorteningRecentRepoPathStrategy.None, false, false); | |||
yield return (properties[nameof(AppSettings.MaxPinnedRepositories)], 0, false, false); | |||
yield return (properties[nameof(AppSettings.HidePinnedFromRecentList)], false, false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Honestly, I was wrong at renaming MRU repositories to "Pinned repositories". So at the moment it is literally the good description but indeed it is not describing what it is doing. And I agree that the consequence is that now the settings lables are not good nor consistent. So if you give me the green light, I will rename back the "pinned" to either "MRU repositories" or "top repositories". |
My 2ct: Yes, "top repositories" and "pin to ..." feel much clearer to me. |
"top repositories" is better (major change to rename all variables/methods if that is done though) I have a minor preference for anchor vs pin and am not voting for to have an icon for top repos at all -- |
To clarify a little, the icon is not "top" repos but for "Anchored" repositories. You can have anchored repos in top or recent repos so you can potentially see pin icon in both lists. If you don't anchor a repository from this "Recent repositories settings" lists (repos displayed in bold), you will never see this icon. For me the goal of this pin icon is meet to goals:
I think it's better I create a new PR about doing the renaming (I already did the changes) and once merged we continue our discussion on this one because the label will be impacted. |
b007011
to
44f7cfe
Compare
to make the list shorter and more convenient for user
44f7cfe
to
0479187
Compare
@@ -73,13 +77,16 @@ public void SplitRecentRepos(IList<Repository> repositories, List<RecentRepoInfo | |||
{ | |||
bool mostRecent = (topRepos.Count < n && repository.Anchor == Repository.RepositoryAnchor.None) || | |||
repository.Anchor == Repository.RepositoryAnchor.AnchoredInTop; | |||
RecentRepoInfo ri = new(repository, mostRecent); | |||
RecentRepoInfo ri = new(repository, mostRecent, repository.Anchor == Repository.RepositoryAnchor.AnchoredInTop || repository.Anchor == Repository.RepositoryAnchor.AnchoredInRecent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RecentRepoInfo ri = new(repository, mostRecent, repository.Anchor == Repository.RepositoryAnchor.AnchoredInTop || repository.Anchor == Repository.RepositoryAnchor.AnchoredInRecent); | |
RecentRepoInfo ri = new(repository, mostRecent, repository.Anchor is Repository.RepositoryAnchor.AnchoredInTop or Repository.RepositoryAnchor.AnchoredInRecent); |
@@ -118,7 +125,7 @@ void AddSortedRepos(bool mostRecent, List<RecentRepoInfo> addToList) | |||
addToList.AddRange( | |||
from caption in orderedRepos.Keys | |||
from repo in orderedRepos[caption] | |||
where !mostRecent || repo.MostRecent == mostRecent | |||
where (!mostRecent && !HideTopRepositoriesFromRecentList) || repo.MostRecent == mostRecent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostRecent
and MostRecent
should be renamed to TopRepo
.
where (!mostRecent && !HideTopRepositoriesFromRecentList) || repo.MostRecent == mostRecent | |
where repo.TopRepo == topRepo || (!topRepo && !HideTopRepositoriesFromRecentList) |
@@ -332,6 +332,7 @@ static IEnumerable<(PropertyInfo property, object defaultValue, bool isNullable, | |||
yield return (properties[nameof(AppSettings.ShorteningRecentRepoPathStrategy)], ShorteningRecentRepoPathStrategy.None, false, false); | |||
yield return (properties[nameof(AppSettings.MaxTopRepositories)], 0, false, false); | |||
yield return (properties[nameof(AppSettings.RecentRepositoriesHistorySize)], 30, false, false); | |||
yield return (properties[nameof(AppSettings.HideTopRepositoriesFromRecentList)], false, false, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yield return (properties[nameof(AppSettings.HideTopRepositoriesFromRecentList)], false, false, false); | |
yield return (properties[nameof(AppSettings.HideTopRepositoriesFromRecentList)], false, isNotNullable, isISetting); |
Based on PR #11790 that should be merged first.
Remove "Maximum number of pinned recent repositories" because if user add a repository to the pinned list, it's to see it (otherwise he will remove it from the list)Screenshots
Before
no "pinned" icons & repos duplicated
After
Settings:
Pinned repos with icon:
With pinned repos not deduplicated (as before):
With pinned repos deduplicated (so less repo lines displayed) :
Test methodology
Test environment(s)
Merge strategy
I agree that the maintainer rebase merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.