Repository navigation
feat(emoji): rank completions by word start and match emoji keywords - #334
matheusfillipe wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Emoji keyword data src/vite-env.d.ts, vite.config.ts, src/components/chat/completionProviders.tsx |
Slim emoji records now include keywords from the emoji picker data. The completion item type and conversion include those keywords. |
Emoji ranking src/lib/emojiSearch.ts, tests/lib/emojiSearch.test.ts |
rankEmojis ranks exact names, prefixes, word starts, keyword word starts, and name substrings. Tests cover ranking, case handling, empty queries, and result limits. |
Chat completion integration src/components/chat/completionProviders.tsx, tests/components/chat/completionProviders.test.tsx |
The provider matches shortcode queries at the start of input or after a non-word, non-colon character. It accepts word characters, +, and - in the query and uses rankEmojis with the MAX_EMOJIS limit. Tests cover signed numeric queries, rejected colon placements, and completion immediately after an emoji. |
Priority:
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant ViteConfig
participant EmojiSlimData
participant CompletionProvider
participant RankEmojis
ViteConfig->>EmojiSlimData: Add picker keywords to slim emoji records
EmojiSlimData->>CompletionProvider: Provide emoji names and keywords
CompletionProvider->>RankEmojis: Rank shortcode query with MAX_EMOJIS limit
RankEmojis-->>CompletionProvider: Return ranked emoji matches
Merge Risk: 
Minimal · up to 7745d
-
The emoji completion changes have no identified merge-blocking issue and are mergeable subject to normal checks.
Pre-merge checks: 
5
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Automated deployment preview for the PR in the Cloudflare Pages. |
|
I'd prefer it if we didn't need a space after the first emoji before being able to :emoji another emoji, what do you think?
|
ab5d337 to
7745d78
Compare
done |
:rol<Tab>offeredcontrol_knobsfirst, because emoji completion matched any substring of the short name in dataset order. Words that are not in a short name, liketurdfor 💩 oreyerollfor 🙄, found nothing.rolhitsface_with_rolling_eyes), an emoji keyword, then plain substring last. Ties go to the shorter name.:+1and:100complete. A shortcode starts at the start of the line or after a space, so times like12:30andhost:8080stay text and Tab falls through to nicks.Summary by CodeRabbit
+and-. Suggestions can start at the beginning of input or after a non-word, non-colon character, including immediately after an emoji.