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

Completely remove action dispatching from Command Palette #8628

Merged
3 commits merged into from
Jan 7, 2021

Conversation

Don-Vito
Copy link
Contributor

@Don-Vito Don-Vito commented Dec 20, 2020

Following up #8586 by @Hegunumo,
fully remove the command dispatching logic from Command Palette.

Currently Command Palette might dispatch command in Tab Switcher mode.
This leads to several inconsistencies:

  • Only the commands with the same key modifier as an ATS anchor will be issued
  • This command will not close the TabSwitcher
    (while commands issued from TerminalPage do).

Implementation details:

  • Pass KeyMapping rather than binding to CommandPalette
  • Use this mapping inside previewKeyDownHandler of ATS to detect
    if previous tab or next tab bindings were engaged.
    No need to handle Ctrl+Tab explicitly anymore -
    it is handled as any other binding.
  • Cleanup the logic in TerminalPage::_SelectNextTab
    that checks if CommandPalette is visible.
    It is not required anymore, as visible palette would intercept the call.
  • Remove dependency of TerminalPage on AppLogic
    that was introduced lately .

@zadjii-msft zadjii-msft self-assigned this Jan 4, 2021
@Don-Vito
Copy link
Contributor Author

Don-Vito commented Jan 7, 2021

@zadjii-msft, @DHowett - bumping this (as a unified bump for all PRs) as the weekend (aka Terminal time) is approaching and I feel somewhat blocked: advancing further in the existing threads feels irrational, and I am not sure if there is a review capacity for additional ones 😊

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 7, 2021

Sorry for the delays, coming back from the holidays is always a diceroll of productivity 😄

(I'm giving Dustin some time to take a look, but I doubt there'll be much contention)

@zadjii-msft zadjii-msft removed their assignment Jan 7, 2021
@zadjii-msft
Copy link
Member

@msftbot merge this in 6 hours

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 7, 2021
@ghost
Copy link

ghost commented Jan 7, 2021

Hello @zadjii-msft!

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:

  • I won't merge this pull request until after the UTC date Thu, 07 Jan 2021 23:08:43 GMT, which is in 6 hours

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".

@Don-Vito
Copy link
Contributor Author

Don-Vito commented Jan 7, 2021

Sorry for the delays, coming back from the holidays is always a diceroll of productivity 😄

(I'm giving Dustin some time to take a look, but I doubt there'll be much contention)

The delays are fine - I just don't want to create too much of a backlog! If you are not worried with me openning additional threads, I will 😊

@DHowett DHowett removed the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 7, 2021
@DHowett
Copy link
Member

DHowett commented Jan 7, 2021

Does this get rid of the ability to activate key bindings while the command palette is open? Like, if it says "Close Application - alt+f4", should the user be able to press alt+f4 to close? There was an a11y bug about that.

Or, did this get fixed by us using a preview handler on TerminalPage?

@Don-Vito
Copy link
Contributor Author

Don-Vito commented Jan 7, 2021

Does this get rid of the ability to activate key bindings while the command palette is open? Like, if it says "Close Application - alt+f4", should the user be able to press alt+f4 to close? There was an a11y bug about that.

Or, did this get fixed by us using a preview handler on TerminalPage?

This was fixed in the original PR, everything that is not mentioned for the internal navigation inside the palette will be routed to terminal page, which in turn will try to resolve the binding.

@DHowett
Copy link
Member

DHowett commented Jan 7, 2021

LOVE IT.

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.

Your attention to detail is, as always, stellar. Thank you.

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 7, 2021
@ghost
Copy link

ghost commented Jan 7, 2021

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 1 hour 45 minutes. No worries though, I will be back when the time is right! 😉

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 (@msftbot) and give me an instruction to get started! Learn more here.

@Don-Vito
Copy link
Contributor Author

Don-Vito commented Jan 7, 2021

Your attention to detail is, as always, stellar. Thank you.

Actually, the lack of practice has its toll and I miss from time to time 😊 Hope my team doesn't see my contributions before your reviews 😄

And thank You - I really enjoy as the team is great and I learn a lot!

@ghost ghost merged commit c4c3c31 into microsoft:main Jan 7, 2021
@ghost
Copy link

ghost commented Jan 28, 2021

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

Handy links:

mpela81 pushed a commit to mpela81/terminal that referenced this pull request Jan 28, 2021
…8628)

Following up microsoft#8586 by @Hegunumo,
fully remove the command dispatching logic from Command Palette.

Currently Command Palette might dispatch command in Tab Switcher mode.
This leads to several inconsistencies:
* Only the commands with the same key modifier as an ATS anchor will be issued
* This command will not close the TabSwitcher 
(while commands issued from TerminalPage do).

Implementation details:
* Pass KeyMapping rather than binding to CommandPalette
* Use this mapping inside previewKeyDownHandler of ATS to detect
if previous tab or next tab bindings were engaged. 
No need to handle Ctrl+Tab explicitly anymore - 
it is handled as any other binding.
* Cleanup the logic in TerminalPage::_SelectNextTab 
that checks if CommandPalette is visible.
It is not required anymore, as visible palette would intercept the call.
* Remove dependency of TerminalPage on AppLogic
that was introduced lately .
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants