[CmdPal] Add host-driven navigation (GoToPageAsync on IExtensionHost2) - #49442
Draft
michaeljolley wants to merge 2 commits into
Draft
[CmdPal] Add host-driven navigation (GoToPageAsync on IExtensionHost2)#49442michaeljolley wants to merge 2 commits into
michaeljolley wants to merge 2 commits into
Conversation
Phase 3 of the built-in Command Palette auth feature. Lets an extension ask the host to navigate Command Palette to one of the extension's own pages, typically right after a successful sign-in. - SDK IDL: add GoToPageAsync(ICommand page, NavigationMode navigationMode) to IExtensionHost2 (contract v1, no version bump). - Host: implement AppExtensionHost.GoToPageAsync by reusing the existing nav pipeline via PerformCommandMessage with ShowWindowIfPage, preceded by GoHome/GoBack messages for those modes. Null page is a graceful no-op. - Toolkit: add ExtensionHost.GoToPageAsync and SupportsNavigation, mirroring the RequestAuthorizationAsync / SupportsAuthorization helper. - Tests: Toolkit fake-host tests (capability, NotSupported, ArgumentNull, arg forwarding) and host ViewModels tests asserting the right messages are sent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ee31cb3-848f-43ba-ac48-f4e4485baa33
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2ee31cb3-848f-43ba-ac48-f4e4485baa33
zadjii-msft
requested changes
Jul 22, 2026
zadjii-msft
left a comment
Member
There was a problem hiding this comment.
hard disagree with giving the ability for 3p apps to change the visibility and navigation state of cmdpal without being driven by user interaction.
Sure, it can be used for good, but if this exists, it'll immediately be abused by apps. They could freely just summon the cmdpal window whenever they want. They can navigate to their extension whenever, even if the user isn't doing something. The opportunity for abuse is far too ripe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 3 of the built-in Command Palette auth feature: host-driven navigation. An extension can ask Command Palette to navigate to one of its own pages (typically right after a successful sign-in) via a new
GoToPageAsyncmember on the existingIExtensionHost2interface. There is noIExtensionHost3; the whole feature ships as one atomic stack, so the method lives on the sameIExtensionHost2that carriesRequestAuthorizationAsync.Changes
Windows.Foundation.IAsyncAction GoToPageAsync(ICommand page, NavigationMode navigationMode)toIExtensionHost2(contract v1, no version bump;NavigationModeenum already existed).AppExtensionHost.GoToPageAsync): reuse the existing navigation pipeline. Send aPerformCommandMessagewithShowWindowIfPage = true(which foregrounds the window and navigates when the command is a page), preceded byGoHomeMessage/GoBackMessagefor the GoHome / GoBack modes. A null page is a graceful no-op.ExtensionHost): addGoToPageAsync(ICommand page, NavigationMode navigationMode = NavigationMode.Push)andSupportsNavigation => Host is IExtensionHost2, mirroring the existingRequestAuthorizationAsync/SupportsAuthorizationhelper (NotSupportedExceptionon legacy host,ArgumentNullExceptionon null; AOT/trim safe).NotSupportedException,ArgumentNullException, arg forwarding) plus host ViewModels tests asserting the correct messages are sent for Push / GoHome / GoBack and that a null page sends nothing.Validation
build.ps1 -Path src\modules\cmdpal -Platform x64 -Configuration Debugexit code 0.*.UnitTestsrun with zero failures (WindowWalker is an empty placeholder project with no tests).Stacked on
dev/mjolley/cmdpal-auth-broker(Phase 2). Draft.