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

Give Tab ownership of its SwitchToTab command #7659

Merged
merged 4 commits into from
Sep 18, 2020
Merged

Conversation

leonMSFT
Copy link
Contributor

@leonMSFT leonMSFT commented Sep 17, 2020

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.

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; };
Copy link
Member

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"

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.

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? 😄

@DHowett DHowett added the Needs-Second It's a PR that needs another sign-off label Sep 17, 2020
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.

You're amazing. Thanks!

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.

Apparently Ctrl+Enter does not approve...

@DHowett DHowett merged commit 468c8c6 into master Sep 18, 2020
@DHowett DHowett deleted the dev/lelian/tab2command branch September 18, 2020 00:13
DHowett pushed a commit that referenced this pull request Oct 27, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Second It's a PR that needs another sign-off
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants