-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Introduce parsed command line text to command palette #8515
Conversation
New misspellings found, please review:
To accept these changes, run the following commands
✏️ Contributor please read thisBy default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.
If the listed items are:
See the 🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The :check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉
|
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 looks great! Thanks!
const auto& commands = appArgs.GetStartupActions(); | ||
if (commands.size() > 0) | ||
{ | ||
std::wstring commandDescription{ RS_(L"CommandPalette_ParsedCommandLine") + L":" }; |
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.
(asking the team) Not too familiar with how localization works, but should we move the :
to the resw?
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.
@DHowett would know for sure, but my guess would be yes, we need to move it to the resw. I'm thinking the resource would need to be
Executing command line will invoke the following commands:{0}
and then we fmt::format
that with the list of generated names (joined with \n\t
)
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 do agree that :
should be there. My idea was not to include {0}
so if we decide to put them in different Runs (e.g. make this caption red or green) we won't need new translation. WDYT?
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, I actually agree with that. We may want the actions to each be a separate run of text for whatever reason.
@msftbot make sure @zadjii-msft signs off on this |
Hello @carlos-zamora! 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:
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". |
@zadjii-msft - do you like it? Do we need someone from the product / accessibility to review it? |
I don't like it. I love it. I just need to find some time to get back to reviewing it. Don't worry, it's the next highest thing on my todo after getting the SUI reviewed. |
Thanks! Not urgent (it is quite standalone). Was asking since I solved it quite quick and dirty, so was wondering if improvements are required 😊 |
Will this conflict with your command palette model changes? |
A bit. But I am not worried 😊 |
So it appears not to conflict with the model change at all. Noice. |
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.
Okay the resources thing is such a nit, but it probably does need to be changed. The rest of this looks great. I'm really glad we got both the error text and the parsed commands into the text block. It's so crisp
if (!commandLine.empty()) | ||
{ | ||
ExecuteCommandlineArgs args{ commandLine }; | ||
::TerminalApp::AppCommandlineArgs appArgs; |
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.
Part of me wonders if the CommandPalette should just keep a single AppCommandlineArgs
instance as a member, and then reset it and re-use it for parsing each time.
That being said, this solution certainly does work
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.
@zadjii-msft - I see your point. I allowed this to myself, since today we do allocate an instance upon every execution. However, now we will actually allocate an instance on every character in the search - so it makes sense to cache it. I will see if there is a good way to reset the instance - since the internal reset we have there now is partial IIRC.
const auto& commands = appArgs.GetStartupActions(); | ||
if (commands.size() > 0) | ||
{ | ||
std::wstring commandDescription{ RS_(L"CommandPalette_ParsedCommandLine") + L":" }; |
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.
@DHowett would know for sure, but my guess would be yes, we need to move it to the resw. I'm thinking the resource would need to be
Executing command line will invoke the following commands:{0}
and then we fmt::format
that with the list of generated names (joined with \n\t
)
} | ||
else | ||
{ | ||
ParsedCommandLineText(RS_(L"CommandPalette_FailedParsingCommandLine") + L":\n\t" + til::u8u16(appArgs.GetExitMessage())); |
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.
Same down here, we should use fmt::format
to add the error text to the resource here.
NoticeFontNotFound
in the TerminalControl
project is a good example
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.
Same as above
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.
Yea this seems better to me, thanks!
<Setter Property="Background" Value="{ThemeResource SystemAltMediumLowColor}" /> | ||
<Setter Property="BorderBrush" Value="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> | ||
</Style> | ||
<Style x:Key="ParsedCommandLineTextBlockStyle" TargetType="TextBlock"> |
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.
spacing looks strange around here.. Sup?
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.
Just a few Qs. This is utterly lovely tho.
{ | ||
ParsedCommandLineText(RS_(L"CommandPalette_FailedParsingCommandLine") + L"\n\t" + til::u8u16(_appArgs.GetExitMessage())); | ||
} | ||
_noMatchesText().Visibility(Visibility::Visible); |
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.
Curious -- we're showing the no matches string all the time now? What's this look like?
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.
@DHowett - I am afraid this might be a leftover.. 🤦 which is hidden by the ParsedCommandLineText... 🤔
Fixing it immediately, after I am finalizing the live search for initial review. Hopefully today (it is already 2am for me 😄)
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.
Yep. It is a leftover. Thanks!
@DHowett - fixed the comments + introduced a vertical scroll bar for the parsed message window in the case the message is too long. Please review :) |
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.
Love it. Love it love it.
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
(Thanks for staying up late to work on our project 😄) |
🎉 Handy links: |
This commit introduces another optional text block in palette that will be shown in the command line mode (above the history). This text block will either contain a list of parsed command lines or a description why the parsing failed Closes microsoft#8344 Closes microsoft#7284
This commit introduces another optional text block in palette that will
be shown in the command line mode (above the history). This text block
will either contain a list of parsed command lines or a description why
the parsing failed
Closes #8344
Closes #7284