Skip to content

Commit

Permalink
💎 Improve emoji search
Browse files Browse the repository at this point in the history
When filtering emojis, the descrption was the only text that could be
searched.

By adding the emoji shortcode to the known terms, it will allow for the
visual representation of the emoji to be part of the search.
  • Loading branch information
mikelorant committed Mar 4, 2024
1 parent 61afb5f commit c348413
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/ui/header/emoji.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func (i listItem) FilterValue() string {
func (i fuzzyItem) Terms() []string {
return []string{
i.emoji.Description,
i.emoji.Shortcode,
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/ui/header/testdata/filter_emoji.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
┌──────────────────────────────────────────────────────────────────────────┐
│? Choose an emoji: bug ● │
│❯ 🐛 - Fix a bug. │
│ 🏗 - Make architectural changes. │
│ 👔 - Add or update business logic. │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────┘
2 changes: 1 addition & 1 deletion internal/ui/header/testdata/select_emoji_filter.golden
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
┌──────────────────────────────────────────────────────────────────────────┐
│? Choose an emoji: bug ● │
│❯ 🐛 - Fix a bug. │
│ 🏗 - Make architectural changes. │
│ 👔 - Add or update business logic. │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────┘

0 comments on commit c348413

Please sign in to comment.