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

Show progress dialog during startup #9255

Merged
merged 5 commits into from
Apr 2, 2021
Merged

Show progress dialog during startup #9255

merged 5 commits into from
Apr 2, 2021

Conversation

chrdavis
Copy link
Member

@chrdavis chrdavis commented Jan 24, 2021

This change adds a standard shell progress dialog during startup to give feedback to the user that we are gathering all the items that were selected (including items in subfolders). This allows the user to know we are still doing work as well as provide a means to cancel the operation.

image

Applies to #9254

@chrdavis chrdavis linked an issue Jan 24, 2021 that may be closed by this pull request
@github-actions
Copy link

New misspellings found, please review:

  • IProgress
  • MARQUEEPROGRESS
  • PROGDLG
  • sppd
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"HKE QWORD Runtimes Segoe "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"IProgress MARQUEEPROGRESS PROGDLG qword runtimes segoe sppd "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@htcfreek
Copy link
Collaborator

@chrdavis
Can you chage the word "fixes" to "Applies to". We don't use the wording "fixes" to not auto close the issue.

@chrdavis
Copy link
Member Author

@chrdavis
Can you chage the word "fixes" to "Applies to". We don't use the wording "fixes" to not auto close the issue.

Done

@chrdavis
Copy link
Member Author

Any update on this review?

@enricogior
Copy link
Contributor

@chrdavis
is it expected that the progress dialog stays open for about 1 second after the PowerRename dialog opens?

rename

@chrdavis
Copy link
Member Author

@chrdavis
is it expected that the progress dialog stays open for about 1 second after the PowerRename dialog opens?

rename

The progress dialog should show only after a delay of a few seconds. Perhaps I can wrap this in a better delay of my own on top of that.

@chrdavis
Copy link
Member Author

I updated SmartRename with a progress dialog that takes into account ~ 3s before being shown. I'll let that get downloaded and used then port it here.

@enricogior
Copy link
Contributor

@chrdavis
what should we do with the current PR?

@chrdavis
Copy link
Member Author

@chrdavis
what should we do with the current PR?

I ported the changes. Please review when you get a chance.

@github-actions
Copy link

New misspellings found, please review:

  • IProgress
  • ISmart
  • MARQUEEPROGRESS
  • PROGDLG
  • sppd
  • sppre
  • ULONGLONG
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"HKE Oject QWORD Runtimes Segoe "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"IProgress ISmart MARQUEEPROGRESS PROGDLG qword runtimes segoe sppd sppre ULONGLONG "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@enricogior
Copy link
Contributor

@chrdavis
I tested the updated version and it looks like the progress bar is slowing down the file processing.
I used the repository folders so it's easy to replicate.
When renaming individual folders, it take in total 3-4 seconds.
But when renaming the folders together, the progress bar shows up and it takes over 10 seconds.
The overhead introduced by the progress bar keep increasing for larger folders.
I would guess that the problem is caused by updating the progress bar with the filenames, can the progress bar just show the bar and not the filenames?
Also, it takes about 3 seconds for the progress bar to show, what about lowering to 2 seconds or even 1.5 seconds?

image

@chrdavis
Copy link
Member Author

Updated based on the feedback. The updating of the progress dialog is replaced with a static message now so the slowdown should go away. I also changed the delay from 3s to 1.5s.

@github-actions
Copy link

New misspellings found, please review:

  • IProgress
  • ISmart
  • MARQUEEPROGRESS
  • PROGDLG
  • sppd
  • sppre
  • ULONGLONG
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"HKE Oject QWORD Runtimes Segoe "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"IProgress ISmart MARQUEEPROGRESS PROGDLG qword runtimes segoe sppd sppre ULONGLONG "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@crutkas
Copy link
Member

crutkas commented Feb 24, 2021

@enricogior any reason why this can't be in?

@enricogior
Copy link
Contributor

@crutkas
it is still not working for me, after the last change, the progress dialog appears after the PowerRename dialog is shown.

@chrdavis
Copy link
Member Author

@crutkas
it is still not working for me, after the last change, the progress dialog appears after the PowerRename dialog is shown.

Really? Can you post a gif?

@chrdavis
Copy link
Member Author

I just updated the timeout from 1500ms to 2500ms. Originally it was 3000ms.

@enricogior
Copy link
Contributor

@chrdavis
this was before your last commit:

rename

I'll rebuild it and test it again

@github-actions
Copy link

New misspellings found, please review:

  • IProgress
  • ISmart
  • MARQUEEPROGRESS
  • PROGDLG
  • sppd
  • sppre
  • ULONGLONG
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"HKE Oject QWORD Runtimes Segoe "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"IProgress ISmart MARQUEEPROGRESS PROGDLG qword runtimes segoe sppd sppre ULONGLONG "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@enricogior
Copy link
Contributor

@chrdavis
same behavior using the latest bits:

rename2

@chrdavis
Copy link
Member Author

Yeah, we are competing on the UI thread. I'll need to shuffle some things around. I'll have an update next week.

@chrdavis
Copy link
Member Author

chrdavis commented Mar 2, 2021

Updated once again. Progress UI is now invoked on a background thread. No longer need the delay timer for the progress dialog. Please try this out.

@github-actions
Copy link

github-actions bot commented Mar 2, 2021

New misspellings found, please review:

  • CHECKCANCELED
  • IProgress
  • ISmart
  • MARQUEEPROGRESS
  • PROGDLG
  • prpui
  • sppd
  • sppre
  • TIMERID
To accept these changes, run the following commands
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"HKE Oject QWORD Runtimes Segoe "');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
  if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
  next if /^($re)(?:$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"CHECKCANCELED IProgress ISmart MARQUEEPROGRESS PROGDLG prpui qword runtimes segoe sppd sppre TIMERID "');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a) cmp lc($b)} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;'
git add .github/actions/spell-check || echo '... you want to ensure .github/actions/spell-check/expect.txt is added to your repository...'

@chrdavis
Copy link
Member Author

@crutkas Is this tested and good to go for next release?

@crutkas
Copy link
Member

crutkas commented Mar 30, 2021

@enricogior assuming won't happen for 35 due to time. What needs to happen to review here.

@enricogior
Copy link
Contributor

@crutkas @chrdavis
I'll review it after 0.35 is released.

@enricogior
Copy link
Contributor

@chrdavis
tested, it works as expected, thanks for making it perfectly smooth!

@enricogior enricogior merged commit d128939 into microsoft:master Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-PowerRename Refers to the PowerRename PowerToy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PowerRename should add progress dialog during startup
4 participants