Skip to content

added the emoji feature#92

Merged
DhanushNehru merged 2 commits into
DhanushNehru:mainfrom
IqraS-gif:emoji-tag
Oct 23, 2025
Merged

added the emoji feature#92
DhanushNehru merged 2 commits into
DhanushNehru:mainfrom
IqraS-gif:emoji-tag

Conversation

@IqraS-gif

Copy link
Copy Markdown
Contributor

Features Added in emoji-tag Branch

1. 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

@vercel

vercel Bot commented Oct 20, 2025

Copy link
Copy Markdown

@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.

@IqraS-gif

Copy link
Copy Markdown
Contributor Author

hey @DhanushNehru kindly review the pr

@IqraS-gif

Copy link
Copy Markdown
Contributor Author

hey @DhanushNehru any updates ?

@DhanushNehru DhanushNehru requested a review from Copilot October 22, 2025 17:02
@vercel

vercel Bot commented Oct 22, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
scratchpad-scribe Ready Ready Preview Comment Oct 23, 2025 2:34pm

@DhanushNehru

Copy link
Copy Markdown
Owner

Deployment failed @IqraS-gif

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(', ');

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
const tagString = activeNote.tags.map(t => `${t.emoji} ${t.label}`).join(', ');
const tagString = (activeNote.tags ?? []).map(t => `${t.emoji} ${t.label}`).join(', ');

Copilot uses AI. Check for mistakes.
isActive={note.id === activeNoteId}
onClick={() => onSelectNote(note.id)}
onDelete={() => onDelete(note.id)}
onDelete={onDelete || (() => {})}

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
onDelete={onDelete || (() => {})}
onDelete={onDelete}

Copilot uses AI. Check for mistakes.
onEmojiSelect={handleEmojiSelect}
theme="auto"
previewPosition="none"
// REMOVED: searchPosition="none" -> The search bar is now visible by default

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// REMOVED: searchPosition="none" -> The search bar is now visible by default
// The search bar is visible by default

Copilot uses AI. Check for mistakes.
<Button
size="sm"
onClick={handleAddTag}
disabled={newTagInput.label.trim() === '' || tags.length >= 5}

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
<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">

Copilot AI Oct 22, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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">

Copilot uses AI. Check for mistakes.
@IqraS-gif

Copy link
Copy Markdown
Contributor Author

I will look into it by Tomorrow

@learner-enthusiast

Copy link
Copy Markdown
Collaborator

The pipeline is failing i think you have added some packages push the package.json file as well

@IqraS-gif

Copy link
Copy Markdown
Contributor Author

The pipeline is failing i think you have added some packages push the package.json file as well

yes exactly , my bad!

@IqraS-gif

Copy link
Copy Markdown
Contributor Author

hey @DhanushNehru fixed the package.json issue, kindly check again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +42 to +51
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" },
];

Copilot AI Oct 23, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +108
const getSuggestions = (noteContent: string, currentTags: Tag[]): Tag[] => {
if (!noteContent || currentTags.length >= 5) return [];

Copilot AI Oct 23, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@DhanushNehru DhanushNehru merged commit 2fc45d9 into DhanushNehru:main Oct 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Emoji Icons to Tags

4 participants