-
Notifications
You must be signed in to change notification settings - Fork 10
Hook up the buttons, and othe UX nits #229
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
Conversation
But enter on the context menu weirdly doesn't work. Somewhere the Command on the context item is set to null. Not sure why
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.
Lots to process here, think I got a handle on some of it to comment on and try out. Will need to go through the PR intro notes again.
Think this is a good follow-up from my comment on the other PR, now that the Command Results can be processed, should we have the default app running result be dismiss over GoHome?
src/modules/cmdpal/Exts/Microsoft.CmdPal.Ext.Shell/Properties/Resources.resx
Outdated
Show resolved
Hide resolved
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "VS has a tendency to delete XAML bound methods over-agressively")] | ||
private void PrimaryButton_Tapped(object sender, TappedRoutedEventArgs e) => | ||
WeakReferenceMessenger.Default.Send<ActivateSelectedListItemMessage>(); |
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.
It was suggested that the WCT could have Behavior helpers for this for simple messages like this. Though not sure if records can be constructed in XAML either (would be nice). Ties into improvements Behaviors need anyway for directly supporting specific events like Tapped
for AOT support anyway, but anyway, just wanted to leave this here for posterity of we could clean these up in the future to make it easier.
} | ||
} | ||
|
||
[System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "VS has a tendency to delete XAML bound methods over-agressively")] |
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 haven't seen this elsewhere, so I'm not sure what's going on with the PT config that's causing this to be flagged. We should investigate later and follow-up as it's weird we need these.
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.
Maybe it's just me configuring the editor code cleanup rules to aggressively? But it definitely constantly deletes any of the XAML bound methods on save. Only way to stop it is like this, or marking the methods as internal
(which is not technically correct)
It's really just an annoyance, but I agree we should get to the bottom of it
{ | ||
@this.Source = eventArgs.Value; | ||
} | ||
@this.Source = eventArgs.Value; |
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.
Ah, thanks, I know we discussed this last week, and I forgot to go back and fix it. 😅
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.
Future note for if we pull this in Toolkit later, is we could have a FallbackSource
property to display when the key lookup returns null here. I don't think we have a scenario for this currently, but just a thought.
{ | ||
CurrentPageViewModel.Filter = FilterBox.Text; | ||
} | ||
} | ||
} | ||
|
||
private void FilterBox_TextChanged(object sender, TextChangedEventArgs e) |
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 thought the PR comment mentioned shortcutting the debouncer somewhere, where am I missing seeing that in the changes?
The debouncer issue you saw is mostly likely the bug that I detected and fixed as part of the improvements I made (including tests) there: CommunityToolkit/Windows#569 - we've just been waiting on some other stuff to push a new update to NuGet out (hopefully in a day or two). Otherwise, you could pull from the MainLatest
feed like we're doing for Labs.
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 just saw the comment in the PR and see that I missed it literally right above here in the Back
space key handle. Yeah, I'm 99% sure this is the issue with the debouncer I fixed. If you hit Escape vs. backspace it should be fine as it's a different codepath.
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.
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.
woah what
@niels9001 any ideas?
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.
Yeah, we might have a few hardcoded heights. Will tackle that in a separate PR once this gets in.
This was originally based off `dev/migrie/f/ux-nits`, which is #229 * Adds support for our `win+ctrl+.` global hotkey again. * Makes our window a transient toolwindow. It doesn't show up in alt+tab. It can only be summoned with the hotkey * Unless you're debugging, because that's an absolute chore * Manually makes Quit visible as a command. Quit is usually a fallback command, but I implemented that _right after this commit_. However, I _believe_ the fallback commands need #224 to merge, whereas this subset of deltas didn't exactly Closes #136
oh my god that's why it acts like that! It definitely should be dismiss 🤦 done in 0b00cdc |
…Resources.resx Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]>
…sft/powertoys into dev/migrie/f/ux-nits-pr
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.
Small final clean-up comment
} | ||
|
||
public void ClearSearch() => this.FilterBox.Text = string.Empty; |
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.
This doesn't have to be public anymore, eh? Should we just move the line into the Receive body for GoHome?
@@ -62,6 +62,6 @@ internal async Task Launch() | |||
public override CommandResult Invoke() | |||
{ | |||
_ = Launch(); | |||
return CommandResult.GoHome(); | |||
return CommandResult.Dismiss(); |
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.
nit: should we clean up the file name -- 'AppAction' made sense in Wox land as Wox has actions, but since we are aiming for command palette vibes, probably should be AppCommand.cs
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.
We need to make a pass over a lot more than just this file - definitely better to do in a separate PR
|
||
namespace Microsoft.CmdPal.Ext.WindowsServices; | ||
|
||
internal sealed partial class ServicesListPage : DynamicListPage | ||
{ | ||
public ServicesListPage() | ||
{ | ||
Icon = new(string.Empty); | ||
Icon = new("%windir%\\system32\\filemgmt.dll"); |
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 don't know why this line gives me a lot of joy.
/// <summary> | ||
/// Used to perform a list item's secondary command when the user presses ctrl+enter in the search box | ||
/// </summary> | ||
public record ActivateSecondaryCommandMessage |
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.
Is this just a to do?
/// Used to perform a list item's secondary command when the user presses ctrl+enter in the search box | ||
/// </summary> | ||
public record OpenContextMenuMessage | ||
{ |
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.
What are the purposes of all the messages? Looks like all the bodies are empty -- what do we use these for?
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.
oh I guess this is referred to elsewhere -- not sure exactly what for
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.
@joadoumie these represent the objects of the messages themselves that get passed to the MVVM Toolkit Messenger we use to do communication across components/layers of the application. Many of them don't have extra parameters, like this one, and are just a signal that some event has happened. In this case, it's a request to open the context menu. It's coming from the keyboard handlers in the searchbox (iirc) in order to trigger opening the menu in the ActionBar as they're two independent UI controls now.
@this.FilterBox.Text = page.Filter; | ||
@this.FilterBox.Select(@this.FilterBox.Text.Length, 0); |
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.
what is the @ decorator for?
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.
this
is a keyword in C# normally, but this is a static method as it's the callback from the dependency property where we don't have the specific instance of our class, that's passed in as the first parameter, so we do a cast on line 46 and make our own reference to "this". But since it's a keyword, we use the @
declarator to tell C# that we really want to use this as our variable name, basically it's a C# syntax feature to let you use keywords like this
, class
, etc... as variable names.
It's not that common, and probably not the best to use in many cases, but here is kind of a special case as we really are trying to refer to our own class here, we're just in a static method.
However, it's really just temporary, as when the DependencyProperty source generators come out of Toolkit Labs, then the DP declaration here can all be replaced with a nice source generator which will call a method for us on our class instance, so we'll already have our regular context and won't need this
at all. 😊
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.Unrecognized words (169)
These words are not needed and should be removedaccctrl aclapi appdata Appium appmodel atlbase atlcom atlfile atlstr BODGY bootstrapper caniuse ceq cguid Cmds cne codicon comdef commandline commctrl commdlg comutil consts CRSEL crx dcommon dcomp DCs desktopwindowxamlsource devpkey dxgidebug dxgiformat emmintrin Emoji endpointvolume evntrace exdisp Functiondiscoverykeys guiddef hinstance hstring Infotip Intelli junja Knownfolders lmcons LONGLONG lpt LTRB mfapi mfidl mfobjects mftransform Minimatch mmdeviceapi mmsystem msedge msiquery newdev nodoc notlike Objbase objidl pathcch Pnp Preinstalled processthreadsapi propkey propvarutil redistributable Renamer reparse restrictederrorinfo roadmap ruleset runtimes shellapi shellscalingapi shldisp shlobj stl strsafe strutil subquery SWC tailwindcss tapp thumbcache tlhelp Toolset touchpad Tsd uninstantiated uniquifier Unknwn unregistering urlmon USERDATA Uxtheme verrsrc VKey wcautil WIC wincodec Wincodecsdk windef windowsapp windowsx winerror winevt winsdkver winternl wsl wtsapiSome files were automatically ignored 🙈These sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct, update file exclusions, and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the [email protected]:zadjii-msft/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.24/apply.pl' |
perl - 'https://github.com/zadjii-msft/PowerToys/actions/runs/12392808294/attempts/1'
OR To have the bot accept them for you, comment in the PR quoting the following line: Forbidden patterns 🙅 (7)In order to address this, you could change the content to not match the forbidden patterns (comments before forbidden patterns may help explain why they're forbidden), add patterns for acceptable instances, or adjust the forbidden patterns themselves. These forbidden patterns matched content: Should be
|
❌ Errors | Count |
---|---|
1 | |
ℹ️ candidate-pattern | 2 |
❌ check-file-path | 669 |
❌ forbidden-pattern | 14 |
1 |
See ❌ Event descriptions for more information.
If the flagged items are 🤯 false positives
If items relate to a ...
-
binary file (or some other file you wouldn't want to check at all).
Please add a file path to the
excludes.txt
file matching the containing file.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). -
well-formed pattern.
If you can write a pattern that would match it,
try adding it to thepatterns.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.
targets #224
A big collection of UX nits.
enter
nowctrl+enter
will do the secondary command nowctrl+k
will open the context menu nowCurrentPageViewModel.Filter = FilterBox.Text
when the filterbox backspaces to a single character. IIRC there's a bug in the debouncer upstream, but I had no patience for that