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

Swap the command palette modes for the prefix > #7935

Merged
merged 3 commits into from
Oct 15, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

VsCode uses > as its "prefix" for the equivalent of their "action mode". This PR aligns the Terminal with their logic here.
cmdpal-swapped-prefix-000

PR Checklist

Detailed Description of the Pull Request / Additional comments

We have to be tricky - if we use the > in the actual input as the indicator for action mode, we can't display any placeholder text in the input to tell users to type a command. This wasn't an issue for the commandline mode previously, because we'd stick the "prompt" in the "no matches text" space. However, we can't do that for action mode. Instead, we'll stick a floating text block over the input box, and when the user's in action mode, we'll manually place a > into that space. When the user backspaces the >, we'll remove it from that block, and switch into commandline mode.

Validation Steps Performed

Played with the cmdpal in lots of different modes, this finally feels good

@ghost ghost added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Terminal The new Windows Terminal. labels Oct 15, 2020
@@ -396,6 +397,9 @@
<data name="TabSwitcher_NoMatchesText" xml:space="preserve">
<value>No matching tab name</value>
</data>
<data name="CmdPalActionPrompt" xml:space="preserve">
<value>Type a command name...</value>
Copy link
Member

Choose a reason for hiding this comment

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

Little sad that we need to force a re-localization for this key change

Copy link
Member

Choose a reason for hiding this comment

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

Since we are already not using a uid for the search box, can we just keep the key names and juggle them different at runtime?

Copy link
Member Author

Choose a reason for hiding this comment

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

I dont see why not. I think this was originally from the first way I tried implementing this, which was a bust.

Does the localization happen multiple times per release? I figured it happened once per release, right before we released

Copy link
Member

@DHowett DHowett Oct 15, 2020

Choose a reason for hiding this comment

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

We've got a scheduled job that submits strings at 6pm pacific every day 😄

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

Be sure to coordinate with @cinnamon-msft on updating the docs. I think the schema doesn't need updating though, so that's good.

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Love it!

@DHowett DHowett changed the title Swap the CmdPal Modes for the prefix > Swap the command palette modes for the prefix > Oct 15, 2020
@DHowett DHowett merged commit bd7cd55 into master Oct 15, 2020
@DHowett DHowett deleted the dev/migrie/f/7736-swap-cmdpal-modes branch October 15, 2020 22:58
@ghost
Copy link

ghost commented Nov 11, 2020

🎉Windows Terminal Preview v1.5.3142.0 has been released which incorporates this pull request.:tada:

Handy links:

ghost pushed a commit that referenced this pull request Nov 16, 2020
Fixes the clear button to clear the typed command not clickable in the
command palette.

- From the primary investigation it looked like the `TextBlock` element
  introduced in #7935 was somehow blocking (appearing on top of) the
  clear button.
- It was also blocking the command palette input field from being able
  to access which was preventing the text in the input field from being
  selected and the cursor would still show as `pointer` cursor instead
  of a `text selection` cursor
- Adding `HorizontalAlignment="Left"` property to the above-mentioned
  `TextBlock` element fixed the issue.

## Validation Steps Performed
- Created the Dev build for `x64` in Visual Studio and verified the
  functionality manually.

Closes #8220
DHowett pushed a commit that referenced this pull request Nov 20, 2020
Fixes the clear button to clear the typed command not clickable in the
command palette.

- From the primary investigation it looked like the `TextBlock` element
  introduced in #7935 was somehow blocking (appearing on top of) the
  clear button.
- It was also blocking the command palette input field from being able
  to access which was preventing the text in the input field from being
  selected and the cursor would still show as `pointer` cursor instead
  of a `text selection` cursor
- Adding `HorizontalAlignment="Left"` property to the above-mentioned
  `TextBlock` element fixed the issue.

## Validation Steps Performed
- Created the Dev build for `x64` in Visual Studio and verified the
  functionality manually.

Closes #8220

(cherry picked from commit a8f3f58)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Command Palette: Action and command line mode in relation to char >
3 participants