-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Make Tab an unsealed runtimeclass (and rename it to TabBase) #8153
Conversation
In preparation for the Settings UI, we needed to make some changes to Tab to abstract out shared, common functionality between different types of tab. This is the result of that work. All code references to the settings have been removed or reverted. Contains changes from #8053, #7802. The messages below only make sense in the context of the Settings UI, which this pull request does not bring in. They do, however, provide valuable information. From #7802 (@leonMSFT): > This PR's goal was to add an option to the `OpenSettings` keybinding to > open the Settings UI in a tab. In order to implement that, a couple of > changes had to be made to `Tab`, specifically: > > - Introduce a tab interface named `ITab` > - Create/Rename two new Tab classes that implement `ITab` called > `SettingsTab` and `TerminalTab` > From #8053: > `TerminalTab` and `SettingsTab` share some implementation details. The > close submenu introduced in #7728 is a good example of functionality > that is consistent across all tabs. This PR transforms `ITab` from an > interface, into an [unsealed runtime class] to de-duplicate some > functionality. Most of the logic from `SettingsTab` was moved there > because I expect the default behavior of a tab to resemble the > `SettingsTab` over a `TerminalTab`. > > ## References > Verified that Close submenu work was transferred over (#7728, #7961, #8010). > > ## Validation Steps Performed > Check close submenu on first/last tab when multiple tabs are open. > > Closes #7969 > > [unsealed runtime class]: https://docs.microsoft.com/en-us/uwp/midl-3/intro#base-classes Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
I was one of the two signoffs on both of these pull requests, so I will merge this if @zadjii-msft, @miniksa or @PankajBhojwani sign off. Highly preferable that it's @zadjii-msft. @carlos-zamora and @leonMSFT do not count. |
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 okay with this.
I think in the future, it'd be better to have it all be a uniform Tab
with non-terminal panes, but we can work towards that from this. SUI is way higher priority now anyways.
if (auto index{ _GetFocusedTabIndex() }) | ||
{ | ||
auto focusedTab{ _GetStrongTabImpl(*index) }; | ||
_UnZoomIfNeeded(); | ||
focusedTab->ResizePane(direction); | ||
if (auto terminalTab = _GetTerminalTabImpl(_tabs.GetAt(*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.
There's a lot of this if (get focused tab index) { if (get tab from index) { tab.doSomething() } }
going on in here. Would it be better to have a helper that just does it all in one go?
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’d rather not add that now to reduce the merge burden when this flows back into SUI (since right now i can use the “take all ours
” strategy), but it is worth doing.
[default_interface] runtimeclass Tab : Windows.UI.Xaml.Data.INotifyPropertyChanged | ||
{ | ||
String Title { get; }; | ||
Windows.UI.Xaml.Controls.IconSource IconSource { 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.
So just as a sanity check, IconSource
wasn't actually being used anywhere, was it?
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.
On account of it compiles and runs fine without IconSource, I am inclined to say yes.
@msftbot merge this in about 1 minute |
Hello @DHowett! 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:
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". |
Oh right, bot don't merge single signoff PRs |
lol I was just about to 2nd this. |
In preparation for the Settings UI, we needed to make some changes to
Tab to abstract out shared functionality common between different types
of tab. This is the result of that work. All code references to the
settings have been removed or reverted.
Contains changes from #8053, #7802.
The messages below only make sense in the context of the Settings UI,
which this pull request does not bring in. They do, however, provide
valuable information.
From #7802 (@leonMSFT):
From #8053:
Co-authored-by: Carlos Zamora carlos.zamora@microsoft.com