Skip to content

CmdPal: Primary command missing in context menu when initial command or command name is null #46129

@jiripolasek

Description

@jiripolasek

Microsoft PowerToys version

0.97

Installation method

Dev build in Visual Studio

Area(s) with issue?

Command Palette

Steps to reproduce

When an extension's CommandItem initially uses a command with empty name (invisible) and later switches to a concrete command with a non-empty name, the primary command never appears in the context menu's AllCommands list:

  • SlowInitializeProperties() gates creation of _defaultCommandContextItemViewModel on !string.IsNullOrEmpty(model.Command?.Name);
  • when the name is empty at that point, no primary command entry is created;
  • later, when the extension sets a real command, FetchProperty("Command") only updates the existing _defaultCommandContextItemViewModel via null-conditional ?. - a silent no-op when it's null;
  • no code path ever creates it after SlowInitializeProperties().

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Upload Bug Report ZIP-file

No response

Additional Information

No response

Other Software

No response

Metadata

Metadata

Assignees

Labels

Issue-BugSomething isn't workingNeeds-TriageFor issues raised to be triaged and prioritized by internal Microsoft teamsProduct-Command PaletteRefers to the Command Palette utilityStatus-In progressThis issue or work-item is under development

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions