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

Preview tab switching with the ATS #7796

Merged
1 commit merged into from
Oct 7, 2020

Conversation

zadjii-msft
Copy link
Member

Summary of the Pull Request

preview-ats-000

This PR enables the ATS to display the active tab as the user navigates the tab switcher. We do this by dispatching the tab switch actions as the user navigates the menu, and manually not focusing the new tab when the tab switcher is open.

References

PR Checklist

Validation Steps Performed

Opened tabs, tabbed through the menu, verified that it did what I'd expect

@zadjii-msft zadjii-msft requested a review from leonMSFT October 1, 2020 11:11
@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 1, 2020
Copy link
Contributor

@leonMSFT leonMSFT left a comment

Choose a reason for hiding this comment

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

This is awesome, thanks for taking it up! 😄

Possibly unrelated to this PR - but I wonder if those same people complaining would also want tab preview when using Tab Search? 🤔 The argument about tab titles being useless still applies there, but perhaps less so.

@zadjii-msft
Copy link
Member Author

I wonder if those same people complaining would also want tab preview when using Tab Search? 🤔 The argument about tab titles being useless still applies there, but perhaps less so.

Oh they very well might, good catch

@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Oct 1, 2020
@ionut-botizan

This comment has been minimized.

@DHowett

This comment has been minimized.

@zadjii-msft

This comment has been minimized.

Comment on lines +131 to +143
void CommandPalette::_selectedCommandChanged(const IInspectable& /*sender*/,
const Windows::UI::Xaml::RoutedEventArgs& /*args*/)
{
if (_currentMode == CommandPaletteMode::TabSwitchMode)
{
const auto& selectedCommand = _filteredActionsView().SelectedItem();
if (const auto& command = selectedCommand.try_as<TerminalApp::Command>())
{
const auto& actionAndArgs = command.Action();
_dispatch.DoAction(actionAndArgs);
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This seems circuitous. TerminalPage is already driving the selection of tabs in the tab switcher, so should we reduce coupling by having TerminalPage do the active terminal change in addition to driving the switching UI?

Maybe having it be in MRU order changes things.

Copy link
Member

Choose a reason for hiding this comment

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

(I'm averse to taking on too many more "are we in mode A, B, C, or D" checks :/)

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.

block for chat

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 7, 2020
@zadjii-msft
Copy link
Member Author

zadjii-msft commented Oct 7, 2020

Chatted with Dustin - yes this seems like extra hoops to jump through right now, but in the future, the Tab Switcher won't just have the list of tabs in the same order as the tabs themselves. The tab switcher might have them in MRU order, or it might be displaying the panes in a tab. In those cases, the page will need to route the action through the switcher, so it makes sense to leave it like this for now.

Further: yes this is a little convoluted for now, but this is a "fix the problem now" kind of changelist, not a "perfect solution" fix. We can work on architectural purity in the future, but let's relieve the user dissatisfaction now.

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 7, 2020
@zadjii-msft zadjii-msft added AutoMerge Marked for automatic merge by the bot when requirements are met and removed Needs-Second It's a PR that needs another sign-off labels Oct 7, 2020
@ghost
Copy link

ghost commented Oct 7, 2020

Hello @zadjii-msft!

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.

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.

@zadjii-msft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@ghost ghost merged commit 22887d7 into master Oct 7, 2020
@ghost ghost deleted the dev/migrie/b/7409-preview-tab-switching branch October 7, 2020 22:49
@mpela81
Copy link
Contributor

mpela81 commented Oct 8, 2020

Hi - I'm getting this when building master after this merge:

4>C:\code\windows-terminal\terminal-original\src\cascadia\TerminalApp\CommandPalette.cpp(135,75): error C2039: 'Command': is not a member of 'winrt::TerminalApp'
4>C:\code\windows-terminal\terminal-original\src\cascadia\TerminalApp\CommandPalette.cpp(20): message : see declaration of 'winrt::TerminalApp'

@carlos-zamora
Copy link
Member

Hi - I'm getting this when building master after this merge:

4>C:\code\windows-terminal\terminal-original\src\cascadia\TerminalApp\CommandPalette.cpp(135,75): error C2039: 'Command': is not a member of 'winrt::TerminalApp'
4>C:\code\windows-terminal\terminal-original\src\cascadia\TerminalApp\CommandPalette.cpp(20): message : see declaration of 'winrt::TerminalApp'

😲 oh no. This seems to have conflicted with my TerminalSettingsModel change. I'll go ahead and fix that right now. Thanks!

carlos-zamora added a commit that referenced this pull request Oct 8, 2020
#7796 and #7667 were being implemented concurrently. As a part of #7667, Command was moved from TermApp to TSM. This just applies that change to a line we missed in #7796 and fixes the build break.
skyline75489 pushed a commit to skyline75489/terminal that referenced this pull request Oct 10, 2020
microsoft#7796 and microsoft#7667 were being implemented concurrently. As a part of microsoft#7667, Command was moved from TermApp to TSM. This just applies that change to a line we missed in microsoft#7796 and fixes the build break.
DHowett pushed a commit that referenced this pull request Oct 19, 2020
## Summary of the Pull Request

![preview-ats-000](https://user-images.githubusercontent.com/18356694/94801728-18302a00-03ac-11eb-851d-760b92ebb46f.gif)

This PR enables the ATS to display the active tab as the user navigates the tab switcher. We do this by dispatching the tab switch actions as the user navigates the menu, and manually _not_ focusing the new tab when the tab switcher is open.

## References

* #6732 - original tab switcher PR
* #6689 - That's a more involved, generic version of this, but this PR will be enough to stop most of the complaints hopefully

## PR Checklist
* [x] Closes #7409
* [x] I work here
* [ ] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

Opened tabs, tabbed through the menu, verified that it did what I'd expect

(cherry picked from commit 22887d7)
@ghost
Copy link

ghost commented Nov 11, 2020

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

Handy links:

@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:

This pull request was closed.
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 AutoMerge Marked for automatic merge by the bot when requirements are met 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.

When selecting a new tab with the tab switcher, preview the selected tab in the Terminal
7 participants