Command palette with Title, style

This commit is contained in:
2023-07-29 16:01:25 +02:00
parent 604294fd2a
commit 05301f09c8
7 changed files with 77 additions and 39 deletions

View File

@@ -40,8 +40,9 @@ public partial class CommandPaletteService : ICommandPaletteService
public IReadOnlyList<ICommandPaletteEntry> GetCommands() =>
_identifiableUserCommandService
.GetCommandIdentifiers()
.Select(c => new CommandPaletteEntry(c, c))
.IdentifiableUserCommands
.Select(c => new CommandPaletteEntry(c.Key, c.Value.Title))
.OrderBy(c => c.Title)
.ToList()
.AsReadOnly();
}

View File

@@ -41,9 +41,8 @@ public class CommandPaletteViewModel : FuzzyPanelViewModel<ICommandPaletteEntryV
|| c.Identifier.Contains(SearchText, StringComparison.OrdinalIgnoreCase)
)
.Select(c =>
(ICommandPaletteEntryViewModel) new CommandPaletteEntryViewModel(c.Identifier, c.Title))
.Take(30) // TODO remove magic number
.OrderBy(c => c.Title)
(ICommandPaletteEntryViewModel) new CommandPaletteEntryViewModel(c.Identifier, c.Title)
)
.ToList();
public override async Task<bool> HandleKeyDown(KeyEventArgs keyEventArgs)