-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
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.
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.
Oh they very well might, good catch |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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); | ||
} | ||
} | ||
} |
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 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.
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'm averse to taking on too many more "are we in mode A, B, C, or D" checks :/)
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.
block for chat
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. |
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 (
|
/azp run |
No pipelines are associated with this pull request. |
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! |
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.
## 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)
🎉 Handy links: |
🎉 Handy links: |
Summary of the Pull Request
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