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

[Settings/ImageResizer] New UI for sizes listview #12269

Merged
merged 12 commits into from
Jul 26, 2021

Conversation

niels9001
Copy link
Contributor

@niels9001 niels9001 commented Jul 7, 2021

Summary of the Pull Request

Problems resolved:

The new application features text-based UI and a dedicated edit button that provides a fly-out that enables the user to make changes to the selected image size.

Ideally, we'd move to a solution as described here: #2813 (comment). However, due to a blocking XAML Island bug (a ContentDialog does not accept keyboard entry: microsoft/microsoft-ui-xaml#3804) we can not implement that.

Image resizes sizes

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

@htcfreek
Copy link
Collaborator

htcfreek commented Jul 8, 2021

@niels9001
To improve fast visibility I suggest to have the complete size in bold. E.g. 1 x 2 pixel, 50 percent.

@htcfreek
Copy link
Collaborator

htcfreek commented Jul 9, 2021

Should we add a close button?

Is the users asked before deletion?

@Jay-o-Way
Copy link
Collaborator

What about Cancel?

@htcfreek
Copy link
Collaborator

What about Cancel?

I am sure the values will be saved directly. So a cancel button makes no sense.

@Jay-o-Way
Copy link
Collaborator

What about the Add size button: does it use the same fly-out? Asking because of #8698.

@niels9001
Copy link
Contributor Author

@htcfreek @Jay-o-Way a cancel/close button isn't needed for a Flyout since it's light dismissible.

I have added a delete confirmation dialog.

@htcfreek
Copy link
Collaborator

@htcfreek @Jay-o-Way a cancel/close button isn't needed for a Flyout since it's light dismissible.

Will every body know how to close it? 🤔

I have added a delete confirmation dialog.

👍

@htcfreek
Copy link
Collaborator

What about the Add size button: does it use the same fly-out? Asking because of #8698.

What about this, @niels9001 ?

@niels9001
Copy link
Contributor Author

What about the Add size button: does it use the same fly-out? Asking because of #8698.

What about this, @niels9001 ?

I think we should have a default name for a new size to be added.. that's a separate PR IMO and touches core imageresize classes.

@niels9001 niels9001 mentioned this pull request Jul 15, 2021
10 tasks
@github-actions
Copy link

github-actions bot commented Jul 15, 2021

@check-spelling-bot Report

Unrecognized words, please review:

  • toolkitconverters
To accept these unrecognized words as correct, run the following commands

... in a clone of the [email protected]:microsoft/PowerToys.git repository
on the users/niels9001/imageresizerlistviewflyout branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/microsoft/PowerToys/issues/comments/880732437" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u
If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and adding it to the patterns.txt file.

Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

Note that patterns can't match multiline strings.

binary-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

I left one nit regarding the spellchecker.
Other than that, works as intended, but the delete confirmation prompt requires some more work:
image
The buttons have no text for me (perhaps due to dark mode).
Is there a way to show the name of the size we are deleting to be shown in the prompt, as well?

@niels9001
Copy link
Contributor Author

Fixed the spellcheck value and the missing dialog button labels

@htcfreek
Copy link
Collaborator

@niels9001
I agree with @jaimecbernardo that we should show the size name in the message.

@htcfreek
Copy link
Collaborator

@niels9001
Do we really need the size symbol in front of each row? In the format list of color picker we don't have one.

@stefansjfw
Copy link
Collaborator

nit: Should delete prompt by closable on Esc?

@stefansjfw
Copy link
Collaborator

#7043
will be fixed as well once this is merged

@niels9001
Copy link
Contributor Author

deletedialog

@stefansjfw @jaimecbernardo I have replaced the MessageDialog with a ContentDialog. The dialog is now rendered correctly, is closeable with ESC and now includes the image size name in the title. This should address all outstanding feedback :).

@stefansjfw
Copy link
Collaborator

Change looks good now! Nice work!
With few nits (but can be fixed as follow-up):

  • When navigating with keyboard and pressing Add size. focus lands on newly added size, but other size remains highlighted
    image

  • Should we make name and non-0 size mandatory?

Also, build fails with latest commit (master merge). As soon as build fail is fixed, fine by me to be merged

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Needs a little fix.
The rest looks good to me.
Great work!

@Jay-o-Way
Copy link
Collaborator

  • Should we make name and non-0 size mandatory?

Sooner or later, yes. See #8698

@niels9001
Copy link
Contributor Author

niels9001 commented Jul 25, 2021

Change looks good now! Nice work!
With few nits (but can be fixed as follow-up):

  • When navigating with keyboard and pressing Add size. focus lands on newly added size, but other size remains highlighted
    image
  • Should we make name and non-0 size mandatory?

Also, build fails with latest commit (master merge). As soon as build fail is fixed, fine by me to be merged

Fixed the focus issue. Thanks!

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

LGTM!
Great work!

@niels9001 niels9001 merged commit b2a86db into master Jul 26, 2021
@niels9001 niels9001 deleted the users/niels9001/imageresizerlistviewflyout branch July 26, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants