Skip to content

CmdPal: Fix "Open Command Palette" dock item#49095

Merged
michaeljolley merged 2 commits into
microsoft:mainfrom
jiripolasek:feature/49089-cmdpal-fix-open-command-palette-dock-item
Jul 8, 2026
Merged

CmdPal: Fix "Open Command Palette" dock item#49095
michaeljolley merged 2 commits into
microsoft:mainfrom
jiripolasek:feature/49089-cmdpal-fix-open-command-palette-dock-item

Conversation

@jiripolasek

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This PR fixes the "Open Command Palette" dock item.

Dock only opens Command Palette for page commands (see DockControl.InvokeItem). The recent dock home change introduced GoHomeDockCommand as an invokable command, so the Palette no longer opened from the dock item.

  • Restores dock home to use the shared root page.
  • Adds a deferred root page accessor to avoid DI cycles.

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

DockControl only opens Command Palette for page commands. The recent dock home change introduced GoHomeDockCommand as an invokable command, so the Palette no longer opened from the dock item.

- Restore dock home to use the shared root page.
- Add a deferred root page accessor to avoid DI cycles.
@jiripolasek jiripolasek requested a review from michaeljolley July 2, 2026 23:21
@github-actions github-actions Bot added the Product-Command Palette Refers to the Command Palette utility label Jul 2, 2026
@michaeljolley

Copy link
Copy Markdown
Contributor

I don't think I'm understanding why this complexity is needed. When I click the cmdpal "button" on the dock, cmdpal opens and goes home. What am I missing?

@jiripolasek

Copy link
Copy Markdown
Collaborator Author

I don't think I'm understanding why this complexity is needed. When I click the cmdpal "button" on the dock, cmdpal opens and goes home. What am I missing?

DockControl.IsPageCommand returns false for GoHomeDockCommand, which prevents it from showing the Palette:

private static bool IsPageCommand(ICommand? command)
{
// A Page command is one that's not directly invokable - selecting it
// navigates into a page rather than performing an action in place.
return command is not null and not IInvokableCommand;
}

if (IsPageCommand(command.Model.Unsafe))
{
WeakReferenceMessenger.Default.Send<RequestShowPaletteAtMessage>(new(pos, hwnd));
}

We can either add an exception for this, add a new message, or revert to using the main list page as a command. IIRC, that was the original solution.


cd7465e removed dependency on the root page to avoid circular dependency (see commit description):

  • Circular DI dependency resolved: BuiltInsCommandProvider no onger depends on IRootPageService. Previously, it required the IRootPageService solely for the dock command to open Command Palette (using the RootPage as its command.) Now, it uses a new GoHomeDockCommand which returns CommandResult.GoHome() with the existing onBeforeShowConfirmation callback to show the palette at the dock button position.

@michaeljolley michaeljolley left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One nit, otherwise 👍🏼

Comment thread src/modules/cmdpal/Microsoft.CmdPal.UI/App.xaml.cs Outdated
@jiripolasek jiripolasek requested a review from michaeljolley July 8, 2026 12:46
@michaeljolley michaeljolley merged commit 99d01dc into microsoft:main Jul 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: Open Command Palette dock button is not working

2 participants