Skip to content
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

StageAll and UnstageAll improvement when Filter active #8596 #8731

Merged
1 commit merged into from Jan 13, 2021

Conversation

keco2
Copy link
Contributor

@keco2 keco2 commented Jan 8, 2021

Followup on #8596

Note: The first PR #8730 closed (because of I've pushed my changes on master instead of a separate branch and used merge-commit,...)

Proposed changes

  • update 2 misleading texts to display either "All" or "Filtered" words based on the filter:
    • if the Filter is empty (i.e. inactive), use the "All" word
    • otherwise use the "Filtered" word
  • change the icon on the StageAll button interactively based on the filefilter:
    • if the Filter is empty (i.e. inactive), use the classic StageAll picture
    • otherwise use another (new) picture with funnel
  • in addition to the above mentioned changes of StageAll button from "Stage and commit all unstaged files" may not stage all unstaged files #8596 there is a change related to UnstageAll button as well (as agreed in PR Improved text and icon on StageAll and commit when Filter active #8596 #8730):
    • visual change (just like on StageAll button: icon and ToolTipText changes when Filter is active)
    • behavioural change (to get it consistent with the StageAll button): if the Filter is not empty (i.e. it's active) and UnstageAll is clicked: unstage only those files matching the filter (instead of unstaging everything)

Screenshots

Before

After

StageAll (TooltipText/icon) - with filefilter:
Before: image
After: image

UnstageAll (TooltipText/icon) - with filefilter:
Before: image
After: image

OnCommitClick (message) - with filefilter:
Before: image
After: image

Test methodology

  • change of text in the MessageBox on Commit: Manual
  • change of ToolTipText on StageAll/UnstageAll buttons: Manual and IntegrationTest
  • change of StageAll/UnstageAll button-picture: Manual
  • change of UnstageAll behaviour: Manual and IntegrationTest

Test environment(s)

  • GIT 3.4.2.9999+
  • GIT 2.30.0.windows.1
  • Windows 10 20H2

✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned keco2 Jan 8, 2021
@codecov
Copy link

codecov bot commented Jan 8, 2021

Codecov Report

Merging #8731 (81c4612) into master (892ce08) will increase coverage by 0.39%.
The diff coverage is 78.07%.

@@            Coverage Diff             @@
##           master    #8731      +/-   ##
==========================================
+ Coverage   55.74%   56.13%   +0.39%     
==========================================
  Files         900      900              
  Lines       64990    65103     +113     
  Branches    11739    11808      +69     
==========================================
+ Hits        36226    36545     +319     
+ Misses      25911    25650     -261     
- Partials     2853     2908      +55     
Flag Coverage Δ
production 43.27% <92.10%> (+0.50%) ⬆️
tests 94.80% <71.05%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@keco2
Copy link
Contributor Author

keco2 commented Jan 8, 2021

Btw, the icon with funnel - I'm open to suggestions - if it is not that good. I've created just using VS picture editor. Maybe someone has idea how to do it better.

I've tried funnel on: top-left / bottom-left / bottom-right :
image

Currently the B (bottom-left) is implemented (I think the A is a no-go as the arrows are less visible so).

@keco2 keco2 marked this pull request as draft January 8, 2021 17:26
@keco2 keco2 force-pushed the feature/issue8596_stageall branch from 0e82fa3 to 5314665 Compare January 8, 2021 18:38
@pmiossec
Copy link
Member

pmiossec commented Jan 8, 2021

Currently the funnel-down is implemented (because I think the arrows are more visible so).

I think bottom right would be better. What do you think?

@keco2
Copy link
Contributor Author

keco2 commented Jan 8, 2021

I've updated the picture with that option. I still like the B version a bit more :) but the C is Ok to me too. Let's wait for further votes - if no more vote comes, I'll update it with C version! 🥇

@keco2 keco2 marked this pull request as ready for review January 8, 2021 19:06
@RussKie RussKie added the 📜 status: needs cla The author needs to update contributors.txt before reviewing or merging can proceed label Jan 10, 2021
Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please provide your sign off as well.

GitUI/CommandsDialogs/FormCommit.cs Outdated Show resolved Hide resolved
GitUI/CommandsDialogs/FormCommit.cs Outdated Show resolved Hide resolved
GitUI/CommandsDialogs/FormCommit.cs Outdated Show resolved Hide resolved
GitUI/UserControls/FileStatusList.cs Outdated Show resolved Hide resolved
UnitTests/CommonTestUtils/ReferenceRepository.cs Outdated Show resolved Hide resolved
@ghost ghost added 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity and removed 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity labels Jan 10, 2021
@keco2
Copy link
Contributor Author

keco2 commented Jan 11, 2021

Great, thank you for the review! I've pushed the changes!

Please provide your sign off as well.

Done. Separate PR.

Currently the funnel-down is implemented (because I think the arrows are more visible so).

I think bottom right would be better.

Bottom right commited as promised ;)

@keco2 keco2 marked this pull request as draft January 11, 2021 15:09
@keco2 keco2 requested a review from RussKie January 11, 2021 18:32
@keco2 keco2 marked this pull request as ready for review January 11, 2021 18:34
@RussKie RussKie added 🖊️ status: cla signed and removed 📜 status: needs cla The author needs to update contributors.txt before reviewing or merging can proceed labels Jan 12, 2021
@RussKie
Copy link
Member

RussKie commented Jan 12, 2021

@msftbot merge in 24 hours

@ghost ghost added the status: auto merge label Jan 12, 2021
@ghost
Copy link

ghost commented Jan 12, 2021

Hello @RussKie!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Wed, 13 Jan 2021 08:43:32 GMT, which is in 1 day

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@@ -967,7 +967,7 @@ private void InitializeComponent()
this.toolStageAllItem.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStageAllItem.Name = "toolStageAllItem";
this.toolStageAllItem.Size = new System.Drawing.Size(23, 23);
this.toolStageAllItem.Text = "Stage All";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be removed here and made sure they are explicitly assigned in init or load
The text is translated twice now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Good point. I can fix it together with the other change below.

@@ -1534,13 +1537,25 @@ private void FileStatusList_Enter(object sender, EventArgs e)
private readonly Subject<string> _filterSubject = new Subject<string>();
[CanBeNull] private Regex _filter;
private bool _filterVisible = false;
private bool _filterActive = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this used?
OnFilterChanged() may fire the event more than once, is that so bad?
(these status variablles are hard to maintain, someon else reuses it for a slightly separate use case or add a parallel variable...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fires on every character added/removed. But you're right, it would be no problem here without it so I can remove that check. Or maybe just rename it to something more meaningful like _filterActiveLastState or _filterActiveCheck? (and sorry for my delayed answer)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure - Which one do you prefer?

  • remove the unnecessary check? or
  • rename to something more meaningful?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer maintainability, so removing the variable if there is no noticeable effect is what I prefer.

@ghost ghost merged commit 20dd691 into gitextensions:master Jan 13, 2021
@ghost ghost added this to the 4.0 milestone Jan 13, 2021
keco2 added a commit to keco2/gitextensions that referenced this pull request Jan 17, 2021
RussKie added a commit that referenced this pull request Jan 18, 2021
Review feedback on PR #8731 (StageAll,UnstageAll)
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants