CmdPal: Implement IDetailsCommand in details (#39911)

Implemented IDetailsCommands in details. This will close #38339.

This works very similar to Tags in that it is a list of commands. This
was done to allow for styling without the 12 spacing of the
ItemsRepeater and looks like you'd find in the OS-inbox like:


![image](https://github.com/user-attachments/assets/97ee1952-13bb-4c8b-a074-0347b04e0c2c)


![image](https://github.com/user-attachments/assets/8f6f1f72-4ea0-441d-893e-ae26aabdc922)

Also added to our sample extension:


![image](https://github.com/user-attachments/assets/ab3ce521-3479-448f-b4d6-9dfd09feb24f)
This commit is contained in:
Michael Jolley
2025-06-05 08:56:13 -05:00
committed by GitHub
parent 78b29c5b66
commit bf9217ec24
8 changed files with 112 additions and 4 deletions

View File

@@ -4,7 +4,7 @@
namespace Microsoft.CommandPalette.Extensions.Toolkit;
public partial class DetailsCommand : IDetailsCommand
public partial class DetailsCommands : IDetailsCommands
{
public ICommand? Command { get; set; }
public ICommand[]? Commands { get; set; }
}

View File

@@ -182,8 +182,8 @@ namespace Microsoft.CommandPalette.Extensions
String Text { get; };
}
[contract(Microsoft.CommandPalette.Extensions.ExtensionsContract, 1)]
interface IDetailsCommand requires IDetailsData {
ICommand Command { get; };
interface IDetailsCommands requires IDetailsData {
ICommand[] Commands { get; };
}
[uuid("58070392-02bb-4e89-9beb-47ceb8c3d741")]
[contract(Microsoft.CommandPalette.Extensions.ExtensionsContract, 1)]