Skip to content

Plumb through should activate#45641

Merged
davidwengier merged 5 commits intodotnet:masterfrom
davidwengier:PlumbThroughShouldActivate
Jul 8, 2020
Merged

Plumb through should activate#45641
davidwengier merged 5 commits intodotnet:masterfrom
davidwengier:PlumbThroughShouldActivate

Conversation

@davidwengier
Copy link
Member

@davidwengier davidwengier commented Jul 3, 2020

The platform added a ShouldActivate flag in 16.5 but we weren't honouring it.

Fixes AB#1048288

Because this option maps to the DoNotActivate flag in VS, setting the option to true doesn't actually do anything, but setting it to false aggressively blocks activation, so I've changed the default for the option to true. This means by default navigation is left to VS, and turning this option off will set the DoNotActivate flag.

I've tested all of the places where IDocumentNavigationService is used and all functioned as I would expect. Call Hierarchy was the odd one out that changed behaviour so I've also modified that.

@davidwengier davidwengier requested a review from a team as a code owner July 3, 2020 07:14
@jmarolf
Copy link
Contributor

jmarolf commented Jul 6, 2020

@davidwengier looks like the nav bar integration tests implicitly relied on the olde behavior?

@davidwengier
Copy link
Member Author

davidwengier commented Jul 6, 2020

looks like the nav bar integration tests implicitly relied on the olde behavior?

No, this change broke the nav bar.

The ActivateTab option defaults to false, but it maps to the platform NoActivate flag which defaults to not being set, so there is essentially a double negative. This used to work because ActivateTab was only checked for provisional tabs but I don't believe that restriction makes sense. I think we can change the default for ActivateTab to true now that the platform tells us explicitly what to do for table navigations.

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

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

seems good to me, just one question on behavior

var state = __VSNEWDOCUMENTSTATE.NDS_Provisional;
var state = options.GetOption(NavigationOptions.PreferProvisionalTab)
? __VSNEWDOCUMENTSTATE.NDS_Provisional
: __VSNEWDOCUMENTSTATE.NDS_Permanent;
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 like a slight change in behavior, but I'm not sure it matters

Previously, it seems like permanent tabs will always be activated (or not not activated), but now we can have a permanent tab created but not activated. Does that case ever exist?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's definitely a change, the reasoning is simply to copy the platform code here, and because my reading of the documentation doesn't tie the NoActivate flag to provisional in any way.

I don't know if there is a scenario now where permanent tabs should be not activated, but it's possible something, now or in the future, passes a TableEntryNavigateEventArgs with isPreview and shouldActivate both set to false.

Copy link
Contributor

Choose a reason for hiding this comment

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

This aligns with my understand of how we should ingest the shouldActivate from the platform. Before we only cared about activation for provisional because there were no cases where we wouldn't activate. The platform has changed that assumption though, and we're going to honor that flag. It is a little odd that they tell us what they expect us to tell them, but there's more nuances there.

@davidwengier
Copy link
Member Author

@ryzngard Looks like you added the ActivateProvisionalTab that I'm changing here, quite recently. Could you take a look and confirm this isn't going to regress anything you know of.

@davidwengier davidwengier merged commit bbdcb30 into dotnet:master Jul 8, 2020
@ghost ghost added this to the Next milestone Jul 8, 2020
@davidwengier davidwengier deleted the PlumbThroughShouldActivate branch July 8, 2020 22:31
@JoeRobich JoeRobich modified the milestones: Next, 16.8.P1 Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants