added the emoji feature#92
Conversation
|
@IqraS-gif is attempting to deploy a commit to the Dhanush Nehru's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
hey @DhanushNehru kindly review the pr |
|
hey @DhanushNehru any updates ? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed @IqraS-gif |
There was a problem hiding this comment.
Pull Request Overview
This PR adds emoji-based tagging functionality to the notes application, enabling users to categorize notes with emoji tags, search by those tags, and receive automatic tag suggestions based on note content.
Key Changes:
- Implemented emoji tag system with emoji picker integration using
@emoji-mart/react - Enhanced search to filter notes by tag labels and emoji characters
- Added auto-suggestion feature that recommends tags based on keywords in note content
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/components/NotesSidebar.tsx | Updated search filter logic to support emoji and tag matching; modified toast API calls to use object parameter format |
| src/components/NoteEditor.tsx | Added tag management UI with emoji picker, tag input field, and keyword-based auto-suggestions; integrated third-party emoji library |
| src/components/NoteCard.tsx | Added visual display of tags as badges in the note card preview |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| doc.text(activeNote.title || 'Untitled Note', margin, margin); | ||
|
|
||
| doc.setFontSize(10); | ||
| const tagString = activeNote.tags.map(t => `${t.emoji} ${t.label}`).join(', '); |
There was a problem hiding this comment.
Accessing activeNote.tags without checking if it exists will cause a runtime error if tags is undefined. Add optional chaining: activeNote.tags?.map(...) or use a default empty array.
| const tagString = activeNote.tags.map(t => `${t.emoji} ${t.label}`).join(', '); | |
| const tagString = (activeNote.tags ?? []).map(t => `${t.emoji} ${t.label}`).join(', '); |
| isActive={note.id === activeNoteId} | ||
| onClick={() => onSelectNote(note.id)} | ||
| onDelete={() => onDelete(note.id)} | ||
| onDelete={onDelete || (() => {})} |
There was a problem hiding this comment.
The fallback to an empty function is unnecessary since onDelete is a required prop in the component signature. If the intention is to make it optional, update the NotesSidebarProps interface accordingly.
| onDelete={onDelete || (() => {})} | |
| onDelete={onDelete} |
| onEmojiSelect={handleEmojiSelect} | ||
| theme="auto" | ||
| previewPosition="none" | ||
| // REMOVED: searchPosition="none" -> The search bar is now visible by default |
There was a problem hiding this comment.
This comment describes a removal that isn't shown in the diff. Since removed code isn't visible here, the comment is misleading. Either remove this comment or rephrase it to explain the current configuration without referencing removed code.
| // REMOVED: searchPosition="none" -> The search bar is now visible by default | |
| // The search bar is visible by default |
| <Button | ||
| size="sm" | ||
| onClick={handleAddTag} | ||
| disabled={newTagInput.label.trim() === '' || tags.length >= 5} |
There was a problem hiding this comment.
The magic number 5 for max tags is hardcoded in multiple places (lines 103, 241, 249, 266). Extract this into a constant like MAX_TAGS_PER_NOTE at the top of the file for better maintainability.
| <div className="flex flex-wrap gap-1 mb-2"> | ||
| {note.tags.map(tag => ( | ||
| // Display tag as [emoji] [text] | ||
| <Badge key={tag.label} variant="outline" className="text-xs px-1.5 py-0.5 font-normal border-primary/50 text-primary/80 dark:border-primary-foreground/20 dark:text-primary-foreground/80"> |
There was a problem hiding this comment.
Using tag.label as the key could cause issues if duplicate labels exist (though the editor prevents this). Consider using a combination like ${tag.emoji}-${tag.label} or adding a unique ID to the Tag type for a more robust key.
| <Badge key={tag.label} variant="outline" className="text-xs px-1.5 py-0.5 font-normal border-primary/50 text-primary/80 dark:border-primary-foreground/20 dark:text-primary-foreground/80"> | |
| <Badge key={`${tag.emoji}-${tag.label}`} variant="outline" className="text-xs px-1.5 py-0.5 font-normal border-primary/50 text-primary/80 dark:border-primary-foreground/20 dark:text-primary-foreground/80"> |
|
I will look into it by Tomorrow |
|
The pipeline is failing i think you have added some packages push the package.json file as well |
yes exactly , my bad! |
|
hey @DhanushNehru fixed the package.json issue, kindly check again |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const KEYWORD_SUGGESTIONS: { keyword: string, emoji: string, label: string }[] = [ | ||
| { keyword: "bug", emoji: "🐛", label: "Bug" }, | ||
| { keyword: "error", emoji: "🐞", label: "Issue" }, | ||
| { keyword: "todo", emoji: "✅", label: "Task" }, | ||
| { keyword: "fix", emoji: "🛠️", label: "Fix" }, | ||
| { keyword: "plan", emoji: "📅", label: "Planning" }, | ||
| { keyword: "idea", emoji: "💡", label: "Idea" }, | ||
| { keyword: "concept", emoji: "🧠", label: "Concept" }, | ||
| { keyword: "project", emoji: "🚀", label: "Project" }, | ||
| ]; |
There was a problem hiding this comment.
[nitpick] The KEYWORD_SUGGESTIONS constant is defined within the component file but could be moved to a separate constants file or configuration module for better maintainability and reusability across the application.
| const getSuggestions = (noteContent: string, currentTags: Tag[]): Tag[] => { | ||
| if (!noteContent || currentTags.length >= 5) return []; |
There was a problem hiding this comment.
The magic number 5 for maximum tags appears both here and on line 246. This should be extracted as a named constant (e.g., MAX_TAGS_PER_NOTE) to improve maintainability and ensure consistency.
Features Added in
emoji-tagBranch1. Emoji-Based Tags
Added a feature to tag notes using emojis.
Example of a tag added:
2. Search by Emoji
Users can search notes using emoji tags.
3. Auto Tag Suggestion
Automatically suggests tags based on keywords.
Closes #34