Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3905d8e
CmdPal: Add support for commands with parameters
ChaseKnowlden Apr 9, 2026
2393594
Revert "CmdPal: Add support for commands with parameters"
ChaseKnowlden Apr 11, 2026
7d04129
this didn't work and no one knows why
zadjii-msft Aug 6, 2025
37fff2c
oh god oh god what have i done
zadjii-msft Aug 7, 2025
5719ca8
not this
zadjii-msft Aug 7, 2025
01fa058
Revert "not this"
zadjii-msft Aug 7, 2025
7e25057
stupid levels returning to nominal values
zadjii-msft Aug 8, 2025
1d871a1
more spec cleanup
zadjii-msft Aug 8, 2025
e93121b
really VS really
zadjii-msft Aug 8, 2025
6df2d32
rename; use IDictionary instead of IPropertySet
zadjii-msft Aug 11, 2025
fdd3eca
Revert "more updates"
zadjii-msft Aug 13, 2025
9b59484
Reapply "more updates"
zadjii-msft Aug 13, 2025
be0d5a9
this feels like i'm getting somewhere
zadjii-msft Sep 5, 2025
03e222a
i hate this I think
zadjii-msft Sep 8, 2025
668eb44
I kinda like this?
zadjii-msft Sep 8, 2025
8c5c9c3
a lot of notes here. Maybe we should write real code now
zadjii-msft Sep 12, 2025
5a91530
code that compiles
zadjii-msft Sep 12, 2025
405ed15
Wire it up to the UI, painfully, but it works
zadjii-msft Sep 12, 2025
b3341d9
Alright now, wasn't that fun? Let's try something else
zadjii-msft Sep 12, 2025
9369670
Make some things observable
zadjii-msft Sep 13, 2025
a3d68a2
wire everything up for buttons
zadjii-msft Sep 13, 2025
8a382d6
more observable
zadjii-msft Sep 14, 2025
0e02a2d
react as soon as the text changes
zadjii-msft Sep 14, 2025
f5fb3dd
once agagin, i am asking to support actions
zadjii-msft Sep 14, 2025
8a2fd4d
Debug printing actions
zadjii-msft Sep 15, 2025
3ff1c97
add a photo picker
zadjii-msft Sep 15, 2025
eb98e47
add a tag for LLM slop
zadjii-msft Sep 15, 2025
42f8156
focuses search slightly better
zadjii-msft Sep 15, 2025
e7f3c1a
one fewer focus
zadjii-msft Sep 15, 2025
cabb0ed
Focus the next param on enter
zadjii-msft Sep 22, 2025
f4a8f6a
spec updates
zadjii-msft Sep 22, 2025
8f5b766
there's no way that just works, right?
zadjii-msft Nov 17, 2025
a149442
Revert "there's no way that just works, right?"
zadjii-msft Nov 19, 2025
6a1276d
make it work again
zadjii-msft Nov 20, 2025
e4b59c8
Turns out we changed the type of parameter passed
zadjii-msft Nov 20, 2025
40ff2f0
remove a bunch of files I don't need
zadjii-msft Nov 20, 2025
e4224ec
dedupe files
zadjii-msft Nov 20, 2025
3e5a797
works again
zadjii-msft Nov 20, 2025
bd6d4ca
code cleanup
zadjii-msft Nov 20, 2025
eba7c22
nit
zadjii-msft Nov 20, 2025
48f5bef
Resurrect the suggestion page
zadjii-msft Nov 21, 2025
51c7ba0
Final PR cleanup
zadjii-msft Nov 21, 2025
061b71e
@ me spellbot
zadjii-msft Nov 21, 2025
d970264
spellbot strikes again
zadjii-msft Nov 21, 2025
3f6d868
Visual changes to param
niels9001 Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,261 changes: 3,261 additions & 0 deletions PowerToys.sln

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ A markdown page is a page inside of command palette that displays markdown conte

```csharp
interface IMarkdownPage requires IPage {
String[] Bodies(); // TODO! should this be an IBody, so we can make it observable?
String[] Bodies();
IDetails Details();
IContextItem[] Commands { get; };
}
Expand Down
121 changes: 121 additions & 0 deletions doc/devdocs/modules/cmdpal/initial-sdk-spec/DraftB.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

class MyPrefixCommandProvider : ICommandProvider
{
private PeopleDynamicListPage _peopleCommand; // com.contoso.people

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error documentation

contoso is not a recognized word
private CommandsListPage _commandsCommand; // com.contoso.commands

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error documentation

contoso is not a recognized word
private AddFileCommand _addFileCommand; // com.contoso.addFile

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error documentation

contoso is not a recognized word

private PrefixSearchPage _prefixSearchPage;

public MyPrefixCommandProvider()
{
_prefixSearchPage = new PrefixSearchPage();

var tokenPickedHandler = _prefixSearchPage.HandleTokenPicked;

_peopleCommand = new PeopleDynamicListPage(tokenPickedHandler);
_commandsCommand = new CommandsListPage(tokenPickedHandler);
_addFileCommand = new AddFileCommand(tokenPickedHandler);
}

public ICommandItem[] GetTopLevelCommands()
{
return new ICommandItem[] { _prefixSearchPage };
}

public ICommand GetCommand(String id)
{
if (id == "com.contoso.people")

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error documentation

contoso is not a recognized word
{
return _peopleCommand;
}
else if (id == "com.contoso.commands")

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error documentation

contoso is not a recognized word
{
return _commandsCommand;
}
else if (id == "com.contoso.addFile")
{
return _addFileCommand;
}
return null;
}
}

class PrefixSearchPage : ListPage, IPrefixProvider
{
public IDictionary<String, String> PrefixCommands => new Dictionary<String, String>
{
{ "@", "com.contoso.people" },
{ "/", "com.contoso.commands" },
{ "+", "com.contoso.addFile" },
};

public event Windows.Foundation.TypedEventHandler<Object, ITokenPickedEventArgs> TokenAdded;

public PrefixSearchPage()
{
// Initialize the page...
}

public void SendQuery(ISearchUpdateArgs args)
{
// Handle the search update, possibly updating the list of items based on the new search text
var searchText = args.NewSearchText;
var properties = args.GetProperties();
var tokens = properties.TryLookup<object>("tokens") as ITokenPositions[];

// Here you could use these tokens to update the commands in our own search results
// Or just save them, and plumb them into the InvokableCommand the user eventually picks
}

public void HandleTokenPicked(object sender, ITokenPickedEventArgs args)
{
// Handle the token picked event, e.g., log it or update UI
var token = args.Token;
var text = token.DisplayText;
// Do something with the picked token
}

// Other ListPage members...
}

public class PeopleDynamicListPage : DynamicListPage
{
private Windows.Foundation.TypedEventHandler<Object, ITokenPickedEventArgs> _tokenPicked;

public PeopleDynamicListPage(TypedEventHandler<Object, ITokenPickedEventArgs> onTokenPicked)
{
_tokenPicked = onTokenPicked;
}

public override IListItem[] GetItems()
{
// Return the list of people items
return new IListItem[]
{
new PersonSuggestionItem("Alice", _tokenPicked),
new PersonSuggestionItem("Bob", _tokenPicked),
new PersonSuggestionItem("Charlie", _tokenPicked)
};
}

// Other DynamicListPage members...
}
public class PersonSuggestionItem : SuggestionListItem { /* ... */ }
public class SuggestionListItem : SuggestionListItem
{
private Windows.Foundation.TypedEventHandler<Object, ITokenPickedEventArgs> _tokenPicked;
private object _tokenValue;

public SuggestionListItem(object token, TypedEventHandler<Object, ITokenPickedEventArgs> onTokenPicked)
{
_tokenValue = token;
_tokenPicked = onTokenPicked;
}

public override ICommandResult Invoke()
{
_tokenPicked?.Invoke(this, new TokenPickedEventArgs(_tokenValue));
return CommandResult.KeepOpen;
}
}
Loading
Loading