Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion pkg/tui/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func builtInSessionCommands() []Item {
ID: "settings.theme",
Label: "Theme",
SlashCommand: "/theme",
Description: "Change the color theme (saved globally)",
Description: "Change the color theme",
Category: "Settings",
Execute: func(string) tea.Cmd {
return core.CmdHandler(messages.OpenThemePickerMsg{})
Expand Down
3 changes: 2 additions & 1 deletion pkg/tui/dialog/command_palette.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ func (d *commandPaletteDialog) filterCommands() {
for _, cmd := range cat.Commands {
if strings.Contains(strings.ToLower(cmd.Label), query) ||
strings.Contains(strings.ToLower(cmd.Description), query) ||
strings.Contains(strings.ToLower(cmd.Category), query) {
strings.Contains(strings.ToLower(cmd.Category), query) ||
strings.Contains(strings.ToLower(cmd.SlashCommand), query) {
d.filtered = append(d.filtered, cmd)
}
}
Expand Down
27 changes: 17 additions & 10 deletions pkg/tui/dialog/command_palette_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,20 @@ var categories = []commands.Category{
Name: "Session",
Commands: []commands.Item{
{
ID: "session.new",
Label: "New Session",
Description: "Start a new conversation session",
Category: "Session",
Execute: func(string) tea.Cmd { return nil },
ID: "session.new",
Label: "New Session",
SlashCommand: "/new",
Description: "Start a new conversation session",
Category: "Session",
Execute: func(string) tea.Cmd { return nil },
},
{
ID: "session.compact",
Label: "Compact Session",
Description: "Summarize and compact the current conversation",
Category: "Session",
Execute: func(string) tea.Cmd { return nil },
ID: "session.compact",
Label: "Compact Session",
SlashCommand: "/compact",
Description: "Summarize and compact the current conversation",
Category: "Session",
Execute: func(string) tea.Cmd { return nil },
},
},
},
Expand All @@ -45,6 +47,11 @@ func TestCommandPaletteFiltering(t *testing.T) {
input: "new",
expected: []string{"session.new"},
},
{
name: "filter by slash command",
input: "/new",
expected: []string{"session.new"},
},
{
name: "filter by compact",
input: "compact",
Expand Down