-
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
Give Tab ownership of its SwitchToTab command #7659
Conversation
namespace TerminalApp | ||
{ | ||
[default_interface] runtimeclass Tab : Windows.UI.Xaml.Data.INotifyPropertyChanged | ||
{ | ||
String Title { get; }; | ||
Windows.UI.Xaml.Controls.IconSource IconSource { get; }; | ||
Command SwitchToTabCommand { get; }; | ||
UInt32 TabViewIndex { get; }; |
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.
feel free to just call this "Index"
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 cool with this. I prefer it over the design where the command listens to the tab, for sure.
Eventually, this may help us disentangle the "command"-based nature of switching? 😄
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.
You're amazing. Thanks!
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.
Apparently Ctrl+Enter does not approve...
Currently, `CommandPalette` creates and maintains the `SwitchToTab` commands used for the ATS. When `Command` goes into the TerminalSettingsModel, the palette won't be able to access `Command`'s implementation type, making it difficult for `CommandPalette` to tell `Command` to listen to `Tab` for changes. This PR changes the relationship up so `Tab` now manages its `SwitchToTab` command, and `CommandPalette` just plops the command from `Tab` into its list. (cherry picked from commit 468c8c6)
Currently,
CommandPalette
creates and maintains theSwitchToTab
commands used for the ATS. When
Command
goes into theTerminalSettingsModel, the palette won't be able to access
Command
'simplementation type, making it difficult for
CommandPalette
to tellCommand
to listen toTab
for changes.This PR changes the relationship up so
Tab
now manages itsSwitchToTab
command, andCommandPalette
just plops the command fromTab
into its list.