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
Insert artificial commits if filter without any matches is applied #10163
Insert artificial commits if filter without any matches is applied #10163
Conversation
Handle selection after refresh if artificial commits are removed from the view
25b7a17
to
2b19a57
Compare
if (notSelectedId.IsArtificial) | ||
{ | ||
notSelectedId = CurrentCheckout is not null | ||
? CurrentCheckout | ||
: _gridView.ToBeSelectedObjectIds.Where(id => !id.IsArtificial).FirstOrDefault(); | ||
} | ||
|
||
if (notSelectedId is not null) | ||
{ | ||
parents = TryGetParents(Module, _filterInfo, notSelectedId); | ||
} |
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.
To keep it simple, the following can be reduced with the drawback that unselecting ShowArtificial while artificial is selected will not select anything
if (notSelectedId.IsArtificial) | |
{ | |
notSelectedId = CurrentCheckout is not null | |
? CurrentCheckout | |
: _gridView.ToBeSelectedObjectIds.Where(id => !id.IsArtificial).FirstOrDefault(); | |
} | |
if (notSelectedId is not null) | |
{ | |
parents = TryGetParents(Module, _filterInfo, notSelectedId); | |
} | |
if (!notSelectedId.IsArtificial) | |
{ | |
parents = TryGetParents(Module, _filterInfo, notSelectedId); | |
} |
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.
Simplified this, added a comment instead
(The snippet was written when the solution was slightly different, I kept it though)
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.
LGTM, I think the shorter variant suffices
…lied Handle selection after refresh if artificial commits are removed from the view
Fixes #10162
Proposed changes
Handle selection after refresh if artificial commits are
removed from the view
Test methodology
Manual
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.