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
fix: label "No changes" no more hiding first file of the list #11724
fix: label "No changes" no more hiding first file of the list #11724
Conversation
GitUI/UserControls/FileStatusList.cs
Outdated
@@ -1070,6 +1070,7 @@ private void FileStatusListLoading() | |||
FileStatusListView.Groups.Clear(); | |||
FileStatusListView.Items.Clear(); | |||
FileStatusListView.EndUpdate(); | |||
FileStatusListView.BringToFront(); |
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.
Rather set the visibility in dependency on whether the commit is empty (tested with branch mstv/repro/empty_commit).
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.
Set visibility is preferred, bring to front disrupts but just changing Visible seem to change order in some situations at least.
I had some problems here...
Whatever that works is OK for me.
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.
I will have a look again but the problem is that visibility is already set to false and the label is still visible 🤷
So I tried that as we already play with that to bring the label to front.
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.
Can we push the lable to the back rather change the z-order of other controls?
10b42c5
to
f171308
Compare
f171308
to
7e210b8
Compare
I have spent some time investigating and found the real reason behind the regression in It was a difficult investigation partly because I didn't know the search feature. Explained in the commit message (that I reproduce here):
|
Investigation was painful and time consuming (also partly because, as I said I didn't know the search feature and the bug let me think that I missed something logical) and make me doubt about my knowledge of the De Morgan's Law Formula but in fact the "bad behavior" lie in |
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.
Investigation was painful and time consuming
We don't always get back the value that have just been set
Heavy! Good to know!
GitUI/UserControls/FileStatusList.cs
Outdated
// Use variable to prevent bad value retrieved from `Visible` property | ||
bool filesToFilter = filesPresent || (SearchComboBox.Visible && !string.IsNullOrEmpty(SearchComboBox.Text)); | ||
FilterComboBox.Visible = filesToFilter; | ||
NoFiles.Visible = !filesToFilter; | ||
if (NoFiles.Visible) |
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.
❔ Then also
if (NoFiles.Visible) | |
if (!filesToFilter) |
Or is only ComboBox
affected?
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.
Or is only
ComboBox
affected?
It seems to be OK for the label but as I can't be sure, you're right it's better to be careful. Done.
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.
approved pending mstv comment
I spent a lot of time on this too, handled many cases but missed this...
Thanks
when opening "FormLog" even if it was set as not visible. Fixes gitextensions#11679 Reproduce step: double click on a revision in the revision grid Regression introduced by f8c0353 /!\ Technical reason of the bug: Previous code was: FilterComboBox.Visible = filesPresent || (SearchComboBox.Visible && !string.IsNullOrEmpty(SearchComboBox.Text)); NoFiles.Visible = !FilterComboBox.Visible; But as `FilterComboBox.Visible` is not just a property storing the value directly to a backed field (it has a complex WinFoms internal logic), the value retrieved by the getter ( to after set `NoFiles.Visible`) is sometimes wrong and not the one set to the property :( The value is not "well" set due to complex internal logic and so a wrong value is used after. Using a temporary variable fix the issue because the set of the 2 properties has no more impact on each others!
7e210b8
to
19062b8
Compare
Ah yes, |
when opening "FormLog"
even if it was set as not visible.
Fixes #11679
Reproduce step: double click on a revision in the revision grid
Regression introduced by f8c0353
/!\ Technical reason of the bug:
Previous code was:
But as
FilterComboBox.Visible
is not just a property storing the value directly to a backed field(it has a complex WinFoms internal logic),
the value retrieved by the getter ( to after set
NoFiles.Visible
) is sometimes wrong and not the one set to the property :(The value is not "well" set due to complex internal logic and so a wrong value is used after.
Using a temporary variable fix the issue because the set of the 2 properties has no more impact on each others!
Screenshots
Before
After
Test methodology
Test environment(s)
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.