-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Enable moving back to the root level in the command palette #8051
Conversation
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.
Thanks for throwing this together! I think when I was envisioning this, I was imagining it less as "use backspace to go up a level", but more as an actual button to go up a level. I don't know about other users, but I'm definitely the type of person to just mash the Bksp key when I want to clear out the input, usually far more than is actually needed. I think I pictured something like this:
And clicking on the <
would take you up the level.
This is the mockup code I had in XAML Studio:
<StackPanel Orientation="Horizontal"
Padding="16, 0, 16, 4"
Grid.Row="1">
<FontIcon
FontSize="12"
FontFamily="Segoe MDL2 Assets"
Glyph="">
</FontIcon>
<TextBlock
Padding="16, 0, 16, 4"
x:Name="_parentCommandText"
FontStyle="Italic"
Visibility="Visible"
Text="New tab with...">
</TextBlock>
</StackPanel>
I will fix to just clicking on the <, I included parentCommandName as well. |
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.
I think I was expecting something more like
<StackPanel Orientation="Horizontal"
Padding="16, 0, 16, 4"
Grid.Row="1"
Visibility="{x:Bind ParentCommandName,
Mode=OneWay,
Converter={StaticResource ParentCommandVisibilityConverter}}">
<Button Background="Transparent" x:Name="_parentCommandBackButton" x:Uid="ParentCommandBackButton">
<FontIcon
FontSize="12"
FontFamily="Segoe MDL2 Assets"
Glyph="">
</FontIcon>
</Button>
<TextBlock
Padding="16, 0, 16, 4"
x:Name="_parentCommandText"
FontStyle="Italic"
Grid.Row="1"
Text="{x:Bind ParentCommandName, Mode=OneWay}">
</TextBlock>
</StackPanel>
That way, command palette shouldn't need to futz with editing the text of the parent command to prepend the <
, it should just work. GrantedI've only tested this in XAML Studio, so I'm not positive this will work right.
Also - make sure to add
<data name="ParentCommandBackButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Back</value>
</data>
<data name="ParentCommandBackButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Back</value>
</data>
to the Resources.resw
file, so the button will have a tooltip and appear in UIA
src/cascadia/TerminalApp/App.xaml
Outdated
@@ -1,51 +1,59 @@ | |||
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under |
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.
Weird that these xaml files keep getting reformatted by your editor - mind reverting them?
@@ -2,106 +2,158 @@ | |||
x:Class="TerminalApp.ColorPickupFlyout" |
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.
(revert this one too)
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 think it's something to do with clang format, but I don't know how to fix it.
void CommandPalette::_moveBackButtonClicked (Windows::Foundation::IInspectable const& /*sender*/, | ||
Windows::UI::Xaml::RoutedEventArgs const&) | ||
{ | ||
_searchBox().Visibility(Visibility::Collapsed); |
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 think you'll need to hide the search box then make it re-appear, right?
“Resources.resw file, so the button will have a tooltip and appear in UIA” |
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.
Looks good to me, thanks!
(make sure to run |
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.
Looks good to me.
this should fix the code formatting
@Hegunumo please make sure to run |
Hello @zadjii-msft! 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 (
|
Do I run it right before submit PR or right after forked the repository ? |
You can just run the script locally, then commit & push the changes. The script will auto-format the code for you. This will resolve the "Code Health Scripts Proper Code Formatting Check" check, which will also in turn resolve the "Terminal CI" check. We're also just gonna get rid of the "Lint Code Base" step, because it is incredibly flaky. So don't worry about that. |
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 love it. Thank you!
Eventually we can make it pop the action stack instead of going up to the root, but this is way better than it was 😄 |
🎉 Handy links: |
This commit adds functionality so that users can move back from sub menu
whenever they want. As a result, users no longer have to close command
palette and open it again to get all commands again.
Closes #7910