Skip to content

Add Tag Suggestion Dropdown for Notes and Tasks #11

@RMCampos

Description

@RMCampos

Description

Implement a tag suggestion feature that displays existing tags in a dropdown when users are adding notes or tasks. This will help users select from existing tags instead of typing everything manually, promoting tag consistency across the application.

Requirements

Functionality

  • Display a dropdown showing all available tags when the tag input field is focused
  • Filter tags in real-time as the user types
  • Allow users to select a tag from the dropdown by clicking
  • Allow users to type and create a new tag if it's not in the list
  • Fetch existing tags from the API endpoint: ${ApiConfig.homeUrl}/tasks/tags
  • Tags are returned as an array of strings, sorted alphabetically

Constraints

  • Tasks and Notes can have only one tag
  • The backend is already implemented and ready to receive tags
  • No backend changes required
  • No unit tests required for this feature

Technical Details

Files to modify:

  • client/src/views/NoteAdd/index.tsx
  • client/src/views/TaskAdd/index.tsx

API Integration:

  • Endpoint: ${ApiConfig.homeUrl}/tasks/tags
  • Response format: string[] (array of strings, alphabetically sorted)
  • Reference: See Home view component for similar API call implementation

UI Framework:

  • Bootstrap 5 (no custom components)
  • Use Bootstrap dropdown or form components as appropriate

Implementation Suggestions

  1. Fetch tags when the component mounts or when the input is focused
  2. Store tags in component state
  3. Implement filtering logic to match user input against available tags
  4. Use Bootstrap's dropdown component to display filtered results
  5. Handle tag selection from dropdown
  6. Maintain ability to type custom tags not in the list

Acceptance Criteria

  • Tag dropdown appears when input field is focused
  • Dropdown displays all available tags initially
  • Tags are filtered in real-time as user types
  • User can select a tag by clicking from the dropdown
  • User can still type and submit a custom tag not in the list
  • Feature works consistently in both NoteAdd and TaskAdd views
  • Selected tag is properly sent to the backend
  • No console errors or warnings

Additional Notes

  • The backend already supports this feature and requires no changes
  • Focus on code reusability between NoteAdd and TaskAdd implementations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions